changeset 826:b03d3e3dac2b

Only match -probe if it appears at the end of a filename
author Richard Mortimer
date Tue, 25 Jan 2011 23:45:10 +0000
parents ed44b298ebfc
children 3c4d1e8bc452
files src/mlmmj-maintd.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-maintd.c	Tue Jan 25 19:22:27 2011 +0000
+++ b/src/mlmmj-maintd.c	Tue Jan 25 23:45:10 2011 +0000
@@ -526,7 +526,8 @@
 
 		filename = mystrdup(dp->d_name);
 
-		if((s = strstr(filename, "-probe"))) {
+		s = strrchr(filename, '-');
+		if(s && (strcmp(s, "-probe") == 0)) {
 			if(stat(filename, &st) < 0) {
 				log_error(LOG_ARGS, "Could not stat(%s)",
 					  filename);
@@ -596,7 +597,8 @@
 		   (strcmp(dp->d_name, ".") == 0))
 				continue;
 
-		if(strstr(dp->d_name, "-probe"))
+		s = strrchr(dp->d_name, '-');
+		if(s && (strcmp(s, "-probe") == 0))
 			continue;
 
 		s = strrchr(dp->d_name, '.');
@@ -685,7 +687,8 @@
 		   (strcmp(dp->d_name, ".") == 0))
 				continue;
 
-		if(strstr(dp->d_name, "-probe"))
+		a = strrchr(dp->d_name, '-');
+		if(a && (strcmp(a, "-probe") == 0))
 			continue;
 
 		a = strrchr(dp->d_name, '.');