]> diplodocus.org Git - nmh/blobdiff - sbr/path.c
Run lsb_release(1) if uname is Linux.
[nmh] / sbr / path.c
index 7475fa081b01113df129ef65af21979316aa68ab..896c1ad926dcba7a3779b595d82fd73c9a3d4344 100644 (file)
@@ -2,14 +2,13 @@
 /*
  * path.c -- return a pathname
  *
- * $Id$
- *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 
 #define        CWD     "./"
 #define        NCWD    (sizeof(CWD) - 1)
@@ -59,7 +58,7 @@ expath (char *name, int flag)
        snprintf (buffer, sizeof(buffer), "%s/", m_maildir (""));
        if (ssequal (buffer, name)) {
            cp = name;
-           name = getcpy (name + strlen (buffer));
+           name = mh_xstrdup(name + strlen(buffer));
            free (cp);
        }
        flag = TFOLDER;
@@ -90,7 +89,7 @@ expath (char *name, int flag)
        name += NCWD;
 
     if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
-       snprintf (buffer, sizeof(buffer), "%.*s", cp - pwds, pwds);
+       snprintf (buffer, sizeof(buffer), "%.*s", (int)(cp - pwds), pwds);
        return getcpy (buffer);
     }
 
@@ -99,7 +98,7 @@ expath (char *name, int flag)
     else
        cp = ep;
 
-    snprintf (buffer, sizeof(buffer), "%.*s/%s", cp - pwds, pwds, name);
+    snprintf (buffer, sizeof(buffer), "%.*s/%s", (int)(cp - pwds), pwds, name);
     return getcpy (buffer);
 }