From e0e1f28b64780c6cd323c2e624387790f09bec7c Mon Sep 17 00:00:00 2001 From: Tomas Kukosa Date: Thu, 30 Nov 2006 07:30:20 +0000 Subject: suffix in file set is optional svn path=/trunk/; revision=20023 --- fileset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fileset.c') diff --git a/fileset.c b/fileset.c index c0c192d65d..08201f7ee3 100644 --- a/fileset.c +++ b/fileset.c @@ -84,8 +84,8 @@ fileset_filename_match_pattern(const char *fname) /* test_00001_20050418010750.cap */ pfx = strrchr(filename, '.'); - if(pfx == NULL) { - return FALSE; + if(pfx == NULL) { /* suffix is optional */ + pfx = filename + strlen(filename); } /* test_00001_20050418010750 */ *pfx = '\0'; @@ -145,6 +145,9 @@ fileset_is_file_in_set(const char *fname1, const char *fname2) pfx1 = strrchr(dup_f1, '.'); pfx2 = strrchr(dup_f2, '.'); + /* suffix is optional */ + if (!pfx1) pfx1 = dup_f1 + strlen(dup_f1); + if (!pfx2) pfx2 = dup_f2 + strlen(dup_f2); /* the optional suffix (file extension) must be equal */ if(strcmp(pfx1, pfx2) != 0) { -- cgit v1.2.3