Bug fix with WorkingDir
authorceriel <none@none>
Fri, 16 Jan 1987 16:14:22 +0000 (16:14 +0000)
committerceriel <none@none>
Fri, 16 Jan 1987 16:14:22 +0000 (16:14 +0000)
util/cpp/main.c

index fc581c3..bb1ea8d 100644 (file)
@@ -5,6 +5,7 @@
 
 extern struct tokenname tkidf[], tkkey[];
 extern char *symbol2str();
+extern char *getwdir();
 extern char *inctable[];
 extern int err_occurred;
 int idfsize = IDFSIZE;
@@ -56,10 +57,10 @@ compile(argc, argv)
                fatal("use: %s [options] [source]", prog_name);
                break;
        }
-       WorkingDir = inctable[0];
 
        if (!InsertFile(source, (char **) 0, &dummy)) /* read the source file   */
                fatal("%s: no source file %s\n", prog_name, 
                        source ? source : "stdin");
+       WorkingDir = getwdir(dummy);
        preprocess(source);
 }