lineedit: fix completion with applet names. closes 9361
[oweals/busybox.git] / libbb / simplify_path.c
index f80e3e8a5eef53ddeba2cd365bbd39506cfea8f9..89dc5bdf21c2c3e19295327ec03605456ab3a3fd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2001  Manuel Novoa III  <mjn3@codepoet.org>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 #include "libbb.h"
 
@@ -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;