mirror of
https://github.com/sheumann/hush.git
synced 2024-08-02 22:29:05 +00:00
Applied patch from Erik Habbinga to fix a problem with an uninitialized
substitution delimiter.
This commit is contained in:
parent
7ddaf7caae
commit
038c8eb5a9
@ -154,6 +154,9 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
|
|||||||
{
|
{
|
||||||
char *my_str = strdup(str);
|
char *my_str = strdup(str);
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
char olddelimiter;
|
||||||
|
olddelimiter = sed_cmd->delimiter;
|
||||||
|
sed_cmd->delimiter = '/';
|
||||||
|
|
||||||
if (isdigit(my_str[idx])) {
|
if (isdigit(my_str[idx])) {
|
||||||
do {
|
do {
|
||||||
@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(my_str);
|
free(my_str);
|
||||||
|
sed_cmd->delimiter = olddelimiter;
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
sed.c
4
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);
|
char *my_str = strdup(str);
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
char olddelimiter;
|
||||||
|
olddelimiter = sed_cmd->delimiter;
|
||||||
|
sed_cmd->delimiter = '/';
|
||||||
|
|
||||||
if (isdigit(my_str[idx])) {
|
if (isdigit(my_str[idx])) {
|
||||||
do {
|
do {
|
||||||
@ -182,6 +185,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(my_str);
|
free(my_str);
|
||||||
|
sed_cmd->delimiter = olddelimiter;
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user