From: Mark Whitley Date: Wed, 14 Mar 2001 21:11:49 +0000 (-0000) Subject: Applied patch from Erik Habbinga to fix a problem with an uninitialized X-Git-Tag: 0_50~29 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=038c8eb5a99edac57f73552645a7196a64e0dbeb;p=oweals%2Fbusybox.git Applied patch from Erik Habbinga to fix a problem with an uninitialized substitution delimiter. --- diff --git a/editors/sed.c b/editors/sed.c index 0f0f4a28d..a18f6e522 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -154,6 +154,9 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege { char *my_str = strdup(str); int idx = 0; + char olddelimiter; + olddelimiter = sed_cmd->delimiter; + sed_cmd->delimiter = '/'; if (isdigit(my_str[idx])) { do { @@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege } free(my_str); + sed_cmd->delimiter = olddelimiter; return idx; } diff --git a/sed.c b/sed.c index 0f0f4a28d..a18f6e522 100644 --- a/sed.c +++ b/sed.c @@ -154,6 +154,9 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege { char *my_str = strdup(str); int idx = 0; + char olddelimiter; + olddelimiter = sed_cmd->delimiter; + sed_cmd->delimiter = '/'; if (isdigit(my_str[idx])) { do { @@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege } free(my_str); + sed_cmd->delimiter = olddelimiter; return idx; }