Changeset 5ad50e in git
- Timestamp:
- Oct 13, 2016, 1:52:44 PM (7 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 0750b0232fb64224c4524f35243e993f0bbfc3fa
- Parents:
- 2f0e59ef2bb6687c4bd3dca4c82a1d6283b28dec
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2016-10-13 13:52:44+02:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2016-10-13 13:53:27+02:00
- Location:
- kernel/oswrapper
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/oswrapper/feread.cc
r2f0e59e r5ad50e 342 342 rl_outstream = fopen( "/dev/tty", "w" ); 343 343 #else 344 rl_outstream = fopen( ttyname(fileno(stdout)), "w" ); 344 char *fn=ttyname(fileno(stdin));//if stdout is not a tty, maybe stdin is? 345 if (fn!=NULL) rl_outstream = fopen( fn, "w" ); 345 346 #endif 346 347 } 347 348 348 /* try to read a history */ 349 using_history(); 350 char *p = getenv("SINGULARHIST"); 351 if (p != NULL) 352 { 353 read_history (p); 354 } 355 fe_fgets_stdin=fe_fgets_stdin_rl; 356 return(fe_fgets_stdin_rl(pr,s,size)); 349 if(isatty(fileno(stdin))) 350 { 351 /* try to read a history */ 352 using_history(); 353 char *p = getenv("SINGULARHIST"); 354 if (p != NULL) 355 { 356 read_history (p); 357 } 358 fe_fgets_stdin=fe_fgets_stdin_rl; 359 return(fe_fgets_stdin_rl(pr,s,size)); 360 } 361 else 362 { 363 fe_fgets_stdin=fe_fgets; 364 return(fe_fgets(pr,s,size)); 365 } 357 366 #endif 358 367 #ifdef HAVE_DYN_RL … … 374 383 return fe_fgets_stdin(pr,s,size); 375 384 } 376 else /*could load libreadline: */385 else if (isatty(STDIN_FILENO))/*and could load libreadline: */ 377 386 { 378 387 /* Allow conditional parsing of the ~/.inputrc file. */ … … 387 396 (*fe_read_history) (p); 388 397 } 389 } 390 391 /* set the output stream */ 392 if(!isatty(STDOUT_FILENO)) 393 { 394 #ifdef atarist 395 *fe_rl_outstream = fopen( "/dev/tty", "w" ); 396 #else 397 *fe_rl_outstream = fopen( ttyname(fileno(stdout)), "w" ); 398 #endif 399 } 400 401 fe_fgets_stdin=fe_fgets_stdin_drl; 402 return fe_fgets_stdin_drl(pr,s,size); 398 399 /* set the output stream */ 400 if(!isatty(STDOUT_FILENO)) 401 { 402 #ifdef atarist 403 *fe_rl_outstream = fopen( "/dev/tty", "w" ); 404 #else 405 char *fn=ttyname(fileno(stdin));//if stdout is not a tty, maybe stdin is? 406 if (fn!=NULL) *fe_rl_outstream = fopen( fn, "w" ); 407 #endif 408 } 409 fe_fgets_stdin=fe_fgets_stdin_drl; 410 return fe_fgets_stdin_drl(pr,s,size); 411 } 412 else 413 { 414 fe_fgets_stdin=fe_fgets; 415 return fe_fgets(pr,s,size); 416 } 403 417 #else 404 418 #if !defined(HAVE_READLINE) && defined(HAVE_FEREAD) -
kernel/oswrapper/fereadl.c
r2f0e59e r5ad50e 804 804 fe_read_history=dynl_sym(fe_rl_hdl,"read_history"); 805 805 if (fe_read_history==NULL) { res=14; break; } 806 return 0;807 } 808 dynl_close(fe_rl_hdl);809 if (res==0)806 break; 807 } 808 if (res!=0) dynl_close(fe_rl_hdl); 809 else 810 810 { 811 811 char *p;
Note: See TracChangeset
for help on using the changeset viewer.