]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit.c
refactor skip_prefix to return a boolean
[thirdparty/git.git] / builtin / commit.c
index 5e2221c8e8c842314cb177d55223e87328b3da26..ec753412381f26b29274805d32524515171bb39d 100644 (file)
@@ -1020,7 +1020,7 @@ static int message_is_empty(struct strbuf *sb)
 static int template_untouched(struct strbuf *sb)
 {
        struct strbuf tmpl = STRBUF_INIT;
-       char *start;
+       const char *start;
 
        if (cleanup_mode == CLEANUP_NONE && sb->len)
                return 0;
@@ -1029,8 +1029,7 @@ static int template_untouched(struct strbuf *sb)
                return 0;
 
        stripspace(&tmpl, cleanup_mode == CLEANUP_ALL);
-       start = (char *)skip_prefix(sb->buf, tmpl.buf);
-       if (!start)
+       if (!skip_prefix(sb->buf, tmpl.buf, &start))
                start = sb->buf;
        strbuf_release(&tmpl);
        return rest_is_empty(sb, start - sb->buf);