From e4d27bee99b287d66ff1c61fcb902ee79721735e Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Thu, 23 Sep 2021 01:06:53 +0300 Subject: [PATCH] Return 2 to indicate the end of structured proxyspec, not 1 Return value of 1 is for ending macro expansion. Otherwise, it coincided with closing brace retval, which was wrongly breaking out of the while loop in load_proxyspec_struct(). TODO: Use enums for return values. --- src/opts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opts.c b/src/opts.c index d0cc4d8..d2fc788 100644 --- a/src/opts.c +++ b/src/opts.c @@ -4516,8 +4516,8 @@ set_proxyspec_option(proxyspec_t *spec, const char *argv0, fprintf(stderr, "Incomplete ProxySpec on line %d\n", line_num); return -1; } - // Return 1 to indicate the end of structured proxyspec - return 1; + // Return 2 to indicate the end of structured proxyspec + return 2; } else { return set_option(spec->opts, argv0, name, value, natengine, line_num, NULL); @@ -4667,7 +4667,7 @@ load_proxyspec_struct(global_t *global, const char *argv0, char **natengine, int } if (retval == -1) { goto leave; - } else if (retval == 1) { + } else if (retval == 2) { closing_brace = 1; } free(line);