Code

data: Let sdb_data_parse() support inline casts from string to other types.
[sysdb.git] / src / core / data.c
index 4e52133484b8e219cdef562a86a7a9991bc2279e..a796b21eef37a57c4cc422836f5386f5c11c14ba 100644 (file)
@@ -600,11 +600,11 @@ sdb_data_parse(char *str, int type, sdb_data_t *data)
                        tmp.data.re.raw = strdup(str);
                        if (! tmp.data.re.raw)
                                return -1;
-                       if (regcomp(&tmp.data.re.regex, str,
+                       if (regcomp(&tmp.data.re.regex, tmp.data.re.raw,
                                                REG_EXTENDED | REG_ICASE | REG_NOSUB)) {
                                free(tmp.data.re.raw);
                                sdb_log(SDB_LOG_ERR, "core: Failed to compile regular "
-                                               "expression '%s'", str);
+                                               "expression '%s'", tmp.data.re.raw);
                                return -1;
                        }
                        if (! data) {