* @param allow_inline set to #GNUNET_YES if we recursively load configuration
* from inlined configurations; #GNUNET_NO if not and raise warnings
* when we come across them
- * @return #GNUNET_OK on success, #GNUNET_ERROR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
char *def;
char *end;
unsigned int lopen;
+ char erased_char;
+ char *erased_pos;
if (NULL == orig)
return NULL;
"Doesn't start with $ - not expanding\n");
return orig;
}
+ erased_char = 0;
+ erased_pos = NULL;
if ('{' == orig[1])
{
start = &orig[2];
break;
}
}
+ erased_char = *end;
+ erased_pos = end;
*end = '\0';
post = end + 1;
def = strchr (orig, ':');
}
else
{
+ erased_char = orig[i];
+ erased_pos = &orig[i];
orig[i] = '\0';
post = &orig[i + 1];
}
}
if (NULL == env)
{
- orig[strlen (orig)] = DIR_SEPARATOR;
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Expanded to `%s' (returning orig)\n",
- orig);
+ start = GNUNET_strdup (start);
+ if (erased_pos)
+ *erased_pos = erased_char;
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ _("Failed to expand `%s' in `%s' as it is neither found in [PATHS] nor defined as an environmental variable\n"),
+ start, orig);
+ GNUNET_free (start);
return orig;
}
prefix = GNUNET_strdup (env);