Changeset 9844
- Timestamp:
- Nov 3, 2006, 7:24:42 AM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 2 edited
-
cmd.basic/run_while.c (modified) (2 diffs)
-
lib.shell/expand_vars.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/run_while.c
r7917 r9844 6 6 7 7 int ThisList, depth, i, done, status, NLINES, j; 8 char *input, *val ;8 char *input, *val, *logic_line; 9 9 int logic, size; 10 10 Macro loop; … … 83 83 if (loop_continue) continue; 84 84 85 val = dvomath (1, &argv[1], &size, 0); 85 logic_line = strcreate (argv[1]); 86 logic_line = expand_vars (logic_line); 87 val = dvomath (1, &logic_line, &size, 0); 88 free (logic_line); 89 86 90 if (val == NULL) return (FALSE); 87 91 logic = atof (val); /* warning: round-off error is a danger */ -
trunk/Ohana/src/opihi/lib.shell/expand_vars.c
r7917 r9844 11 11 found = FALSE; 12 12 ALLOCATE (newline, char, 1024); /* WARNING: this limits the length of the input line */ 13 14 V0 = thiscomm (line); 15 if (V0 && !strncmp ("while", V0, strlen(V0))) { 16 // special case: don't expand variables in while () statement 17 strcpy (newline, line); 18 free (line); 19 return (newline); 20 } 13 21 14 22 /* look for form $a$b..$n and expand only the last ones */
Note:
See TracChangeset
for help on using the changeset viewer.
