keyfile: fix reading intlist-like SSIDs (ie "101") (lp:874328)

Intlists have to end with a ';' since that's how they are written
out, and that's the only way we can actually distinguish between
intlist SSIDs and string SSIDs, really.
This commit is contained in:
Dan Williams 2011-10-14 11:20:22 -05:00
parent 65bcc4719a
commit 965d5860ab

View file

@ -743,13 +743,13 @@ get_uchar_array (GKeyFile *keyfile,
int i;
/* New format: just a string
* Old format: integer list; e.g. 11;25;38
* Old format: integer list; e.g. 11;25;38;
*/
tmp_string = g_key_file_get_string (keyfile, setting_name, key, NULL);
if (tmp_string) {
GRegex *regex;
GMatchInfo *match_info;
const char *pattern = "^[[:space:]]*[[:digit:]]{1,3}[[:space:]]*(;[[:space:]]*[[:digit:]]{1,3}[[:space:]]*)*(;[[:space:]]*)?$";
const char *pattern = "^[[:space:]]*[[:digit:]]{1,3};[[:space:]]*([[:space:]]*[[:digit:]]{1,3};[[:space:]]*)*([[:space:]]*)?$";
regex = g_regex_new (pattern, 0, 0, NULL);
g_regex_match (regex, tmp_string, 0, &match_info);