Changeset 31667 for trunk/Ohana/src/opihi/lib.shell/CommandOps.c
- Timestamp:
- Jun 22, 2011, 12:40:23 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/CommandOps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/CommandOps.c
r16888 r31667 106 106 } 107 107 108 /* we need a strcreate function that does NOT use the ohana memory management 109 * system to interact with some external libraries (which themselves free the memory) 110 */ 111 char *strcreate_sans_ohana (char *string) { 112 113 char *line; 114 115 if (string == (char *) NULL) return ((char *) NULL); 116 117 line = malloc (MAX (1, strlen(string)) + 1); 118 line = strcpy (line, string); 119 120 return (line); 121 } 122 108 123 /* generate a command completion list for readline */ 109 124 /**** these probably do not interact well with OHANA memory!!! ****/ … … 122 137 for (i++; i < Ncommands; i++) { 123 138 if (!len) 124 return (strcreate(commands[i].name)); 139 140 141 return (strcreate_sans_ohana(commands[i].name)); 125 142 if (!strncmp (commands[i].name, text, len)) { 126 return (strcreate (commands[i].name));143 return (strcreate_sans_ohana(commands[i].name)); 127 144 } 128 145 }
Note:
See TracChangeset
for help on using the changeset viewer.
