Corrected coding error in tilde expansion of .include filenames.

This commit is contained in:
Tim Edwards 2017-06-22 08:12:41 -04:00
parent 41939adb84
commit ab9659af17
1 changed files with 2 additions and 2 deletions

View File

@ -777,7 +777,7 @@ skip_ends:
/* For ~/<path>, substitute tilde from $HOME */ /* For ~/<path>, substitute tilde from $HOME */
userpath = getenv("HOME"); userpath = getenv("HOME");
iname = (char *)MALLOC(strlen(userpath) + strlen(iptr)); iname = (char *)MALLOC(strlen(userpath) + strlen(iptr));
sprintf(fname, "%s%s", userpath, iptr + 1); sprintf(iname, "%s%s", userpath, iptr + 1);
} }
else if (*iptr == '~') { else if (*iptr == '~') {
/* For ~<user>/<path>, substitute tilde from getpwnam() */ /* For ~<user>/<path>, substitute tilde from getpwnam() */
@ -791,7 +791,7 @@ skip_ends:
if (pathstart) { if (pathstart) {
*pathstart = '/'; *pathstart = '/';
iname = (char *)MALLOC(strlen(userpath) + strlen(pathstart) + 1); iname = (char *)MALLOC(strlen(userpath) + strlen(pathstart) + 1);
sprintf(fname, "%s%s", userpath, pathstart); sprintf(iname, "%s%s", userpath, pathstart);
} }
else { else {
/* Almost certainly an error, but make the substitution anyway */ /* Almost certainly an error, but make the substitution anyway */