{
        char *cp = *cp_p;
        int num = 0;
-       int read_some;
 
        while ('0' <= *cp && *cp <= '9')
                num = num * 10 + *cp++ - '0';
-       if (!(read_some = cp - *cp_p))
+       if (!(cp - *cp_p))
                return -1;
        *cp_p = cp;
        *num_p = num;
 
        line_buffer = xstrndup(line, len); /* make NUL terminated */
 
-       /* Exclude terminating newline (and cr) from matching */
-       if (len > 0 && line[len-1] == '\n') {
-               if (len > 1 && line[len-2] == '\r')
-                       len -= 2;
-               else
-                       len--;
-       }
-
-       line_buffer = xstrndup(line, len); /* make NUL terminated */
-
        for (i = 0; i < regs->nr; i++) {
                struct ff_reg *reg = regs->array + i;
                if (!regexec(®->re, line_buffer, 2, pmatch, 0)) {
        }
        return git_default_config(var, value, cb);
 }
-