Documentation polishing.
[open-adventure.git] / misc.c
diff --git a/misc.c b/misc.c
index 8f0a2b21680dc11522f1057e02d5d5da501cf442..b1f3f8367ad66f427dc1884bdcbb531a89f9b0b7 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #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;