comparison sbr/path.c @ 12:441a2190cfae

Lion fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 Apr 2012 13:10:49 +0900
parents bce86c4163a3
children 07f8972434be
comparison
equal deleted inserted replaced
11:5cf052bee63d 12:441a2190cfae
1 /* path.c - return a pathname */ 1 /* path.c - return a pathname */
2 #ifndef lint 2 #ifndef lint
3 static char ident[] = "@(#)$Id$"; 3 static char ident[] = "@(#)$Id: path.c,v 1.1.1.1 2005/04/18 14:46:06 kono Exp $";
4 #endif /* lint */ 4 #endif /* lint */
5 5
6 #include "../h/mh.h" 6 #include "../h/mh.h"
7 #include <stdio.h> 7 #include <stdio.h>
8 8
81 81
82 if (strncmp (name, CWD, NCWD) == 0) 82 if (strncmp (name, CWD, NCWD) == 0)
83 name += NCWD; 83 name += NCWD;
84 84
85 if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) { 85 if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
86 (void) sprintf (buffer, "%.*s", cp - pwds, pwds); 86 (void) sprintf (buffer, "%.*s", (int)(cp - pwds), pwds);
87 return getcpy (buffer); 87 return getcpy (buffer);
88 } 88 }
89 89
90 if (strncmp (name, PWD, NPWD) == 0) 90 if (strncmp (name, PWD, NPWD) == 0)
91 name += NPWD; 91 name += NPWD;
92 else 92 else
93 cp = ep; 93 cp = ep;
94 94
95 (void) sprintf (buffer, "%.*s/%s", cp - pwds, pwds, name); 95 (void) sprintf (buffer, "%.*s/%s", (int)(cp - pwds), pwds, name);
96 return getcpy (buffer); 96 return getcpy (buffer);
97 } 97 }
98 98
99 /* */ 99 /* */
100 100