X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=45fa742cd9ce9d095490ebc68fa199023f8da8cc;hb=d883b2dbafeed3ebd9d7a56ab1469373bd001a3b;hp=434ab95748fb34497af2d3fe79e43789638b1736;hpb=2b6310fd24dba8e0fca8999916a162f0a1842a84;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 434ab95..45fa742 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -96,6 +96,7 @@ int default_device = 1; /* Using /dev/tty or equivalent */ char devnam[MAXPATHLEN]; /* Device name */ bool nodetach = 0; /* Don't detach from controlling tty */ bool updetach = 0; /* Detach once link is up */ +bool master_detach; /* Detach when we're (only) multilink master */ int maxconnect = 0; /* Maximum connect time */ char user[MAXNAMELEN]; /* Username for PAP */ char passwd[MAXSECRETLEN]; /* Password for PAP */ @@ -210,6 +211,9 @@ option_t general_options[] = { "Detach from controlling tty once link is up", OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach }, + { "master_detach", o_bool, &master_detach, + "Detach when we're multilink master but have no link", 1 }, + { "holdoff", o_int, &holdoff, "Set time in seconds before retrying connection", OPT_PRIO, &holdoff_specified }, @@ -1146,6 +1150,7 @@ getword(f, word, newlinep, filename) len = 0; escape = 0; comment = 0; + quoted = 0; /* * First skip white-space and comments. @@ -1203,15 +1208,6 @@ getword(f, word, newlinep, filename) break; } - /* - * Save the delimiter for quoted strings. - */ - if (!escape && (c == '"' || c == '\'')) { - quoted = c; - c = getc(f); - } else - quoted = 0; - /* * Process characters until the end of the word. */ @@ -1300,29 +1296,34 @@ getword(f, word, newlinep, filename) if (!got) c = getc(f); continue; - } /* - * Not escaped: see if we've reached the end of the word. + * Backslash starts a new escape sequence. */ - if (quoted) { - if (c == quoted) - break; - } else { - if (isspace(c) || c == '#') { - ungetc (c, f); - break; - } + if (c == '\\') { + escape = 1; + c = getc(f); + continue; } /* - * Backslash starts an escape sequence. + * Not escaped: check for the start or end of a quoted + * section and see if we've reached the end of the word. */ - if (c == '\\') { - escape = 1; + if (quoted) { + if (c == quoted) { + quoted = 0; + c = getc(f); + continue; + } + } else if (c == '"' || c == '\'') { + quoted = c; c = getc(f); continue; + } else if (isspace(c) || c == '#') { + ungetc (c, f); + break; } /* @@ -1351,6 +1352,9 @@ getword(f, word, newlinep, filename) */ if (len == 0) return 0; + if (quoted) + option_error("warning: quoted word runs to end of file (%.20s...)", + filename, word); } /*