summaryrefslogtreecommitdiff
path: root/sed.c
diff options
context:
space:
mode:
authorMark Whitley2001-03-14 21:11:49 +0000
committerMark Whitley2001-03-14 21:11:49 +0000
commit038c8eb5a99edac57f73552645a7196a64e0dbeb (patch)
tree50aca30d243515ae783da0d4c06d2d18a067c164 /sed.c
parent7ddaf7caaeb2b13d3ddf66ab6715a2eaa6cc9ed3 (diff)
downloadbusybox-038c8eb5a99edac57f73552645a7196a64e0dbeb.zip
busybox-038c8eb5a99edac57f73552645a7196a64e0dbeb.tar.gz
Applied patch from Erik Habbinga to fix a problem with an uninitialized
substitution delimiter.
Diffstat (limited to 'sed.c')
-rw-r--r--sed.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sed.c b/sed.c
index 0f0f4a2..a18f6e5 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;
}