diff options
author | Mark Whitley <markw@lineo.com> | 2001-03-14 21:11:49 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-03-14 21:11:49 +0000 |
commit | 038c8eb5a99edac57f73552645a7196a64e0dbeb (patch) | |
tree | 50aca30d243515ae783da0d4c06d2d18a067c164 | |
parent | 7ddaf7caaeb2b13d3ddf66ab6715a2eaa6cc9ed3 (diff) | |
download | busybox-w32-038c8eb5a99edac57f73552645a7196a64e0dbeb.tar.gz busybox-w32-038c8eb5a99edac57f73552645a7196a64e0dbeb.tar.bz2 busybox-w32-038c8eb5a99edac57f73552645a7196a64e0dbeb.zip |
Applied patch from Erik Habbinga to fix a problem with an uninitialized
substitution delimiter.
-rw-r--r-- | editors/sed.c | 4 | ||||
-rw-r--r-- | sed.c | 4 |
2 files changed, 8 insertions, 0 deletions
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 | |||
154 | { | 154 | { |
155 | char *my_str = strdup(str); | 155 | char *my_str = strdup(str); |
156 | int idx = 0; | 156 | int idx = 0; |
157 | char olddelimiter; | ||
158 | olddelimiter = sed_cmd->delimiter; | ||
159 | sed_cmd->delimiter = '/'; | ||
157 | 160 | ||
158 | if (isdigit(my_str[idx])) { | 161 | if (isdigit(my_str[idx])) { |
159 | do { | 162 | do { |
@@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
182 | } | 185 | } |
183 | 186 | ||
184 | free(my_str); | 187 | free(my_str); |
188 | sed_cmd->delimiter = olddelimiter; | ||
185 | return idx; | 189 | return idx; |
186 | } | 190 | } |
187 | 191 | ||
@@ -154,6 +154,9 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
154 | { | 154 | { |
155 | char *my_str = strdup(str); | 155 | char *my_str = strdup(str); |
156 | int idx = 0; | 156 | int idx = 0; |
157 | char olddelimiter; | ||
158 | olddelimiter = sed_cmd->delimiter; | ||
159 | sed_cmd->delimiter = '/'; | ||
157 | 160 | ||
158 | if (isdigit(my_str[idx])) { | 161 | if (isdigit(my_str[idx])) { |
159 | do { | 162 | do { |
@@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
182 | } | 185 | } |
183 | 186 | ||
184 | free(my_str); | 187 | free(my_str); |
188 | sed_cmd->delimiter = olddelimiter; | ||
185 | return idx; | 189 | return idx; |
186 | } | 190 | } |
187 | 191 | ||