diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-10-21 15:06:36 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-10-21 15:06:36 +0300 |
commit | eb82f993679d8552d05bfc671bb3909c8f3f0573 (patch) | |
tree | 985ed6aacdda386224fa7c4bcbe814ca7b87d0df /nasmlib | |
parent | 1f620b8e8445d9f61a309f536e670e49adb16542 (diff) | |
parent | fdb1a1b15130d858d51916cca7e09a2566c4b69f (diff) | |
download | nasm-eb82f993679d8552d05bfc671bb3909c8f3f0573.tar.gz |
Merge branch 'nasm-2.14.xx'
* nasm-2.14.xx:
preproc: Make the preprocessor use nasm_catfile for include
path: nasm_catfile -- Fix incorrect return of filename only
Diffstat (limited to 'nasmlib')
-rw-r--r-- | nasmlib/path.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nasmlib/path.c b/nasmlib/path.c index 9dadaba8..d228ed1e 100644 --- a/nasmlib/path.c +++ b/nasmlib/path.c @@ -164,7 +164,7 @@ char *nasm_catfile(const char *dir, const char *file) #else size_t dl = strlen(dir); size_t fl = strlen(file); - char *p; + char *p, *pp; bool dosep = true; if (!dl || ismatch(separators, dir[dl-1])) { @@ -172,14 +172,14 @@ char *nasm_catfile(const char *dir, const char *file) dosep = false; } - p = nasm_malloc(dl + fl + dosep + 1); + p = pp = nasm_malloc(dl + fl + dosep + 1); - memcpy(p, dir, dl); - p += dl; + memcpy(pp, dir, dl); + pp += dl; if (dosep) - *p++ = catsep; + *pp++ = catsep; - memcpy(p, file, fl+1); + memcpy(pp, file, fl+1); return p; #endif |