summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
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);