summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index f3e1135..0810a92 100644
--- a/main.c
+++ b/main.c
@@ -974,6 +974,13 @@ int main (int argc, char ** argv)
if (*p == '\\')
*p = '/';
}
+ /* If argv[0] is not in absolute form, prepend the current
+ directory. This can happen when Make is invoked by another DJGPP
+ program that uses a non-absolute name. */
+ if (current_directory[0] != '\0'
+ && argv[0] != 0
+ && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':')))
+ argv[0] = concat (current_directory, "/", argv[0]);
#else /* !__MSDOS__ */
if (current_directory[0] != '\0'
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)