- Timestamp:
- Oct 6, 2006, 10:28:33 AM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 added
- 2 edited
-
cmd.data/queuepop.c (modified) (3 diffs)
-
cmd.data/test/queues.sh (added)
-
lib.data/queues.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/queuepop.c
r8192 r9359 18 18 19 19 Key = NULL; 20 Value = NULL; 20 21 if ((N = get_argument (argc, argv, "-key"))) { 21 22 remove_argument (N, &argc, argv); … … 49 50 return (FALSE); 50 51 } else { 51 gprint (GP_ERR, "%s\n", line); 52 gprint (GP_LOG, "%s\n", line); 53 free (line); 52 54 return (TRUE); 53 55 } … … 58 60 } else { 59 61 set_str_variable (var, line); 62 free (line); 60 63 } 61 64 62 free ( line);65 free (var); 63 66 if (Key != NULL) free (Key); 67 if (Value != NULL) free (Value); 64 68 65 69 return (TRUE); -
trunk/Ohana/src/opihi/lib.data/queues.c
r9280 r9359 141 141 } 142 142 143 // return a newly allocated string containing the requested key value 143 144 char *ChooseSingleKey (char *line, int Key) { 144 145 … … 146 147 char *key, *p; 147 148 149 if (Key == -1) { 150 key = strcreate (line); 151 return (key); 152 } 153 148 154 key = line; 149 if (Key == -1) return line;150 151 155 for (i = 0; (i < Key) && (key != NULL); i++) { 152 156 p = nextword (key); … … 192 196 first = FALSE; 193 197 } 194 195 198 return (output); 196 199 } … … 337 340 test = ChooseKey (queue[0].lines[i], Key); 338 341 if (test == NULL) continue; 339 if (strcmp (value, test)) continue; 342 if (strcmp (value, test)) { 343 free (test); 344 continue; 345 } 346 free (test); 340 347 choice = i; 341 348 }
Note:
See TracChangeset
for help on using the changeset viewer.
