Lines Matching defs:pathname
28 * print the dirname of a pathname
66 static void l_dirname(register Sfio_t *outfile, register const char *pathname)
70 for(last=pathname; *last; last++);
72 while(last>pathname && *--last=='/');
74 for(;last>pathname && *last!='/';last--);
75 if(last==pathname)
78 if(*pathname!='/')
79 last = pathname = ".";
84 for(;*last=='/' && last > pathname; last--);
87 if(last!=pathname && pathname[0]=='/' && pathname[1]=='/')
89 while(pathname[2]=='/' && pathname<last)
90 pathname++;
91 if(last!=pathname && pathname[0]=='/' && pathname[1]=='/' && *astconf("PATH_LEADING_SLASHES",NiL,NiL)!='1')
92 pathname++;
94 sfwrite(outfile,pathname,last+1-pathname);