X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fpath.c;h=7ef83eabd39d1ff8cac24ef7f4089041bac27c3b;hp=df5d963b9e44f8c405aefed5e75c3707390227af;hb=0aef47ae5c03e1d9e3f225efe5ae362e7cf5ee35;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/sbr/path.c b/sbr/path.c index df5d963..7ef83ea 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -3,6 +3,10 @@ * 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 @@ -22,6 +26,11 @@ static char *pwds; static char *expath(char *,int); static void compath(char *); +char * +pluspath(char *name) +{ + return path(name + 1, *name == '+' ? TFOLDER : TSUBCWF); +} char * path(char *name, int flag) @@ -81,7 +90,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); } @@ -90,7 +99,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); }