summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@gmail.com>2011-06-03 23:44:38 +0200
committerRomain Geissler <romain.geissler@gmail.com>2011-06-04 00:00:28 +0200
commitf2e6b8776e8d9f65b3edf3e3bc1ff22a495170ea (patch)
treeb49f4785c71fd5b877319de1cb0a6721e4860295 /src/fileops.c
parent1549cba9a4f7d9ad79441b748937bbe606ba79c1 (diff)
downloadlibgit2-f2e6b8776e8d9f65b3edf3e3bc1ff22a495170ea.tar.gz
Repository: Added some util functions that we'll need to discover repository path.
retrieve_device returns the file device for a given path (so that we can detect device change while walking through parent directories). abspath returns a canonicalized path, symbolic link free. retrieive_ceiling_directories_offset returns the biggest path offset that path match in the ceiling directory list (so that we can stop at ceiling directories).
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fileops.c b/src/fileops.c
index c407515f1..56bf2927f 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -334,7 +334,7 @@ int gitfo_dirent(
return GIT_SUCCESS;
}
-static void posixify_path(char *path)
+void gitfo_posixify_path(char *path)
{
#if GIT_PLATFORM_PATH_SEP != '/'
while (*path) {
@@ -456,7 +456,7 @@ int gitfo_prettify_dir_path(char *buffer_out, size_t size, const char *path, con
return git__throw(GIT_EOVERFLOW, "Failed to prettify dir path: the base path is too long for the buffer.");
strcpy(buffer_out, base_path);
- posixify_path(buffer_out);
+ gitfo_posixify_path(buffer_out);
git__joinpath(buffer_out, buffer_out, "");
}
@@ -587,7 +587,7 @@ int gitfo_getcwd(char *buffer_out, size_t size)
if (cwd_buffer == NULL)
return git__throw(GIT_EOSERR, "Failed to retrieve current working directory");
- posixify_path(buffer_out);
+ gitfo_posixify_path(buffer_out);
git__joinpath(buffer_out, buffer_out, ""); //Ensure the path ends with a trailing slash