support config files in the current directory
authorAndrew Tridgell <tridge@samba.org>
Wed, 2 Sep 2009 11:51:02 +0000 (21:51 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 3 Sep 2009 08:36:08 +0000 (18:36 +1000)
source4/param/util.c

index 366c3f1d784cfd3926adc7c931ec67dc68b32ca9..d9d4eb5e2b4009345b0f1a5392cffc5bf7e4710a 100644 (file)
@@ -118,9 +118,14 @@ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
        }
        p = strrchr(config_dir, '/');
        if (p == NULL) {
-               return NULL;
+               talloc_free(config_dir);
+               config_dir = talloc_strdup(mem_ctx, ".");
+               if (config_dir == NULL) {
+                       return NULL;
+               }
+       } else {
+               p[0] = '\0';
        }
-       p[0] = '\0';
        fname = talloc_asprintf(mem_ctx, "%s/%s", config_dir, name);
        talloc_free(config_dir);
        return fname;