diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 1999-11-24 19:53:55 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 1999-11-24 19:53:55 +0000 |
commit | 2a85a99246e25d5abbe1b496067814fdc7606010 (patch) | |
tree | 9f56bed029667b0213469e8421cf97534fcb3e62 /usr.bin/ssh/readconf.c | |
parent | dd3fb3473fec908b6e655a7105db7198b435a324 (diff) |
KNF, final part 3
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r-- | usr.bin/ssh/readconf.c | 69 |
1 files changed, 42 insertions, 27 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 68f97758040..961da4a06d6 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$Id: readconf.c,v 1.18 1999/11/24 00:26:02 deraadt Exp $"); +RCSID("$Id: readconf.c,v 1.19 1999/11/24 19:53:49 markus Exp $"); #include "ssh.h" #include "cipher.h" @@ -158,8 +158,10 @@ static struct { #define WHITESPACE " \t\r\n" -/* Adds a local TCP/IP port forward to options. Never returns if there - is an error. */ +/* + * Adds a local TCP/IP port forward to options. Never returns if there is an + * error. + */ void add_local_forward(Options *options, int port, const char *host, @@ -179,8 +181,10 @@ add_local_forward(Options *options, int port, const char *host, fwd->host_port = host_port; } -/* Adds a remote TCP/IP port forward to options. Never returns if there - is an error. */ +/* + * Adds a remote TCP/IP port forward to options. Never returns if there is + * an error. + */ void add_remote_forward(Options *options, int port, const char *host, @@ -196,8 +200,10 @@ add_remote_forward(Options *options, int port, const char *host, fwd->host_port = host_port; } -/* Returns the number of the token pointed to by cp of length len. - Never returns if the token is not known. */ +/* + * Returns the number of the token pointed to by cp of length len. Never + * returns if the token is not known. + */ static OpCodes parse_token(const char *cp, const char *filename, int linenum) @@ -213,8 +219,10 @@ parse_token(const char *cp, const char *filename, int linenum) return oBadOption; } -/* Processes a single option line as used in the configuration files. - This only sets those values that have not already been set. */ +/* + * Processes a single option line as used in the configuration files. This + * only sets those values that have not already been set. + */ int process_config_line(Options *options, const char *host, @@ -229,8 +237,7 @@ process_config_line(Options *options, const char *host, if (!*cp || *cp == '\n' || *cp == '#') return 0; - /* Get the keyword. (Each line is supposed to begin with a - keyword). */ + /* Get the keyword. (Each line is supposed to begin with a keyword). */ cp = strtok(cp, WHITESPACE); { char *t = cp; @@ -243,7 +250,8 @@ process_config_line(Options *options, const char *host, switch (opcode) { case oBadOption: - return -1; /* don't panic, but count bad options */ + /* don't panic, but count bad options */ + return -1; /* NOTREACHED */ case oForwardAgent: intptr = &options->forward_agent; @@ -424,8 +432,8 @@ parse_int: #else { char *ptr; - value = strtol(cp, &ptr, 0); /* Octal, decimal, or - hex format? */ + /* Octal, decimal, or hex format? */ + value = strtol(cp, &ptr, 0); if (cp == ptr) fatal("%.200s line %d: Bad number.", filename, linenum); } @@ -506,8 +514,7 @@ parse_int: *activep = 1; break; } - /* Avoid garbage check below, as strtok already returned - NULL. */ + /* Avoid garbage check below, as strtok already returned NULL. */ return 0; case oEscapeChar: @@ -544,9 +551,11 @@ parse_int: } -/* Reads the config file and modifies the options accordingly. Options should - already be initialized before this call. This never returns if there - is an error. If the file does not exist, this returns immediately. */ +/* + * Reads the config file and modifies the options accordingly. Options + * should already be initialized before this call. This never returns if + * there is an error. If the file does not exist, this returns immediately. + */ void read_config_file(const char *filename, const char *host, Options *options) @@ -563,8 +572,10 @@ read_config_file(const char *filename, const char *host, Options *options) debug("Reading configuration data %.200s", filename); - /* Mark that we are now processing the options. This flag is - turned on/off by Host specifications. */ + /* + * Mark that we are now processing the options. This flag is turned + * on/off by Host specifications. + */ active = 1; linenum = 0; while (fgets(line, sizeof(line), f)) { @@ -579,10 +590,12 @@ read_config_file(const char *filename, const char *host, Options *options) filename, bad_options); } -/* Initializes options to special values that indicate that they have not - yet been set. Read_config_file will only set options with this value. - Options are processed in the following order: command line, user config - file, system config file. Last, fill_default_options is called. */ +/* + * Initializes options to special values that indicate that they have not yet + * been set. Read_config_file will only set options with this value. Options + * are processed in the following order: command line, user config file, + * system config file. Last, fill_default_options is called. + */ void initialize_options(Options * options) @@ -628,8 +641,10 @@ initialize_options(Options * options) options->log_level = (LogLevel) - 1; } -/* Called after processing other sources of option data, this fills those - options for which no value has been specified with their default values. */ +/* + * Called after processing other sources of option data, this fills those + * options for which no value has been specified with their default values. + */ void fill_default_options(Options * options) |