Commit 8d37416b 8d37416b26506fb7b2de215b21cda744603fce2a by Sergey Poznyakoff

Minor fix in libstring

* libmailutils/string/mkfilename.c (mu_make_file_name_suf): Don't
add leading / if dir=="".
1 parent 1485ab7d
......@@ -36,12 +36,13 @@ mu_make_file_name_suf (const char *dir, const char *file, const char *suf)
while (dirlen > 0 && dir[dirlen-1] == '/')
dirlen--;
len = dirlen + 1 + fillen + suflen;
len = dirlen + (dir[0] ? 1 : 0) + fillen + suflen;
tmp = mu_alloc (len + 1);
if (tmp)
{
memcpy (tmp, dir, dirlen);
tmp[dirlen++] = '/';
if (dir[0])
tmp[dirlen++] = '/';
memcpy (tmp + dirlen, file, fillen);
if (suf)
memcpy (tmp + dirlen + fillen, suf, suflen);
......