From: Peter Johnson Date: Sat, 28 Oct 2006 22:04:18 +0000 (-0000) Subject: Add trailing slashes on include paths again (functionality deleted in X-Git-Tag: v0.6.0~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b27a7d51a0b67a71f24c0ce25155964503aada8f;p=yasm Add trailing slashes on include paths again (functionality deleted in [1669]). svn path=/trunk/yasm/; revision=1672 --- diff --git a/libyasm/file.c b/libyasm/file.c index f558695a..30515cf4 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -468,7 +468,16 @@ void yasm_add_include_path(const char *path) { incpath *np = yasm_xmalloc(sizeof(incpath)); - np->path = yasm__xstrdup(path); + size_t len = strlen(path); + + np->path = yasm_xmalloc(len+2); + memcpy(np->path, path, len+1); + /* Add trailing slash if it is missing */ + if (path[len-1] != '\\' && path[len-1] != '/') { + np->path[len] = '/'; + np->path[len+1] = '\0'; + } + STAILQ_INSERT_TAIL(&incpaths, np, link); }