[remote] Allow NULL as remote URL.
authorMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 17 Apr 2009 01:22:45 +0000 (03:22 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 17 Apr 2009 01:22:45 +0000 (03:22 +0200)
Signed-off-by: Matthias Bolte <matthias.bolte@googlemail.com>

remote/remote.c

index 93a2278..4219d5e 100644 (file)
@@ -416,7 +416,6 @@ vsc_remote_init (struct VscError *error, const char *name, const char *version,
 
        VSC__ASSERT (error != NULL);
        VSC__ASSERT (! error->occured);
-       VSC__ASSERT (remote_url != NULL);
        VSC__ASSERT (method_name_lookup_function != NULL);
        VSC__ASSERT (argument_name_lookup_function != NULL);
 
@@ -429,11 +428,15 @@ vsc_remote_init (struct VscError *error, const char *name, const char *version,
        _method_name_lookup_function = method_name_lookup_function;
        _argument_name_lookup_function = argument_name_lookup_function;
 
-       _remote_url = vsc_strdup (error, remote_url);
+       if (remote_url != NULL) {
+               _remote_url = vsc_strdup (error, remote_url);
 
-       if (error->occured) {
-               VSC__APPEND_ERROR0 (error, VSC__ERROR_CODE__TRACE);
-               return;
+               if (error->occured) {
+                       VSC__APPEND_ERROR0 (error, VSC__ERROR_CODE__TRACE);
+                       return;
+               }
+       } else {
+               _remote_url = NULL;
        }
 
        /*