diff -Naur busybox.orig/include/libbb.h busybox/include/libbb.h
--- busybox.orig/include/libbb.h	2008-07-11 20:23:31 +0000
+++ busybox/include/libbb.h	2008-07-13 15:24:05 +0000
@@ -982,6 +982,18 @@
 int bb_ask_confirmation(void) FAST_FUNC;
 
 extern int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC;
+/*
+ * Uniform config file parser helpers
+ */
+struct _parser {
+	char *data;
+	char *line;
+};
+typedef struct _parser PARSER;
+
+extern char* config_open(const char *filename, PARSER *parser) FAST_FUNC;
+extern char* config_read(PARSER *parser, char comment, const char *delims, int ntokens, char **tokens) FAST_FUNC;
+extern void config_close(PARSER *parser) FAST_FUNC;
 
 /* Concatenate path and filename to new allocated buffer.
  * Add "/" only as needed (no duplicate "//" are produced).
diff -Naur busybox.orig/libbb/Kbuild busybox/libbb/Kbuild
--- busybox.orig/libbb/Kbuild	2008-07-12 21:22:13 +0000
+++ busybox/libbb/Kbuild	2008-07-13 12:38:58 +0000
@@ -63,6 +63,7 @@
 lib-y += mtab_file.o
 lib-y += obscure.o
 lib-y += parse_mode.o
+lib-y += parse_config.o
 lib-y += perror_msg.o
 lib-y += perror_msg_and_die.o
 lib-y += perror_nomsg.o
diff -Naur busybox.orig/libbb/parse_config.c busybox/libbb/parse_config.c
--- busybox.orig/libbb/parse_config.c	1970-01-01 00:00:00 +0000
+++ busybox/libbb/parse_config.c	2008-07-13 15:35:11 +0000
@@ -0,0 +1,116 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * config file parser helper
+ *
+ * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ */
+
+#include "libbb.h"
+
+/*
+
+Typical usage:
+
+----- CUT -----
+	char *t[3];	// tokens placeholder
+	PARSER p;	// parser structure
+	// open file
+	if (config_open(filename, &p)) {
+		// parse line-by-line
+		while (*config_read(&p, comment_char, delimiters, 3, t)) { // 3 tokens at most
+			// use tokens
+			bb_error_msg("TOKENS: [%s][%s][%s]", t[0], t[1], t[2]);
+		}
+		...
+		// free parser
+		config_close(&p);
+	}
+----- CUT -----
+
+*/
+
+char* FAST_FUNC config_open(const char *filename, PARSER *parser)
+{
+	// empty file configures nothing!
+	char *data = xmalloc_open_read_close(filename, NULL);
+	if (!data)
+		return data;
+
+	// convert 0x5c 0x0a (backslashes at the very end of line) to 0x20 0x20 (spaces)
+	for (char *s = data; (s = strchr(s, '\\')) != NULL; ++s)
+		if ('\n' == s[1]) {
+			s[0] = s[1] = ' ';
+		}
+
+	// init parser
+	parser->line = parser->data = data;
+
+	return data;
+}
+
+void FAST_FUNC config_close(PARSER *parser)
+{
+	// for now just free config data
+	free(parser->data);
+}
+
+char* FAST_FUNC config_read(PARSER *parser, char comment, const char *delims, int ntokens, char **tokens)
+{
+	char *ret, *line;
+	int noreduce = (ntokens<0); // do not treat subsequent delimiters as one delimiter
+	if (ntokens < 0)
+		ntokens = -ntokens;
+	ret = line = parser->line;
+	// nullify tokens
+	memset(tokens, 0, sizeof(char *) * ntokens);
+	// now split to lines
+	while (*line) {
+		int token_num = 0;
+		// limit the line
+		char *ptr = strchrnul(line, '\n');
+		*ptr++ = '\0';
+		// comments mean EOLs
+		if (comment)
+			*strchrnul(line, comment) = '\0';
+		// skip leading delimiters
+		while (*line && strchr(delims, *line))
+			line++;
+		// skip empty lines
+		if (*line) {
+			char *s;
+			// now split line to tokens
+			s = line;
+			while (s) {
+				char *p;
+				// get next token
+				if (++token_num >= ntokens)
+					break;
+				p = s;
+				while (*p && !strchr(delims, *p))
+					p++;
+				if (!*p)
+					break;
+				*p++ = '\0';
+				// pin token
+//bb_error_msg("L[%d] T[%s]", token_num, s);
+				if (noreduce || *s)
+					*tokens++ = s;
+				s = p;
+	 		}
+			// non-empty remainder is also a token. So if ntokens == 0, we just return the whole line
+			if (s && (noreduce || *s))
+				*tokens++ = s;
+			// advance data for the next call
+			line = ptr;
+			break;
+		}
+		// line didn't contain any token -> try next line
+		ret = line = ptr;
+ 	}
+	parser->line = line;
+
+	// return current line. caller must check *ret to determine whether to continue
+	return ret;
+}
