Changeset 42389 for trunk/Ohana/src/opihi/lib.shell/expand_vectors.c
- Timestamp:
- Feb 8, 2023, 12:17:35 PM (3 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/opihi/lib.shell/expand_vectors.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/opihi/lib.shell/expand_vectors.c
r42080 r42389 28 28 ALLOCATE (newline, char, NLINE); 29 29 30 // special case: don't expand vectors in while () statement 31 char *V0 = thiscomm (line); 32 if (V0 && !strncmp ("while", V0, strlen(V0))) { 33 strcpy (newline, line); 34 free (line); 35 return (newline); 36 } 37 free (V0); 38 30 39 /* look for form fred[stuff] */ 31 /* skip first word (command) */ 32 L = nextword (line); 40 if (*line == '(') { 41 // if line is "(stuff)" then do not skip first word 42 L = line; 43 } else { 44 /* skip first word (command) */ 45 L = nextword (line); 46 } 33 47 if (L == NULL) { 34 48 free (newline); … … 37 51 38 52 n = L - line; 39 strncpy (newline, line, n);53 strncpy_nowarn (newline, line, n); 40 54 N = newline + n; 41 55 J = 0; … … 242 256 243 257 n = (int) (w - L); 244 strncpy (N, L, n);258 strncpy_nowarn (N, L, n); 245 259 N += n; 246 260 n = strlen (strValue); 247 strncpy (N, strValue, n);261 strncpy_nowarn (N, strValue, n); 248 262 N += n; 249 263 L = q + 1; … … 260 274 261 275 n = strlen (L); 262 strncpy (N, L, n); 263 N[n] = 0; 276 strncpy_nowarn (N, L, n); 264 277 free (line); 265 278 return (newline);
Note:
See TracChangeset
for help on using the changeset viewer.
