user-manual: minor editing for conciseness
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index e9d3f5aab63225df7f1b495a19740408d23973a8..2b8e8c0e5e1e957615e986efaab289d77c8fc51c 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -103,7 +103,7 @@ void verify_non_filename(const char *prefix, const char *arg)
        if (!lstat(name, &st))
                die("ambiguous argument '%s': both revision and filename\n"
                    "Use '--' to separate filenames from revisions", arg);
-       if (errno != ENOENT)
+       if (errno != ENOENT && errno != ENOTDIR)
                die("'%s': %s", arg, strerror(errno));
 }
 
@@ -216,7 +216,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
                die("Not a git repository: '%s'", gitdirenv);
        }
 
-       if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/')
+       if (!getcwd(cwd, sizeof(cwd)-1) || cwd[0] != '/')
                die("Unable to read current working directory");
 
        offset = len = strlen(cwd);
@@ -251,7 +251,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
        offset++;
        cwd[len++] = '/';
        cwd[len] = 0;
-       inside_git_dir = !strncmp(cwd + offset, ".git/", 5);
+       inside_git_dir = !prefixcmp(cwd + offset, ".git/");
        return cwd + offset;
 }