summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/strutils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/strutils.c b/lib/strutils.c
index cc90e043d..ebfc5110b 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -859,6 +859,18 @@ const char *split(const char **state, size_t *l, const char *separator, int quot
return current;
}
+/* Rewind file pointer forward to new line. */
+int skip_fline(FILE *fp)
+{
+ char ch;
+
+ do {
+ if ((ch = fgetc(fp)) == EOF)
+ return 1;
+ if (ch == '\n')
+ return 0;
+ } while (1);
+}
#ifdef TEST_PROGRAM