index 0ee4c79160758ee629d2b2717b849c8a10c56cb7..7f06f2959133fe46724344184d890a5d52befd9a 100644 (file)
--- a/src/utils_parse_option.c
+++ b/src/utils_parse_option.c
/* Look for the equal sign */
buffer = key;
/* Look for the equal sign */
buffer = key;
- while (isalnum ((int) *buffer) || *buffer == '_')
+ while (isalnum ((int) *buffer) || *buffer == '_' || *buffer == ':')
buffer++;
if ((*buffer != '=') || (buffer == key))
return (1);
buffer++;
if ((*buffer != '=') || (buffer == key))
return (1);
return (0);
} /* int parse_option */
return (0);
} /* int parse_option */
-int escape_string (char *buffer, size_t buffer_size)
-{
- char *temp;
- size_t i;
- size_t j;
-
- /* Check if we need to escape at all first */
- temp = strpbrk (buffer, " \t\"\\");
- if (temp == NULL)
- return (0);
-
- temp = (char *) malloc (buffer_size);
- if (temp == NULL)
- return (-1);
- memset (temp, 0, buffer_size);
-
- temp[0] = '"';
- j = 1;
-
- for (i = 0; i < buffer_size; i++)
- {
- if (buffer[i] == 0)
- {
- break;
- }
- else if ((buffer[i] == '"') || (buffer[i] == '\\'))
- {
- if (j > (buffer_size - 4))
- break;
- temp[j] = '\\';
- temp[j + 1] = buffer[i];
- j += 2;
- }
- else
- {
- if (j > (buffer_size - 3))
- break;
- temp[j] = buffer[i];
- j++;
- }
- }
-
- assert ((j + 1) < buffer_size);
- temp[j] = '"';
- temp[j + 1] = 0;
-
- sstrncpy (buffer, temp, buffer_size);
- sfree (temp);
- return (0);
-} /* int escape_string */
-
/* vim: set sw=2 ts=8 tw=78 et : */
/* vim: set sw=2 ts=8 tw=78 et : */