summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2019-12-28 13:49:40 +0200
committerRan Benita <ran@unusedvar.com>2019-12-28 13:49:40 +0200
commitda4a90c13e03d5a8684c66e7e8e69b174af822a0 (patch)
tree3a720ab5b8c6009578d838945ed6fdf50c67d1c3 /src
parentfe417d841e838adfd57f591ea27bd34a999eeb77 (diff)
downloadxorg-lib-libxkbcommon-da4a90c13e03d5a8684c66e7e8e69b174af822a0.tar.gz
Open files in binary mode
This turns off some misfeatures on Windows, and does nothing on POSIX. Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'src')
-rw-r--r--src/compose/parser.c2
-rw-r--r--src/compose/paths.c2
-rw-r--r--src/compose/table.c6
-rw-r--r--src/xkbcomp/include.c2
-rw-r--r--src/xkbcomp/rules.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/compose/parser.c b/src/compose/parser.c
index c1ec0f8..0f85a92 100644
--- a/src/compose/parser.c
+++ b/src/compose/parser.c
@@ -478,7 +478,7 @@ do_include(struct xkb_compose_table *table, struct scanner *s,
return false;
}
- file = fopen(path, "r");
+ file = fopen(path, "rb");
if (!file) {
scanner_err(s, "failed to open included Compose file \"%s\": %s",
path, strerror(errno));
diff --git a/src/compose/paths.c b/src/compose/paths.c
index f2a28b4..f37c759 100644
--- a/src/compose/paths.c
+++ b/src/compose/paths.c
@@ -67,7 +67,7 @@ resolve_name(const char *filename, enum resolve_name_direction direction,
if (ret < 0 || (size_t) ret >= sizeof(path))
return false;
- file = fopen(path, "r");
+ file = fopen(path, "rb");
if (!file)
return false;
diff --git a/src/compose/table.c b/src/compose/table.c
index cba577f..bdfb907 100644
--- a/src/compose/table.c
+++ b/src/compose/table.c
@@ -178,14 +178,14 @@ xkb_compose_table_new_from_locale(struct xkb_context *ctx,
cpath = get_xcomposefile_path();
if (cpath) {
- file = fopen(cpath, "r");
+ file = fopen(cpath, "rb");
if (file)
goto found_path;
}
cpath = path = get_home_xcompose_file_path();
if (path) {
- file = fopen(path, "r");
+ file = fopen(path, "rb");
if (file)
goto found_path;
}
@@ -194,7 +194,7 @@ xkb_compose_table_new_from_locale(struct xkb_context *ctx,
cpath = path = get_locale_compose_file_path(table->locale);
if (path) {
- file = fopen(path, "r");
+ file = fopen(path, "rb");
if (file)
goto found_path;
}
diff --git a/src/xkbcomp/include.c b/src/xkbcomp/include.c
index 56b51cc..8b97558 100644
--- a/src/xkbcomp/include.c
+++ b/src/xkbcomp/include.c
@@ -233,7 +233,7 @@ FindFileInXkbPath(struct xkb_context *ctx, const char *name,
continue;
}
- file = fopen(buf, "r");
+ file = fopen(buf, "rb");
if (file)
break;
}
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c
index 8d5c266..a4cfe49 100644
--- a/src/xkbcomp/rules.c
+++ b/src/xkbcomp/rules.c
@@ -411,7 +411,7 @@ matcher_include(struct matcher *m, struct scanner *parent_scanner,
return;
}
- file = fopen(s.buf, "r");
+ file = fopen(s.buf, "rb");
if (file) {
bool ret = read_rules_file(m->ctx, m, include_depth + 1, file, s.buf);
if (!ret)