+ if (!line || !*line)
+ return 1;
+ len = strlen(line);
+
+ while (len && isspace(line[len - 1])) {
+ line[len - 1] = '\0';
+ len--;
+ }
+ if (!len)
+ return 1;
+ line += strspn(line, delim); /* skip initial whitespace */
+ if (!*line)
+ return 1;
+ /* OK, we have a non-empty line */
+ if (*line == '#')
+ return 1;
+ cmd = adu_strdup(line);
+ args = cmd + strcspn(cmd, delim);
+ if (!*args)
+ args = NULL;
+ else {
+ *args = '\0';
+ args++;
+ /* let p point to the next non-whitespace char */
+ args += strspn(args, delim);
+ if (!*args)
+ args = NULL;
+ }
+ DEBUG_LOG("name: %s, args: %s.\n", cmd, args);