commit - 1cbc02b603bd240e29f2ca64f4f9672a32c526b2
commit + 197aa481b5566c0549a182decf03e6a756f44041
blob - f5552d9bf05a61506e908f8f664c3d7bc47096f3
blob + d5e33de294798ecea0ba650d0ea1ae10ee4c9b60
--- lib/object.c
+++ lib/object.c
struct got_commit_object *commit = NULL;
struct got_tree_object *tree = NULL;
struct got_tree_entry *entry = NULL;
- char *seg, *s = NULL;
+ char *seg, *s, *s0 = NULL;
*obj = NULL;
if (err)
goto done;
- s = strdup(path);
- if (s == NULL) {
+ s0 = strdup(path);
+ if (s0 == NULL) {
err = got_error_from_errno();
goto done;
}
- err = got_canonpath(path, s, strlen(s) + 1);
+ err = got_canonpath(path, s0, strlen(s0) + 1);
if (err)
goto done;
+ s = s0;
s++; /* skip leading '/' */
seg = s;
while (*s) {
else
err = got_error(GOT_ERR_NO_OBJ);
done:
- free(s);
+ free(s0);
if (commit)
got_object_commit_close(commit);
if (tree)