Changeset eacca4 in git for kernel


Ignore:
Timestamp:
Jan 11, 2022, 11:50:30 AM (2 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5d4dff6b68be525f37108c56b442972d6d093258
Parents:
676e2a091749a42bee06cf6f1c818c7058262096
Message:
singularhist-> singularhistory and using_history_called
Location:
kernel/oswrapper
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/oswrapper/feread.cc

    r676e2a0 reacca4  
    102102
    103103extern "C" {
     104  VAR BOOLEAN using_history_called=FALSE;
    104105  typedef char * (*RL_PROC)(const char*,int);
    105106  #ifdef READLINE_READLINE_H_OK
     
    362363  }
    363364
     365  using_history_called=FALSE;
    364366  if(isatty(fileno(stdin)))
    365367  {
    366368    /* try to read a history */
     369    using_history_called=TRUE;
    367370    using_history();
    368371    char *p = getenv("SINGULARHIST");
     
    384387  /* do dynamic loading */
    385388  int res=fe_init_dyn_rl();
     389  using_history_called=FALSE;
    386390  if (res!=0)
    387391  {
     
    407411    /* try to read a history */
    408412    (*fe_using_history)();
     413    using_history_called=TRUE;
    409414    char *p = getenv("SINGULARHIST");
    410415    if (p != NULL)
  • kernel/oswrapper/feread.h

    r676e2a0 reacca4  
    99
    1010EXTERN_VAR char    prompt_char; /*1 either '>' or '.'*/
     11#ifdef __cplusplus
     12extern "C"
     13{
     14#endif
     15EXTERN_VAR BOOLEAN using_history_called; /*1 either '>' or '.'*/
     16#ifdef __cplusplus
     17}
     18#endif
    1119
    12 #define SINGULARHIST_FILE ".singularhist"
     20#define SINGULARHIST_FILE (char*)".singularhistory"
    1321
    1422#ifdef __cplusplus
  • kernel/oswrapper/fereadl.c

    r676e2a0 reacca4  
    798798    break;
    799799  }
     800  using_history_called=FALSE;
    800801  if (res!=0) dynl_close(fe_rl_hdl);
    801802  else
     
    808809    (*fe_rl_attempted_completion_function) = (CPPFunction *)singular_completion;
    809810    /* try to read a history */
     811    using_history_called=TRUE;
    810812    (*fe_using_history)();
    811813    p = getenv("SINGULARHIST");
    812     if (p != NULL)
     814    if (p==NULL) p=SINGULARHIST_FILE;
     815    if (strlen(p) != 0)
    813816    {
    814817      (*fe_read_history) (p);
     
    833836  if ((strlen(p) != 0) && (fe_history_total_bytes != NULL))
    834837  {
    835     if((*fe_history_total_bytes)()!=0)
     838    if((using_history_called && (*fe_history_total_bytes)()!=0))
    836839      (*fe_write_history) (p);
    837840  }
     
    841844  if (strlen(p) != 0)
    842845  {
    843     if(history_total_bytes()!=0)
     846    if(using_history_called &&(history_total_bytes()!=0))
    844847      write_history (p);
    845848  }
Note: See TracChangeset for help on using the changeset viewer.