X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=b1f3f8367ad66f427dc1884bdcbb531a89f9b0b7;hb=0388d294d466278ddb0d8b62ea87a3cc3c672030;hp=8f0a2b21680dc11522f1057e02d5d5da501cf442;hpb=040f19adde85fdd78628eb390a685907804f85ae;p=open-adventure.git diff --git a/misc.c b/misc.c index 8f0a2b2..b1f3f83 100644 --- a/misc.c +++ b/misc.c @@ -1,3 +1,4 @@ +#include #include #include #include "main.h" @@ -174,7 +175,7 @@ void fSETPRM(long FIRST, long P1, long P2) { void fGETIN(long *wORD1, long *wORD1X, long *wORD2, long *wORD2X) { long JUNK; -/* Get a command from the adventurer. snarf out the first word, pad it with +/* Get a command from the adventurer. Snarf out the first word, pad it with * blanks, and return it in WORD1. Chars 6 thru 10 are returned in WORD1X, in * case we need to print out the whole word in an error message. Any number of * blanks may follow the word. If a second word appears, it is returned in @@ -884,8 +885,15 @@ long I, VAL; if(MAP2[1] == 0)MPINIT(); + if (!oldstyle && isatty(0)) + fputs("> ", stdout); IGNORE(fgets(INLINE+1,sizeof(INLINE)-1,OPENED)); - if (!feof(OPENED)) { + if (feof(OPENED)) { + if (logfp) + fclose(logfp); + } else { + if (logfp) + IGNORE(fputs(INLINE+1, logfp)); LNLENG=0; for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) { VAL=INLINE[I]+1;