mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 21:10:38 +02:00
eeshow/git-file.c (canonical_path_into_repo): really catch divergent paths
This commit is contained in:
parent
43542d6504
commit
aeedab62f7
@ -237,15 +237,16 @@ static char *canonical_path_into_repo(const char *repo_dir, const char *path)
|
|||||||
path_st.st_ino == repo_st.st_ino)
|
path_st.st_ino == repo_st.st_ino)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
slash = strrchr(tmp, '/');
|
||||||
|
|
||||||
/* "this cannot happen" */
|
/* "this cannot happen" */
|
||||||
if (tail == tmp) {
|
if (tail == tmp || !slash) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"divergent paths:\nrepo \"%s\"\nobject \"%s\"\n",
|
"divergent paths:\nrepo \"%s\"\nobject \"%s\"\n",
|
||||||
repo_dir, tmp);
|
repo_dir, tail);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
slash = strrchr(tmp, '/');
|
|
||||||
if (tail != end)
|
if (tail != end)
|
||||||
tail[-1] = '/';
|
tail[-1] = '/';
|
||||||
tail = slash + 1;
|
tail = slash + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user