From: Glenn L McGrath Date: Wed, 1 Oct 2003 10:26:23 +0000 (-0000) Subject: Patch from Rob Landley to fix backrefs X-Git-Tag: 1_00_pre4~151 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ad4daa54ea646ef60eab56b664d97386cd95a85;p=oweals%2Fbusybox.git Patch from Rob Landley to fix backrefs --- diff --git a/editors/sed.c b/editors/sed.c index 3d6d72c68..da06bf485 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -570,7 +570,7 @@ static void do_subst_w_backrefs(const char *line, const char *replace) /* go through the replacement string */ for (i = 0; replace[i]; i++) { /* if we find a backreference (\1, \2, etc.) print the backref'ed * text */ - if (replace[i] == '\\' && replace[i+1]>0 && replace[i+1]<=9) { + if (replace[i] == '\\' && replace[i+1]>'0' && replace[i+1]<='9') { int backref=replace[++i]-'0'; /* print out the text held in regmatch[backref] */