IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42914


Ignore:
Timestamp:
Aug 24, 2025, 11:54:49 AM (11 months ago)
Author:
eugene
Message:

for some opihi shells, we do NOT want to save the history; if HISTORY is set to NONE or not set, do not call add_history. this avoids memory build up and general sluggishness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-unions-20250528/Ohana/src/opihi/lib.shell/opihi.c

    r40652 r42914  
    44int opihi (int argc, char **argv) {
    55
    6   int Nbad;
    76  char *line, *prompt, *history;
    87  pid_t ppid;
     
    1514  welcome ();
    1615
    17   Nbad = 0;
     16  // if HISTORY is defined, and does not have the value NONE, save history
     17  int SaveHistory = TRUE;
     18  if (!history || !strcasecmp(history, "none")) { SaveHistory = FALSE; }
     19
     20  int Nbad = 0;
    1821  while (1) {  /** must exit with command "exit" or "quit" */
    1922    if (Nbad == 10) exit (20);
     
    4043    if (*line) {
    4144      multicommand (line);
    42       add_history (line);
     45      if (SaveHistory) { add_history (line); }
    4346
    4447// the libedit version of readline does not support an incremental write to history file
    4548# ifdef RL_READLINE_VERSION
    46       if (history != NULL) append_history (1, history);
     49      if (SaveHistory) { append_history (1, history); }
    4750# endif
    4851
Note: See TracChangeset for help on using the changeset viewer.