Patch from Rob Landley to fix backrefs
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 1 Oct 2003 10:26:23 +0000 (10:26 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 1 Oct 2003 10:26:23 +0000 (10:26 -0000)
editors/sed.c

index 3d6d72c6873b783d35713b3947fac7541baefe40..da06bf485f18f378e99d29b86d9ce41869e9180a 100644 (file)
@@ -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] */