frontend/parser/lexical.c, cp_lexer(), allow # and * comment

Both, whether interactive or not.
Especially for command scripts.
This commit is contained in:
rlar 2017-06-08 16:52:24 +02:00
parent 6903584e99
commit b803b294b4
3 changed files with 2 additions and 7 deletions

View File

@ -220,9 +220,6 @@ ft_cpinit(void)
}
}
/* Reset this for the front end. */
cp_hash = '*';
/* set variables to read program configuration into special spinit for VS */
#ifdef _MSC_VER
#ifdef CONFIG64

View File

@ -54,7 +54,6 @@ bool cp_interactive = TRUE;
bool cp_bqflag = FALSE;
char *cp_promptstring = NULL;
char *cp_altprompt = NULL;
char cp_hash = '#';
static int numeofs = 0;
@ -199,9 +198,9 @@ nloop:
if ((c == EOF) && cp_bqflag)
c = '\n';
/* '#' as the first character in a line,
/* '#' or '*' as the first character in a line,
starts a comment line, drop it */
if ((c == cp_hash) && !cp_interactive && (linebuf.i == 1)) {
if ((c == '#' || c == '*') && (linebuf.i == 1)) {
if (string) {
wl_free(wlist);
tfree(buf.s);

View File

@ -107,7 +107,6 @@ extern bool cp_bqflag;
extern bool cp_interactive;
extern char *cp_altprompt;
extern char *cp_promptstring;
extern char cp_hash;
extern int cp_event;
extern wordlist *cp_lexer(char *string);
extern int inchar(FILE *fp);