summaryrefslogtreecommitdiffstats
path: root/src/rccxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rccxml.c')
-rw-r--r--src/rccxml.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rccxml.c b/src/rccxml.c
index f40853f..a64e759 100644
--- a/src/rccxml.c
+++ b/src/rccxml.c
@@ -216,6 +216,11 @@ int rccSave(rcc_context ctx, const char *name) {
int memsize;
xmlChar *mem;
+ if (!ctx) {
+ if (rcc_default_ctx) ctx = rcc_default_ctx;
+ else return -1;
+ }
+
if ((!name)||(!strcmp(name, "rcc"))||(strlen(rcc_home_dir)<3)) name = "default";
size = strlen(rcc_home_dir) + strlen(name) + 32;
@@ -371,6 +376,11 @@ int rccLoad(rcc_context ctx, const char *name) {
xmlDocPtr doc = NULL;
xmlNodePtr node, lnode;
+ if (!ctx) {
+ if (rcc_default_ctx) ctx = rcc_default_ctx;
+ else return -1;
+ }
+
if ((!name)||(!strcmp(name, "rcc"))||(strlen(rcc_home_dir)<3)) name = "default";
size = strlen(rcc_home_dir) + strlen(name) + 32;