]> diplodocus.org Git - nmh/blobdiff - sbr/path.c
sbr/vector.c: Only allocate bvector storage for set bits.
[nmh] / sbr / path.c
index 8f6bd55f617e4929e7aa51b33c0d1e8fa486a745..7621aa52990fffc62adeed6116be441aafdee25b 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * path.c -- return a pathname
+/* path.c -- return a pathname
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -64,10 +62,10 @@ expath (char *name, int flag)
 
     if (*name == '/'
            || (flag == TFOLDER
-               && (!HasPrefix(name, CWD)
+               && (!has_prefix(name, CWD)
                    && strcmp (name, DOT)
                    && strcmp (name, DOTDOT)
-                   && !HasPrefix(name, PWD))))
+                   && !has_prefix(name, PWD))))
        return mh_xstrdup(name);
 
     if (pwds == NULL)
@@ -83,7 +81,7 @@ expath (char *name, int flag)
        if (cp == pwds)
            cp++;
 
-    if (HasPrefix(name, CWD))
+    if (has_prefix(name, CWD))
        name += LEN(CWD);
 
     if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
@@ -91,7 +89,7 @@ expath (char *name, int flag)
        return mh_xstrdup(buffer);
     }
 
-    if (HasPrefix(name, PWD))
+    if (has_prefix(name, PWD))
        name += LEN(PWD);
     else
        cp = ep;
@@ -139,7 +137,7 @@ compath (char *f)
                        *cp = '\0';
                        break;
                    }
-                   if (HasPrefix(cp, PWD)) {
+                   if (has_prefix(cp, PWD)) {
                        for (dp = cp - 2; dp > f; dp--)
                            if (*dp == '/')
                                break;
@@ -149,7 +147,7 @@ compath (char *f)
                        cp = dp;
                        continue;
                    }
-                   if (HasPrefix(cp, CWD)) {
+                   if (has_prefix(cp, CWD)) {
                        strcpy (cp - 1, cp + LEN(CWD) - 1);
                        cp--;
                        continue;