mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Cleanup cmd_string_uppercase
This commit is contained in:
parent
4df7703d62
commit
49f6d0ded8
@ -1,3 +1,7 @@
|
|||||||
|
2013-06-22 Ángel González <keisial@gmail.com>
|
||||||
|
|
||||||
|
* init.c (cmd_string_uppercase): Rewrite function.
|
||||||
|
|
||||||
2013-06-19 Tim Ruehsen <tim.ruehsen@gmx.de>
|
2013-06-19 Tim Ruehsen <tim.ruehsen@gmx.de>
|
||||||
|
|
||||||
* connect.c (socket_ip_address): zero out ip address structure to
|
* connect.c (socket_ip_address): zero out ip address structure to
|
||||||
|
15
src/init.c
15
src/init.c
@ -965,15 +965,16 @@ cmd_string (const char *com, const char *val, void *place)
|
|||||||
static bool
|
static bool
|
||||||
cmd_string_uppercase (const char *com, const char *val, void *place)
|
cmd_string_uppercase (const char *com, const char *val, void *place)
|
||||||
{
|
{
|
||||||
char *q;
|
char *q, **pstring;
|
||||||
bool ret = cmd_string (com, val, place);
|
pstring = (char **)place;
|
||||||
q = *((char **) place);
|
xfree_null (*pstring);
|
||||||
if (!ret || q == NULL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for ( ;*q; *q++)
|
*pstring = xmalloc (strlen (val) + 1);
|
||||||
*q = c_toupper (*q);
|
|
||||||
|
|
||||||
|
for (q = *pstring; *val; val++, q++)
|
||||||
|
*q = c_toupper (*val);
|
||||||
|
|
||||||
|
*q = '\0';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user