]> gitweb.ps.run Git - ps-cgit/blobdiff - scan-tree.c
Remove redundant calls to fmt("%s", ...)
[ps-cgit] / scan-tree.c
index 98a99c91d99e94a2fe0407329e4ec91f102417d3..05caba53af0a88e06e1bbc73c1c34294f8a447db 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "cgit.h"
+#include "scan-tree.h"
 #include "configfile.h"
 #include "html.h"
 
@@ -95,9 +96,9 @@ static void add_repo(const char *base, const char *path, repo_config_fn fn)
                return;
 
        if (base == path)
-               rel = xstrdup(fmt("%s", path));
+               rel = xstrdup(path);
        else
-               rel = xstrdup(fmt("%s", path + strlen(base) + 1));
+               rel = xstrdup(path + strlen(base) + 1);
 
        if (!strcmp(rel + strlen(rel) - 5, "/.git"))
                rel[strlen(rel) - 5] = '\0';
@@ -185,7 +186,7 @@ static void scan_path(const char *base, const char *path, repo_config_fn fn)
                add_repo(base, fmt("%s/.git", path), fn);
                goto end;
        }
-       while((ent = readdir(dir)) != NULL) {
+       while ((ent = readdir(dir)) != NULL) {
                if (ent->d_name[0] == '.') {
                        if (ent->d_name[1] == '\0')
                                continue;