IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 17, 2009, 4:52:31 PM (17 years ago)
Author:
eugene
Message:

report unparsed line on error

File:
1 edited

Legend:

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

    r7938 r25436  
    55
    66  int i, status, argc;
    7   char **argv, **targv;
     7  char **argv, **targv, *rawline;
    88  Command *cmd;
     9
     10  rawline = strcreate (line);
    911
    1012  /* force a space between ! and first word: !ls becomes ! ls */
     
    3133
    3234  argv = parse_commands (line, &argc);
    33   if (argc == 0) return (TRUE);  /* empty command or assignment */
     35  if (argc == 0) {
     36      FREE (rawline);
     37      return (TRUE);  /* empty command or assignment */
     38  }
    3439
    3540  /* save the original values of argv since command may modify the array */
     
    5459    msg = get_variable_ptr ("ERRORMSG");
    5560    if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg);
     61    gprint (GP_ERR, "error on line: %s\n", rawline);
    5662  }
    5763
     
    6268  # endif
    6369
     70  FREE (rawline);
    6471  return (status);
    6572}
Note: See TracChangeset for help on using the changeset viewer.