version 1.36, 2008/12/13 15:19:29 |
version 1.37, 2008/12/20 17:38:37 |
Line 291 For_Run(int lineno) |
|
Line 291 For_Run(int lineno) |
|
{ |
{ |
For arg; |
For arg; |
LstNode ln; |
LstNode ln; |
char **values; |
|
int i, done = 0, len; |
int i, done = 0, len; |
char *guy, *orig_guy, *old_guy; |
char *guy, *orig_guy, *old_guy; |
|
|
Line 308 For_Run(int lineno) |
|
Line 307 For_Run(int lineno) |
|
if (Lst_Open(arg.lst) != SUCCESS) |
if (Lst_Open(arg.lst) != SUCCESS) |
return; |
return; |
|
|
values = bmake_malloc(arg.nvars * sizeof(char *)); |
|
|
|
while (!done) { |
while (!done) { |
/* |
/* |
* due to the dumb way this is set up, this loop must run |
* due to the dumb way this is set up, this loop must run |
Line 320 For_Run(int lineno) |
|
Line 317 For_Run(int lineno) |
|
if (ln == NULL) { |
if (ln == NULL) { |
done = 1; |
done = 1; |
break; |
break; |
} else { |
|
values[i] = (char *)Lst_Datum(ln); |
|
} |
} |
} |
Var_Set(arg.vars[i], Lst_Datum(ln), VAR_GLOBAL, 0); |
if (done) |
|
break; |
|
|
|
for (i = 0; i < arg.nvars; i++) { |
|
Var_Set(arg.vars[i], values[i], VAR_GLOBAL, 0); |
|
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(debug_file, "--- %s = %s\n", arg.vars[i], |
(void)fprintf(debug_file, "--- %s = %s\n", arg.vars[i], |
values[i]); |
(char *)Lst_Datum(ln)); |
} |
} |
|
if (done) |
|
break; |
|
|
/* |
/* |
* Hack, hack, kludge. |
* Hack, hack, kludge. |
Line 357 For_Run(int lineno) |
|
Line 349 For_Run(int lineno) |
|
Var_Delete(arg.vars[i], VAR_GLOBAL); |
Var_Delete(arg.vars[i], VAR_GLOBAL); |
} |
} |
|
|
free(values); |
|
|
|
Lst_Close(arg.lst); |
Lst_Close(arg.lst); |
|
|
for (i=0; i<arg.nvars; i++) { |
for (i=0; i<arg.nvars; i++) { |