projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Flush log on interrupt, just for convenience.
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index b6ca80e3094dd7373802b7014c6314e32e4819fc..a656cbc24e22823699ec9c2a132942f9a0a03626 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-1,6
+1,7
@@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "main.h"
#include "share.h" /* for SETUP */
#include "misc.h"
#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 {
if (!oldstyle && SETUP && OPENED == stdin)
fputs("> ", stdout);
do {
- IGNORE(fgets(
INLINE+1,sizeof(INLINE
)-1,OPENED));
+ IGNORE(fgets(
rawbuf,sizeof(rawbuf
)-1,OPENED));
} while
} while
- (!feof(OPENED) &&
INLINE[1
] == '#');
+ (!feof(OPENED) &&
rawbuf[0
] == '#');
if (feof(OPENED)) {
if (logfp && OPENED == stdin)
fclose(logfp);
} else {
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))
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;
LNLENG=0;
for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) {
VAL=INLINE[I]+1;