tty.
retry:
#ifndef NO_HISTORY
#ifdef EDITLINE
- if (parsefile->fd == 0) {
+ if (parsefile->fd == 0 && editable) {
static const char *rl_cp= NULL;
static size_t rl_off= 0;
}
/*
- * $PchId: input.c,v 1.6 2006/05/23 12:00:32 philip Exp $
+ * $PchId: input.c,v 1.7 2006/05/29 13:09:38 philip Exp $
*/
char **argptr; /* argument list for builtin commands */
char *shoptarg; /* set by nextopt (like getopt) */
char *optptr; /* used by nextopt */
+int editable; /* isatty(0) && isatty(1) */
char *minusc; /* argument to -c option */
options(1);
if (*argptr == NULL && minusc == NULL)
sflag = 1;
- if (iflag == 2 && sflag == 1 && isatty(0) && isatty(1))
+ editable = (isatty(0) && isatty(1));
+ if (iflag == 2 && sflag == 1 && editable)
iflag = 1;
if (mflag == 2)
mflag = iflag;
}
/*
- * $PchId: options.c,v 1.5 2006/05/22 12:23:10 philip Exp $
+ * $PchId: options.c,v 1.6 2006/05/29 13:09:12 philip Exp $
*/
extern char **argptr; /* argument list for builtin commands */
extern char *shoptarg; /* set by nextopt */
extern char *optptr; /* used by nextopt */
+extern int editable; /* isatty(0) && isatty(1) */
void procargs(int, char **);
void optschanged(void);
void getoptsreset(const char *);
/*
- * $PchId: options.h,v 1.4 2006/03/29 15:37:43 philip Exp $
+ * $PchId: options.h,v 1.5 2006/05/29 13:08:45 philip Exp $
*/
{
whichprompt = which;
-#ifndef EDITLINE
#ifndef NO_HISTORY
+#ifdef EDITLINE
+ if (!editable)
+#else
if (!el)
-#endif
- out2str(getprompt(NULL));
#endif /* EDITLINE */
+#endif /* !NO_HISTORY */
+ out2str(getprompt(NULL));
}
/*
}
/*
- * $PchId: parser.c,v 1.5 2006/05/22 12:27:09 philip Exp $
+ * $PchId: parser.c,v 1.6 2006/05/29 13:08:11 philip Exp $
*/