summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2018-05-22 15:21:08 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2018-05-22 15:27:29 +0200
commit02c80ad75d3c3d2246f4f36660281d73648d79aa (patch)
treee40e8faae52cf68882b1c527a9dc97804854e56f /src/path.h
parenta145f2b642e41dec3522dc449a2ef947ccd7a337 (diff)
downloadlibgit2-02c80ad75d3c3d2246f4f36660281d73648d79aa.tar.gz
path: accept the name length as a parameter
We may take in names from the middle of a string so we want the caller to let us know how long the path component is that we should be checking.
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/path.h b/src/path.h
index e0812ec29..698cf4b55 100644
--- a/src/path.h
+++ b/src/path.h
@@ -648,63 +648,72 @@ int git_path_normalize_slashes(git_buf *out, const char *path);
* Check whether a path component corresponds to a .gitmodules file
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_dotgit_modules(const char *name);
+extern int git_path_is_dotgit_modules(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitmodules file in NTFS
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_ntfs_dotgit_modules(const char *name);
+extern int git_path_is_ntfs_dotgit_modules(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitmodules file in HFS+
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_hfs_dotgit_modules(const char *name);
+extern int git_path_is_hfs_dotgit_modules(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitignore file
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_dotgit_ignore(const char *name);
+extern int git_path_is_dotgit_ignore(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitignore file in NTFS
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_ntfs_dotgit_ignore(const char *name);
+extern int git_path_is_ntfs_dotgit_ignore(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitignore file in HFS+
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_hfs_dotgit_ignore(const char *name);
+extern int git_path_is_hfs_dotgit_ignore(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitignore file
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_dotgit_attributes(const char *name);
+extern int git_path_is_dotgit_attributes(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitattributes file in NTFS
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_ntfs_dotgit_attributes(const char *name);
+extern int git_path_is_ntfs_dotgit_attributes(const char *name, size_t len);
/**
* Check whether a path component corresponds to a .gitattributes file in HFS+
*
* @param name the path component to check
+ * @param len the length of `name`
*/
-extern int git_path_is_hfs_dotgit_attributes(const char *name);
+extern int git_path_is_hfs_dotgit_attributes(const char *name, size_t len);
#endif