IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 17, 2007, 3:39:12 PM (20 years ago)
Author:
eugene
Message:

fixed problem with list in macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/ListOps.c

    r11007 r11119  
    157157}
    158158
     159// list (word) : nested list
     160// list (word) -x : not nested list
     161// list (word) -split : not nested list
     162int is_list_data (char *line) {
     163
     164  char *comm, *temp;
     165
     166  temp = thisword (nextword (nextword (line)));
     167  comm = thisword (line);
     168
     169  if (comm == NULL) goto escape;
     170
     171  if (strcmp (comm, "list")) goto escape;
     172
     173  /* if (cond) (command) does not define a complete block */
     174  if (temp != NULL) {
     175      if (!strcmp (temp, "-x")) goto escape;
     176      if (!strcmp (temp, "-split")) goto escape;
     177      if (!strcmp (temp, "-add")) goto escape;
     178  }
     179
     180  if (temp != NULL) free (temp);
     181  if (comm != NULL) free (comm);
     182  return (TRUE);
     183
     184escape:
     185  if (comm != NULL) free (comm);
     186  if (temp != NULL) free (temp);
     187  return (FALSE);
     188}
     189
    159190int is_loop (char *line) {
    160191
     
    216247  status |= is_macro_create (line);
    217248  status |= is_for_loop (line);
     249  status |= is_list_data (line);
    218250  status |= is_loop (line);
    219251  status |= is_task (line);
Note: See TracChangeset for help on using the changeset viewer.