Refactor modname() to use add_pathsep

Based on splinterofchaos review
This commit is contained in:
Mark Bainter 2015-05-04 11:36:54 -05:00
parent a56b09005a
commit a2273164b6

View File

@ -4375,10 +4375,8 @@ char *modname(const char *fname, const char *ext, bool prepend_dot)
xfree(retval); xfree(retval);
return NULL; return NULL;
} }
if (!after_pathsep(retval, retval + fnamelen)) { add_pathsep(retval);
retval[fnamelen++] = PATHSEP; fnamelen = strlen(retval);
retval[fnamelen] = NUL;
}
prepend_dot = FALSE; // nothing to prepend a dot to prepend_dot = FALSE; // nothing to prepend a dot to
} else { } else {
fnamelen = strlen(fname); fnamelen = strlen(fname);