summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-09 23:12:09 -0500
committerpommicket <pommicket@gmail.com>2023-01-09 23:12:09 -0500
commitedd5188dfba93b8ffe376d0c194804f35f43dcaa (patch)
tree9e1ef13632c9e0fbfd175bc82c79f874b2b15229 /buffer.c
parent7f0255cb40bb85276191ec3ddffe507e53abf2ac (diff)
misc windows fixes
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 607f250..c00d20b 100644
--- a/buffer.c
+++ b/buffer.c
@@ -2326,6 +2326,12 @@ Status buffer_load_file(TextBuffer *buffer, const char *path) {
if (success) {
char *path_copy = buffer_strdup(buffer, path);
if (!path_copy) success = false;
+ #if _WIN32
+ // only use \ as a path separator
+ for (char *p = path_copy; *p; ++p)
+ if (*p == '/')
+ *p = '\\';
+ #endif
if (success) {
// everything is good
buffer_clear(buffer);