teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
This commit is contained in:
parent
334fa9bcb5
commit
16abcd90ae
9 changed files with 71 additions and 27 deletions
|
@ -26,13 +26,16 @@ char *bb_simplify_path(const char *path)
|
|||
if (*p == '/') {
|
||||
if (*s == '/') { /* skip duplicate (or initial) slash */
|
||||
continue;
|
||||
} else if (*s == '.') {
|
||||
if (s[1] == '/' || s[1] == 0) { /* remove extra '.' */
|
||||
}
|
||||
if (*s == '.') {
|
||||
if (s[1] == '/' || !s[1]) { /* remove extra '.' */
|
||||
continue;
|
||||
} else if ((s[1] == '.') && (s[2] == '/' || s[2] == 0)) {
|
||||
}
|
||||
if ((s[1] == '.') && (s[2] == '/' || !s[2])) {
|
||||
++s;
|
||||
if (p > start) {
|
||||
while (*--p != '/'); /* omit previous dir */
|
||||
while (*--p != '/') /* omit previous dir */
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue