one would result in the part of the string prior to the non-existent one
getting dropped.
svn path=/trunk/yasm/; revision=1738
* intact, if ENVVAR is not set in the environment.
*/
pb = file;
+ p1 = pb;
for (;;) {
char *env;
- p1 = pb;
while (*p1 != '\0' && *p1 != '%')
p1++;
if (*p1 == '\0')
error(ERR_WARNING, "environment variable `%s' does not exist",
p1+1);
*p2 = '%';
- pb = p2+1;
+ p1 = p2+1;
continue;
}
/* need to expand */
strcat(file2, pb);
strcat(file2, env);
pb = p2+1;
+ p1 = pb;
}
/* add tail end; string is long enough that we don't need to realloc */
if (file2)