Changeset 3922 for trunk/Ohana/src/opihi/lib.shell/ListOps.c
- Timestamp:
- May 12, 2005, 10:09:10 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/ListOps.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/ListOps.c
r2598 r3922 39 39 int is_for_loop (char *line) { 40 40 41 int status; 41 42 char *comm; 42 43 43 44 comm = thisword (line); 44 45 if (comm == (char *) NULL) return (FALSE); 45 46 if (strcmp (comm, "for")) { 47 free (comm); 48 return (FALSE); 49 } 50 51 return (TRUE); 52 46 47 status = !strcmp (comm, "for"); 48 free (comm); 49 return (status); 53 50 } 54 51 55 52 int is_macro_create (char *line) { 56 53 57 int i, N ;54 int i, N, status; 58 55 char *comm; 59 56 char *this_macro; 60 57 58 comm = thisword (line); 59 if (comm == (char *) NULL) return (FALSE); 61 60 62 comm = thisword (line); 63 if (comm == (char *) NULL) 64 return (FALSE); 65 if (strcmp (comm, "macro")) { 66 free (comm); 67 return (FALSE); 68 } 61 status = !strcmp (comm, "macro"); 62 free (comm); 63 if (!status) return (FALSE); 69 64 70 65 this_macro = thisword (nextword (line)); 71 66 72 if (this_macro == (char *)NULL) { 73 return (FALSE); 74 } 67 if (this_macro == (char *)NULL) return (FALSE); 75 68 76 69 N = sizeof (in_macro) / sizeof (Command); … … 101 94 if (strcmp (comm, "if")) goto escape; 102 95 96 /* if (cond) break does not define a complete block */ 103 97 if ((temp != NULL) && !strcmp (temp, "break")) goto escape; 104 98 105 free (comm); 99 if (temp != NULL) free (temp); 100 if (comm != NULL) free (comm); 106 101 return (TRUE); 107 102 … … 114 109 int is_loop (char *line) { 115 110 111 int status; 116 112 char *comm; 117 113 … … 119 115 if (comm == (char *) NULL) return (FALSE); 120 116 121 if (strcmp (comm, "while")) { 122 free (comm); 123 return (FALSE); 124 } 117 status = !strcmp (comm, "while"); 125 118 free (comm); 126 return ( TRUE);119 return (status); 127 120 } 128 121
Note:
See TracChangeset
for help on using the changeset viewer.
