IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2011, 12:40:23 AM (15 years ago)
Author:
eugene
Message:

merge from trunk: various details, see eam/ipp-20110505

File:
1 edited

Legend:

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

    r16888 r31667  
    106106
    107107
     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 */
     111char *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
    108123/* generate a command completion list for readline */
    109124/**** these probably do not interact well with OHANA memory!!! ****/
     
    122137  for (i++; i < Ncommands; i++) {
    123138    if (!len)
    124       return (strcreate(commands[i].name));
     139
     140
     141      return (strcreate_sans_ohana(commands[i].name));
    125142    if (!strncmp (commands[i].name, text, len)) {
    126       return (strcreate(commands[i].name));
     143      return (strcreate_sans_ohana(commands[i].name));
    127144    }
    128145  }
Note: See TracChangeset for help on using the changeset viewer.