#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "main.h"
#include "share.h" /* for SETUP */
#include "misc.h"
if (!oldstyle && SETUP && OPENED == stdin)
fputs("> ", stdout);
do {
- IGNORE(fgets(INLINE+1,sizeof(INLINE)-1,OPENED));
+ IGNORE(fgets(rawbuf,sizeof(INLINE)-1,OPENED));
} while
(!feof(OPENED) && INLINE[1] == '#');
if (feof(OPENED)) {
if (logfp && OPENED == stdin)
fclose(logfp);
} else {
- if (logfp)
- IGNORE(fputs(INLINE+1, logfp));
+ if (logfp && OPENED == stdin)
+ IGNORE(fputs(rawbuf, logfp));
else if (!isatty(0))
- IGNORE(fputs(INLINE+1, stdout));
+ IGNORE(fputs(rawbuf, stdout));
+ strcpy(INLINE+1, rawbuf);
LNLENG=0;
for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) {
VAL=INLINE[I]+1;