author | Johannes Schindelin <johannes.schindelin@gmx.de> | |
Thu, 19 Feb 2009 19:10:49 +0000 (20:10 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 20 Feb 2009 06:45:48 +0000 (22:45 -0800) | ||
commit | 4fcc86b07db26da17f17af0fd777cab78fcaaf4c | |
tree | 078378b5ea1dcae57f9a2602c71370cb1a962c74 | tree | snapshot |
parent | 25487f8e2ae266936df0f807ae79dca41606e404 | commit | diff |
Introduce the function strip_path_suffix()
The function strip_path_suffix() will try to strip a given suffix from
a given path. The suffix must start at a directory boundary (i.e. "core"
is not a path suffix of "libexec/git-core", but "git-core" is).
Arbitrary runs of directory separators ("slashes") are assumed identical.
Example:
strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
"libexec///git-core", &prefix)
will set prefix to "C:\\msysgit" and return 0.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The function strip_path_suffix() will try to strip a given suffix from
a given path. The suffix must start at a directory boundary (i.e. "core"
is not a path suffix of "libexec/git-core", but "git-core" is).
Arbitrary runs of directory separators ("slashes") are assumed identical.
Example:
strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
"libexec///git-core", &prefix)
will set prefix to "C:\\msysgit" and return 0.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | diff | blob | history | |
path.c | diff | blob | history | |
t/t0060-path-utils.sh | diff | blob | history | |
test-path-utils.c | diff | blob | history |