Commit c778481e authored by Christian Hergert's avatar Christian Hergert

parser: treat "" as NULL to simplify C code

I'd rather use simply NULL checks than *str checks.
parent 429177ac
......@@ -122,10 +122,10 @@ girst_parser_context_intern_string (GirstParserContext *self,
{
g_return_val_if_fail (self != NULL, NULL);
if (string == NULL)
/* treat empty as null to simplify code */
if (string == NULL || *string == '\0')
return NULL;
else
return g_string_chunk_insert_const (self->strings, string);
return g_string_chunk_insert_const (self->strings, string);
}
/**
......
......@@ -983,10 +983,10 @@ const gchar *
{
g_return_val_if_fail (self != NULL, NULL);
if (string == NULL)
/* treat empty as null to simplify code */
if (string == NULL || *string == '\\0')
return NULL;
else
return g_string_chunk_insert_const (self->strings, string);
return g_string_chunk_insert_const (self->strings, string);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment