diff util.c @ 1931:374a5ae694e8 mame_interp

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sat, 18 Apr 2020 11:42:53 -0700
parents a4cae960fd08
children 5a76a7373823
line wrap: on
line diff
--- a/util.c	Thu Apr 18 22:06:47 2019 -0700
+++ b/util.c	Sat Apr 18 11:42:53 2020 -0700
@@ -80,7 +80,7 @@
 	for (char *cur = base; *cur; ++cur)
 	{
 		if (in_var) {
-			if (!(*cur == '_' || isalnum(*cur))) {
+			if (!isalnum(*cur)) {
 				positions[num_vars].end = cur-base;
 				if (positions[num_vars].end - positions[num_vars].start > max_var_len) {
 					max_var_len = positions[num_vars].end - positions[num_vars].start;
@@ -854,6 +854,16 @@
 	qsort(list, num_entries, sizeof(dir_entry), sort_dir_alpha);
 }
 
+uint8_t delete_file(char *path)
+{
+#ifdef _WIN32
+	//TODO: Call Unicode version and prepend special string to remove max path limitation
+	return 0 != DeleteFileA(path);
+#else
+	return 0 == unlink(path);
+#endif
+}
+
 #ifdef __ANDROID__
 
 #include <SDL.h>
@@ -943,7 +953,7 @@
 	fclose(f);
 	return ret;
 }
-#endif
+#endif //ISLIB
 
 #ifdef _WIN32
 char const *get_userdata_dir()
@@ -1000,8 +1010,6 @@
 }
 
 
-#endif
-
+#endif //_WIN32
+#endif //__ANDROID__
 
-
-#endif