summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-03 22:08:14 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-03 22:08:14 -0500
commit4007253649425ff37a503ea77cff2155ab9814ef (patch)
tree72cd40904068ee552def13ad3e99e59ed35e2748 /main.c
parenta566e529522940f011aa1fa08d44753b6bea9562 (diff)
fixed command line argument with / in it windows
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index 894ed85..e6c7d74 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,5 @@
// @TODO:
-// - ensure buffer->filename never contains / on windows
+// - popup to reload files and config on change
// - split
// - Windows installation
#include "base.h"
@@ -110,12 +110,18 @@ int main(int argc, char **argv) {
switch (argc) {
case 0: case 1: break;
case 2:
+ // essentially, replace / with \ on windows.
+ for (char *p = argv[1]; *p; ++p)
+ if (strchr(ALL_PATH_SEPARATORS, *p))
+ *p = PATH_SEPARATOR;
starting_filename = argv[1];
break;
default:
fprintf(stderr, "Usage: %s [filename]\n", argv[0]);
return EXIT_FAILURE;
}
+
+
SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1"); // if this program is sent a SIGTERM/SIGINT, don't turn it into a quit event
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0)