diff options
Diffstat (limited to 'src/tet3/tcc/utils.c')
-rw-r--r-- | src/tet3/tcc/utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tet3/tcc/utils.c b/src/tet3/tcc/utils.c index 7555b193..b984e2d2 100644 --- a/src/tet3/tcc/utils.c +++ b/src/tet3/tcc/utils.c @@ -47,6 +47,7 @@ MODIFICATIONS: #include <time.h> #include <ctype.h> #include <string.h> +#include <errno.h> #include "dtmac.h" #include "error.h" #include "globals.h" @@ -224,6 +225,15 @@ int pathlen, remote; ASSERT(file && *file); + /* Use the current directory if none specified */ + if (!dir) { + char cwd[MAXPATH]; + + errno = 0; + if (!GETCWD(cwd, MAXPATH)) + fatal(errno, "getcwd() failed", NULL); + dir = cwd; + } if ( (remote && !isabspathrem(file)) || |