Merge branch 'mg/patch-id' into maint
[gitweb.git] / color.c
diff --git a/color.c b/color.c
index bcf4e2c192c31136729aabcc2575a94f809d2980..6a5a54ec668e08ddef0d2f27359f3ebb3272243b 100644 (file)
--- a/color.c
+++ b/color.c
@@ -212,30 +212,7 @@ int color_fprintf_ln(FILE *fp, const char *color, const char *fmt, ...)
        return r;
 }
 
-/*
- * This function splits the buffer by newlines and colors the lines individually.
- *
- * Returns 0 on success.
- */
-int color_fwrite_lines(FILE *fp, const char *color,
-               size_t count, const char *buf)
+int color_is_nil(const char *c)
 {
-       if (!*color)
-               return fwrite(buf, count, 1, fp) != 1;
-       while (count) {
-               char *p = memchr(buf, '\n', count);
-               if (p != buf && (fputs(color, fp) < 0 ||
-                               fwrite(buf, p ? p - buf : count, 1, fp) != 1 ||
-                               fputs(GIT_COLOR_RESET, fp) < 0))
-                       return -1;
-               if (!p)
-                       return 0;
-               if (fputc('\n', fp) < 0)
-                       return -1;
-               count -= p + 1 - buf;
-               buf = p + 1;
-       }
-       return 0;
+       return !strcmp(c, "NIL");
 }
-
-