C: views: now correctly parses view names containing '.' when cleaning

unfinished views. Closes #115
This commit is contained in:
mercierc
2021-09-08 10:52:42 +12:00
parent 34de90bce6
commit 58b42cd977

View File

@ -2910,7 +2910,7 @@ int obi_clean_unfinished_views(OBIDMS_p dms)
if ((dp->d_name)[0] == '.') if ((dp->d_name)[0] == '.')
continue; continue;
i=0; i=0;
while ((dp->d_name)[i] != '.') while (strncmp((dp->d_name)+i, ".obiview", 8))
i++; i++;
relative_path = (char*) malloc(strlen(VIEW_DIR_NAME) + strlen(dp->d_name) + 2); relative_path = (char*) malloc(strlen(VIEW_DIR_NAME) + strlen(dp->d_name) + 2);
strcpy(relative_path, VIEW_DIR_NAME); strcpy(relative_path, VIEW_DIR_NAME);