Skip to content

Commit 393e51b

Browse files
committed
conf: remove second instance of empty parens ERE group
likewise
1 parent b07f7a8 commit 393e51b

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/conf.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -743,15 +743,8 @@ static HANDLE_FUNC (handle_listen)
743743

744744
static HANDLE_FUNC (handle_errorfile)
745745
{
746-
/*
747-
* Because an integer is defined as ((0x)?[[:digit:]]+) _two_
748-
* match places are used. match[2] matches the full digit
749-
* string, while match[3] matches only the "0x" part if
750-
* present. This is why the "string" is located at
751-
* match[4] (rather than the more intuitive match[3].
752-
*/
753746
unsigned long int err = get_long_arg (line, &match[MGROUP1+2]);
754-
char *page = get_string_arg (line, &match[MGROUP1+4]);
747+
char *page = get_string_arg (line, &match[MGROUP1+3]);
755748

756749
if(add_new_errorpage (conf, page, err) < 0) {
757750
CP_WARN ("add_new_errorpage() failed: '%s'", page);
@@ -974,7 +967,7 @@ static HANDLE_FUNC (handle_upstream)
974967
mi += 5;
975968

976969
port = (int) get_long_arg (line, &match[mi]);
977-
mi += 3;
970+
mi += 2;
978971

979972
if (match[mi].rm_so != -1)
980973
domain = get_string_arg (line, &match[mi]);

src/conf_regex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define WS SPACE "+"
1313
#define STR "\"([^\"]+)\""
1414
#define BOOL "(yes|on|no|off)"
15-
#define INT "(()" DIGIT "+)"
15+
#define INT "(" DIGIT "+)"
1616
#define ALNUM "([-a-z0-9._]+)"
1717
#define USERNAME "([^:]*)"
1818
#define PASSWORD "([^@]*)"

0 commit comments

Comments
 (0)