Subversion Repositories svn.Prod repos

Compare Revisions

Ignore whitespace Rev 53 → Rev 52

/filefind/C/filefind.c
29,7 → 29,7
 
#include <errno.h>
 
#define PATH_MAX2 255
#define PATH_MAX 255
 
// ============================================================================
// Functions
45,19 → 45,19
 
void traverse(char *directory)
{
char curdir[PATH_MAX2];
char curdir2[PATH_MAX2];
char curdir[PATH_MAX];
char curdir2[PATH_MAX];
 
getcwd(curdir, PATH_MAX2);
getcwd(curdir, PATH_MAX);
chdir(directory);
getcwd(curdir2, PATH_MAX2);
getcwd(curdir2, PATH_MAX);
 
DIR *dir = NULL;
struct dirent entry;
struct dirent *entryPtr = NULL;
int retval = 0;
char pathName[PATH_MAX2 + 1];
char pfile[PATH_MAX2 + 1];
char pathName[PATH_MAX + 1];
char pfile[PATH_MAX + 1];
 
/* Open the given directory, if you can. */
dir = opendir(curdir2);
70,8 → 70,8
{
struct stat entryInfo;
if( ( ! strncmp( entry.d_name, ".", PATH_MAX2 ) == 0 ) &&
( ! strncmp( entry.d_name, "..", PATH_MAX2 ) == 0 ) )
if( ( ! strncmp( entry.d_name, ".", PATH_MAX ) == 0 ) &&
( ! strncmp( entry.d_name, "..", PATH_MAX ) == 0 ) )
{
sprintf(pfile,"%s/%s", curdir2, entry.d_name);
if (isdir(entry.d_name) && ! issymlink(entry.d_name))
/filefind/C/Makefile
1,6 → 1,6
PRG=filefind
SRC=$(PRG).c
DIR=/var/tmp/filefind_testdata
DIR=/var/tmp
.PHONY: clean test cleantest
 
all: test
12,11 → 12,7
clean:
rm -f $(PRG)
 
createtestdata:
mkdir -p $(DIR)
echo "bla" > $(DIR)/testfile
 
test: createtestdata $(PRG)
test: $(PRG)
./$(PRG) $(DIR) > result
sort result > result.sort
find $(DIR) > result2
27,4 → 23,3
cleantest:
rm -f result result.sort
rm -f result2 result2.sort
rm -rf $(DIR)