src/fileio.cpp
changeset 10405 fb6f4c4476a6
parent 10385 4f9838649c7f
equal deleted inserted replaced
10404:ea3784c0b3dd 10405:fb6f4c4476a6
   709 
   709 
   710 		if (!FiosIsValidFile(path, dirent, &sb)) continue;
   710 		if (!FiosIsValidFile(path, dirent, &sb)) continue;
   711 
   711 
   712 		snprintf(filename, lengthof(filename), "%s%s", path, d_name);
   712 		snprintf(filename, lengthof(filename), "%s%s", path, d_name);
   713 
   713 
   714 		if (sb.st_mode & S_IFDIR) {
   714 		if (S_ISDIR(sb.st_mode)) {
   715 			/* Directory */
   715 			/* Directory */
   716 			if (strcmp(d_name, ".") == 0 || strcmp(d_name, "..") == 0) continue;
   716 			if (strcmp(d_name, ".") == 0 || strcmp(d_name, "..") == 0) continue;
   717 			AppendPathSeparator(filename, lengthof(filename));
   717 			AppendPathSeparator(filename, lengthof(filename));
   718 			num += ScanPathForTarFiles(filename, basepath_length);
   718 			num += ScanPathForTarFiles(filename, basepath_length);
   719 		} else if (sb.st_mode & S_IFREG) {
   719 		} else if (S_ISREG(sb.st_mode)) {
   720 			/* File */
   720 			/* File */
   721 			char *ext = strrchr(filename, '.');
   721 			char *ext = strrchr(filename, '.');
   722 
   722 
   723 			/* If no extension or extension isn't .tar, skip the file */
   723 			/* If no extension or extension isn't .tar, skip the file */
   724 			if (ext == NULL) continue;
   724 			if (ext == NULL) continue;