* the value.
*/
}
- printf("%s = %s\n", *key, *value);
+ /* printf("%s = %s\n", *key, *value); */
return 0;
}
break;
if (strncasecmp(item->key, key, strlen(item->key)) == 0) {
- printf("calling %p, for key = '%s' and value = '%s'\n", item->callback, key, value);
+ /*
+ * printf("calling %p, for key = '%s' and value = * '%s'\n",
+ * item->callback, key, value);
+ */
result = item->callback(session, value);
if (!result)
return;
if (line[n - 1] == '\n')
line[n - 1] = '\0';
- /* '#' is comment markers, like bash style */
- *strchrnul(line, '#') = '\0';
+ /* '#' is comment markers, like bash style
+ but it is a valid character in some fields, so
+ only treat it as a comment marker if it occurs
+ at the beginning of the line, or after whitespace */
+ char *hashmarker = strchrnul(line, '#');
+ if (line == hashmarker) line[0] = '\0';
+ if (*(--hashmarker) == ' ' || *hashmarker == '\t')
+ *hashmarker = '\0';
c = line;
while (isspace(*c))
c++;