projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop command-logging from non-stdin sources.
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index 495a339bfcb51563238604789aea72fec991efe2..4d0a89d482a59ba9d93d1ef5ca8fc44864f2a232 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-724,7
+724,8
@@
L2: ATDWRF=I;
-/* Utility routines (SETBIT, TSTBIT, set_seed, get_next_lcg_value, randrange, RNDVOC, BUG) */
+/* Utility routines (SETBIT, TSTBIT, set_seed, get_next_lcg_value,
+ * randrange, RNDVOC, BUG) */
#undef SETBIT
long fSETBIT(long BIT) {
#undef SETBIT
long fSETBIT(long BIT) {
@@
-761,7
+762,7
@@
long TSTBIT;
void set_seed(long seedval)
{
void set_seed(long seedval)
{
-
lcgstate.x = (unsigned long) seedval % lcgstate.m;
+ lcgstate.x = (unsigned long) seedval % lcgstate.m;
}
unsigned long get_next_lcg_value(void)
}
unsigned long get_next_lcg_value(void)
@@
-854,8
+855,8
@@
void fBUG(long NUM) {
#define BUG(NUM) fBUG(NUM)
#undef MAPLIN
void fMAPLIN(FILE *OPENED) {
#define BUG(NUM) fBUG(NUM)
#undef MAPLIN
void fMAPLIN(FILE *OPENED) {
-
signed char *cp
;
-
+
long I, VAL
;
+
/* Read a line of input, from the specified input source,
* translate the chars to integers in the range 0-126 and store
* them in the common array "INLINE". Integer values are as follows:
/* Read a line of input, from the specified input source,
* translate the chars to integers in the range 0-126 and store
* them in the common array "INLINE". Integer values are as follows:
@@
-886,21
+887,23
@@
void fMAPLIN(FILE *OPENED) {
if (!oldstyle && SETUP && OPENED == stdin)
fputs("> ", stdout);
do {
if (!oldstyle && SETUP && OPENED == stdin)
fputs("> ", stdout);
do {
- IGNORE(fgets(
raw_input
,sizeof(INLINE)-1,OPENED));
+ IGNORE(fgets(
INLINE+1
,sizeof(INLINE)-1,OPENED));
} while
} while
- /* allow comments in logfiles */
- (!feof(OPENED) && raw_input[0] == '#');
+ (!feof(OPENED) && INLINE[1] == '#');
if (feof(OPENED)) {
if (logfp && OPENED == stdin)
fclose(logfp);
} else {
if (feof(OPENED)) {
if (logfp && OPENED == stdin)
fclose(logfp);
} else {
- if (logfp)
- IGNORE(fputs(
raw_input
, logfp));
+ if (logfp
&& OPENED == stdin
)
+ IGNORE(fputs(
INLINE+1
, logfp));
else if (!isatty(0))
else if (!isatty(0))
- IGNORE(fputs(raw_input, stdout));
- for (cp = raw_input; *cp; cp++)
- INLINE[cp - raw_input + 1]=MAP1[*cp + 1];
- LNLENG = (cp - raw_input);
+ IGNORE(fputs(INLINE+1, stdout));
+ LNLENG=0;
+ for (I=1; I<=sizeof(INLINE) && INLINE[I]!=0; I++) {
+ VAL=INLINE[I]+1;
+ INLINE[I]=MAP1[VAL];
+ if(INLINE[I] != 0)LNLENG=I;
+ } /* end loop */
LNPOSN=1;
}
}
LNPOSN=1;
}
}