diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2004-01-28 22:31:24 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2004-01-28 22:31:24 -0500 |
commit | 7352a91bc1925296bc103f972c9988178cbbbc43 (patch) | |
tree | d8a764e909e2a10d254a383386b0bbfef4210a7c /WWW/Library/Implementation | |
parent | a667eb0b51f7cb224924921194b4dfadfded3095 (diff) | |
download | lynx-snapshots-7352a91bc1925296bc103f972c9988178cbbbc43.tar.gz |
snapshot of project "lynx", label v2-8-5pre_4
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r-- | WWW/Library/Implementation/HTString.c | 52 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTString.h | 1 | ||||
-rw-r--r-- | WWW/Library/Implementation/www_tcp.h | 2 |
3 files changed, 34 insertions, 21 deletions
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c index 1e67d478..2177a108 100644 --- a/WWW/Library/Implementation/HTString.c +++ b/WWW/Library/Implementation/HTString.c @@ -1001,34 +1001,30 @@ PUBLIC void HTAddXpand ARGS4( #endif /* USE_QUOTED_PARAMETER */ /* - * Append string-parameter to a system command that we are constructing. The - * string is a complete parameter (which is a necessary assumption so we can - * quote it properly). We're given the index of the newest parameter we're - * processing. Zero indicates none, so a value of '1' indicates that we copy - * from the beginning of the command string up to the first parameter, - * substitute the quoted parameter and return the result. + * Append string to a system command that we are constructing, without quoting. + * We're given the index of the newest parameter we're processing. Zero + * indicates none, so a value of '1' indicates that we copy from the beginning + * of the command string up to the first parameter, substitute the quoted + * parameter and return the result. * * Parameters are substituted at "%s" tokens, like printf. Other printf-style * tokens are not substituted; they are passed through without change. */ -PUBLIC void HTAddParam ARGS4( +PUBLIC void HTAddToCmd ARGS4( char **, result, CONST char *, command, int, number, - CONST char *, parameter) + CONST char *, string) { if (number > 0) { CONST char *last = HTAfterCommandArg(command, number - 1); CONST char *next = last; -#if USE_QUOTED_PARAMETER - char *quoted; -#endif if (number <= 1) { FREE(*result); } - if (parameter == 0) - parameter = ""; + if (string == 0) + string = ""; while (next[0] != 0) { if (HTIsParam(next)) { if (next != last) { @@ -1037,13 +1033,7 @@ PUBLIC void HTAddParam ARGS4( HTSACat(result, last); (*result)[len] = 0; } -#if USE_QUOTED_PARAMETER - quoted = HTQuoteParameter(parameter); - HTSACat(result, quoted); - FREE(quoted); -#else - HTSACat(result, parameter); -#endif + HTSACat(result, string); CTRACE((tfp, "PARAM-ADD:%s\n", *result)); return; } @@ -1053,6 +1043,28 @@ PUBLIC void HTAddParam ARGS4( } /* + * Append string-parameter to a system command that we are constructing. The + * string is a complete parameter (which is a necessary assumption so we can + * quote it properly). + */ +PUBLIC void HTAddParam ARGS4( + char **, result, + CONST char *, command, + int, number, + CONST char *, parameter) +{ + if (number > 0) { +#if USE_QUOTED_PARAMETER + char *quoted = HTQuoteParameter(parameter); + HTAddToCmd(result, command, number, quoted); + FREE(quoted); +#else + HTAddToCmd(result, command, number, parameter); +#endif + } +} + +/* * Append the remaining command-string to a system command (compare with * HTAddParam). Any remaining "%s" tokens are copied as empty strings. */ diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h index a93f4a7e..af994c86 100644 --- a/WWW/Library/Implementation/HTString.h +++ b/WWW/Library/Implementation/HTString.h @@ -111,6 +111,7 @@ extern void HTAddXpand PARAMS((char ** result, CONST char * command, int number, #endif extern int HTCountCommandArgs PARAMS((CONST char * command)); +extern void HTAddToCmd PARAMS((char ** result, CONST char * command, int number, CONST char * string)); extern void HTAddParam PARAMS((char ** result, CONST char * command, int number, CONST char * parameter)); extern void HTEndParam PARAMS((char ** result, CONST char * command, int number)); diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h index 94db09ee..4cd4b76b 100644 --- a/WWW/Library/Implementation/www_tcp.h +++ b/WWW/Library/Implementation/www_tcp.h @@ -686,7 +686,7 @@ typedef unsigned short mode_t; #include <libgettext.h> #endif -#define N_(s) (s) +#define N_(s) s #ifndef HAVE_GETTEXT #define gettext(s) s |