whitespace cleanup

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko
2010-10-29 11:46:52 +02:00
parent 66cb7bed33
commit fb132e4737
69 changed files with 231 additions and 268 deletions

View File

@@ -15,17 +15,17 @@ char* FAST_FUNC bb_simplify_abs_path_inplace(char *start)
p = s = start;
do {
if (*p == '/') {
if (*s == '/') { /* skip duplicate (or initial) slash */
if (*s == '/') { /* skip duplicate (or initial) slash */
continue;
}
if (*s == '.') {
if (s[1] == '/' || !s[1]) { /* remove extra '.' */
if (s[1] == '/' || !s[1]) { /* remove extra '.' */
continue;
}
if ((s[1] == '.') && (s[2] == '/' || !s[2])) {
++s;
if (p > start) {
while (*--p != '/') /* omit previous dir */
while (*--p != '/') /* omit previous dir */
continue;
}
continue;
@@ -35,8 +35,8 @@ char* FAST_FUNC bb_simplify_abs_path_inplace(char *start)
*++p = *s;
} while (*++s);
if ((p == start) || (*p != '/')) { /* not a trailing slash */
++p; /* so keep last character */
if ((p == start) || (*p != '/')) { /* not a trailing slash */
++p; /* so keep last character */
}
*p = '\0';
return p;