Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f2068951
Commit
f2068951
authored
Jan 29, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: fix deep path lookup
This commit fixes a major regression in directory_lookup_directory(), which broke the deep lookup of directories.
parent
ee9c460f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
directory.c
src/directory.c
+14
-16
No files found.
src/directory.c
View file @
f2068951
...
...
@@ -149,34 +149,32 @@ directory_prune_empty(struct directory *directory)
struct
directory
*
directory_lookup_directory
(
struct
directory
*
directory
,
const
char
*
uri
)
{
struct
directory
*
cur
=
directory
;
struct
directory
*
found
=
NULL
;
char
*
duplicated
;
char
*
locate
;
assert
(
uri
!=
NULL
);
if
(
isRootDirectory
(
uri
))
return
directory
;
duplicated
=
g_strdup
(
uri
);
locate
=
strchr
(
duplicated
,
'/'
);
char
*
duplicated
=
g_strdup
(
uri
),
*
name
=
duplicated
;
while
(
1
)
{
if
(
locate
)
*
locate
=
'\0'
;
if
(
!
(
found
=
directory_get_child
(
cur
,
duplicated
)))
char
*
slash
=
strchr
(
name
,
'/'
);
if
(
slash
==
name
)
{
directory
=
NULL
;
break
;
assert
(
cur
==
found
->
parent
);
cur
=
found
;
if
(
!
locate
)
}
if
(
slash
!=
NULL
)
*
slash
=
'\0'
;
directory
=
directory_get_child
(
directory
,
name
);
if
(
directory
==
NULL
||
slash
==
NULL
)
break
;
*
locate
=
'/'
;
locate
=
strchr
(
locate
+
1
,
'/'
)
;
name
=
slash
+
1
;
}
g_free
(
duplicated
);
return
found
;
return
directory
;
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment