Allow " symbol to be in regex without leading by checking for *ptr+1 is not the end of the regex

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1057 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2002-02-02 07:13:02 +00:00
parent db3dc57a7e
commit 3d8e759a4c
2 changed files with 6 additions and 4 deletions

View File

@ -5,6 +5,10 @@ CVS code -
-C, --relative, changes to do_cursorpos(). -C, --relative, changes to do_cursorpos().
- Makefile.am: - Makefile.am:
- Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc. - Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc.
- rcfile.c
parse_next_rege()
- Allow " symbol to be in regex without leading \ by checking
for *ptr+1 is not the end of the regex.
- utils.c: - utils.c:
strstrwrapper() strstrwrapper()
- NANO_SMALL test was backwards (Ken Tyler). - NANO_SMALL test was backwards (Ken Tyler).

View File

@ -131,11 +131,9 @@ char *parse_next_word(char *ptr)
char *parse_next_regex(char *ptr) char *parse_next_regex(char *ptr)
{ {
char prev = ' '; while ((*ptr != '"' || (*(ptr+1) != ' ' && *(ptr+1) != '\n'))
while ((*ptr != '"' || prev == '\\') && *ptr != '\n' && *ptr != '\0') { && *ptr != '\n' && *ptr != '\0')
prev = *ptr;
ptr++; ptr++;
}
if (*ptr == '\0') if (*ptr == '\0')
return NULL; return NULL;