gettext: add is_utf8_locale()
[gitweb.git] / builtin / check-ignore.c
index 43f361797ac73b64c79bb163cbb38baf78981fc9..4f0b09e2db5c0e0bc4665b06dc543b7f8ea1d467 100644 (file)
@@ -117,13 +117,14 @@ static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)
 {
        struct strbuf buf, nbuf;
        char *pathspec[2] = { NULL, NULL };
-       int line_termination = nul_term_line ? 0 : '\n';
+       strbuf_getline_fn getline_fn;
        int num_ignored = 0;
 
+       getline_fn = nul_term_line ? strbuf_getline_nul : strbuf_getline_lf;
        strbuf_init(&buf, 0);
        strbuf_init(&nbuf, 0);
-       while (strbuf_getline(&buf, stdin, line_termination) != EOF) {
-               if (line_termination && buf.buf[0] == '"') {
+       while (getline_fn(&buf, stdin) != EOF) {
+               if (!nul_term_line && buf.buf[0] == '"') {
                        strbuf_reset(&nbuf);
                        if (unquote_c_style(&nbuf, buf.buf, NULL))
                                die("line is badly quoted");