Browse Source

libobs: Fix module search to ignore . and ..

When globbing for modules, the intent was to ignore the . and ..
directories that might also be included in the glob search.  It was
mistakenly doing a string compare on the 'path' variable which contains
the full path, rather than the 'file' variable which just contains the
found file itself, so the string compare always failed.
jp9000 10 years ago
parent
commit
7bd5147074
1 changed files with 3 additions and 3 deletions
  1. 3 3
      libobs/obs-module.c

+ 3 - 3
libobs/obs-module.c

@@ -258,12 +258,12 @@ static void process_found_module(struct obs_module_path *omp,
 	char                   *parsed_data_dir;
 	bool                   bin_found = true;
 
-	if (strcmp(path, ".") == 0 || strcmp(path, "..") == 0)
-		return;
-
 	file = strrchr(path, '/');
 	file = file ? (file + 1) : path;
 
+	if (strcmp(file, ".") == 0 || strcmp(file, "..") == 0)
+		return;
+
 	dstr_copy(&name, file);
 	if (!directory) {
 		char *ext = strrchr(name.array, '.');