diff options
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 633cf437e3..3fa616b788 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1576,12 +1576,20 @@ char *tempfn_xxxxxx(const char *p) { if (!t) return NULL; + /* + * Turns this: + * /foo/bar/waldo + * + * Into this: + * /foo/bar/.waldoXXXXXX + */ + fn = basename(p); k = fn - p; strcpy(stpcpy(stpcpy(mempcpy(t, p, k), "."), fn), "XXXXXX"); - *ret = t; + *ret = path_kill_slashes(t); return 0; } |