- Timestamp:
- Jan 11, 2022, 11:50:30 AM (2 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 5d4dff6b68be525f37108c56b442972d6d093258
- Parents:
- 676e2a091749a42bee06cf6f1c818c7058262096
- Location:
- kernel/oswrapper
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/oswrapper/feread.cc
r676e2a0 reacca4 102 102 103 103 extern "C" { 104 VAR BOOLEAN using_history_called=FALSE; 104 105 typedef char * (*RL_PROC)(const char*,int); 105 106 #ifdef READLINE_READLINE_H_OK … … 362 363 } 363 364 365 using_history_called=FALSE; 364 366 if(isatty(fileno(stdin))) 365 367 { 366 368 /* try to read a history */ 369 using_history_called=TRUE; 367 370 using_history(); 368 371 char *p = getenv("SINGULARHIST"); … … 384 387 /* do dynamic loading */ 385 388 int res=fe_init_dyn_rl(); 389 using_history_called=FALSE; 386 390 if (res!=0) 387 391 { … … 407 411 /* try to read a history */ 408 412 (*fe_using_history)(); 413 using_history_called=TRUE; 409 414 char *p = getenv("SINGULARHIST"); 410 415 if (p != NULL) -
kernel/oswrapper/feread.h
r676e2a0 reacca4 9 9 10 10 EXTERN_VAR char prompt_char; /*1 either '>' or '.'*/ 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 EXTERN_VAR BOOLEAN using_history_called; /*1 either '>' or '.'*/ 16 #ifdef __cplusplus 17 } 18 #endif 11 19 12 #define SINGULARHIST_FILE ".singularhist"20 #define SINGULARHIST_FILE (char*)".singularhistory" 13 21 14 22 #ifdef __cplusplus -
kernel/oswrapper/fereadl.c
r676e2a0 reacca4 798 798 break; 799 799 } 800 using_history_called=FALSE; 800 801 if (res!=0) dynl_close(fe_rl_hdl); 801 802 else … … 808 809 (*fe_rl_attempted_completion_function) = (CPPFunction *)singular_completion; 809 810 /* try to read a history */ 811 using_history_called=TRUE; 810 812 (*fe_using_history)(); 811 813 p = getenv("SINGULARHIST"); 812 if (p != NULL) 814 if (p==NULL) p=SINGULARHIST_FILE; 815 if (strlen(p) != 0) 813 816 { 814 817 (*fe_read_history) (p); … … 833 836 if ((strlen(p) != 0) && (fe_history_total_bytes != NULL)) 834 837 { 835 if(( *fe_history_total_bytes)()!=0)838 if((using_history_called && (*fe_history_total_bytes)()!=0)) 836 839 (*fe_write_history) (p); 837 840 } … … 841 844 if (strlen(p) != 0) 842 845 { 843 if( history_total_bytes()!=0)846 if(using_history_called &&(history_total_bytes()!=0)) 844 847 write_history (p); 845 848 }
Note: See TracChangeset
for help on using the changeset viewer.