:1#include "V.h"
/*	dirnam filename...
*
* Deliver the directory portion of a list of filenames.  This  is  the
* same  as  the  Unix  "dirname"  command,  but  that  isn't available
* everywhere, and I didn't have the source, so I wrote it myself.
*/
main(ac,av)
	char**av;
{	int   a;
	char *p; 	/* Points at some char in filename */
	char *q;	/* Points at first byte or last '/' */

	for (a=1; a<ac; a++) {
		for (p=q=av[a]; *p; p++)
			if (*p == '/')
				q = p;
		if (q == av[a]) {		/* No directory name found */
			if (q[0] != '/')	/* Absolute path or relative? */
				q[0]  = '.';	/* If relative, return "." */
			q[1] = 0;
		} else
			q[0] = 0;
		puts(av[a]);
	}
	exit(0);
}
