Changeset 27587 for trunk/Ohana/src/opihi/cmd.basic/list.c
- Timestamp:
- Apr 2, 2010, 4:01:44 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/list.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/list.c
r25965 r27587 74 74 set_int_variable (line, nWords); 75 75 76 return (TRUE); 77 } 78 79 // return an error if -copy is given with no other args 80 if ((argc > 2) && (!strcmp (argv[2], "-copy"))) { 81 char *value; 82 if (argc == 3) { 83 gprint (GP_ERR, "USAGE: list (newlist) -copy (oldlist) ...\n"); 84 return (FALSE); 85 } 86 87 sprintf (line, "%s:n", argv[3]); 88 N = get_int_variable (line, &found); 89 sprintf (line, "%s:n", argv[1]); 90 set_int_variable (line, N); 91 for (i = 0; i < N; i++) { 92 sprintf (line, "%s:%d", argv[3], i); 93 value = get_variable (line); 94 sprintf (line, "%s:%d", argv[1], i); 95 set_str_variable (line, value); 96 } 76 97 return (TRUE); 77 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
