2 #include <stdio.h> /* for FILE etc */
3 #include <stdlib.h> /* for malloc */
4 #include <string.h> /* for making ftw.h happy */
6 #include <sys/types.h> /* for stat(2) */
10 #include "pnd_pathiter.h"
11 #include "pnd_locate.h"
13 static char pnd_locate_buffer [ FILENAME_MAX ]; // exceedingly lame
15 char *pnd_locate_filename ( char *searchpath, char *filename ) {
21 strncat ( buffer, "/", FILENAME_MAX );
22 strncat ( buffer, filename, FILENAME_MAX );
24 //printf ( "foo: %s\n", buffer );
26 if ( stat ( buffer, &foo ) == 0 ) {
27 strcpy ( pnd_locate_buffer, buffer );
28 return ( pnd_locate_buffer );