X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=a656cbc24e22823699ec9c2a132942f9a0a03626;hb=5c4fdc35ebeb58655c8d6ae7a2f883395f49ca0c;hp=4d0a89d482a59ba9d93d1ef5ca8fc44864f2a232;hpb=580565e254e3efaf14e237ca4de6a902e6d50a0b;p=open-adventure.git diff --git a/misc.c b/misc.c index 4d0a89d..a656cbc 100644 --- a/misc.c +++ b/misc.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "main.h" #include "share.h" /* for SETUP */ #include "misc.h" @@ -887,17 +888,18 @@ long I, VAL; if (!oldstyle && SETUP && OPENED == stdin) fputs("> ", stdout); do { - IGNORE(fgets(INLINE+1,sizeof(INLINE)-1,OPENED)); + IGNORE(fgets(rawbuf,sizeof(rawbuf)-1,OPENED)); } while - (!feof(OPENED) && INLINE[1] == '#'); + (!feof(OPENED) && rawbuf[0] == '#'); if (feof(OPENED)) { if (logfp && OPENED == stdin) fclose(logfp); } else { if (logfp && OPENED == stdin) - IGNORE(fputs(INLINE+1, logfp)); + 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;