IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2023, 12:17:35 PM (3 years ago)
Author:
eugene
Message:

merge from eam_branches/ipp-20220316. fixes for more pendantic gcc; add opihi memory stats; string vector improvements; use named macros for fixed string lengths

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/lib.shell/expand_vectors.c

    r42080 r42389  
    2828  ALLOCATE (newline, char, NLINE);
    2929
     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
    3039  /* 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  }
    3347  if (L == NULL) {
    3448    free (newline);
     
    3751
    3852  n = L - line;
    39   strncpy (newline, line, n);
     53  strncpy_nowarn (newline, line, n);
    4054  N = newline + n;
    4155  J = 0;
     
    242256
    243257    n = (int) (w - L);
    244     strncpy (N, L, n);
     258    strncpy_nowarn (N, L, n);
    245259    N += n;
    246260    n = strlen (strValue);
    247     strncpy (N, strValue, n);
     261    strncpy_nowarn (N, strValue, n);
    248262    N += n;
    249263    L = q + 1;
     
    260274
    261275  n = strlen (L);
    262   strncpy (N, L, n);
    263   N[n] = 0;
     276  strncpy_nowarn (N, L, n);
    264277  free (line);
    265278  return (newline);
Note: See TracChangeset for help on using the changeset viewer.