projects
/
project
/
make_ext4fs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make_ext4fs: explicitly call setlocale() before creating image
[project/make_ext4fs.git]
/
make_ext4fs.c
diff --git
a/make_ext4fs.c
b/make_ext4fs.c
index
cb18161
..
dd4d0d3
100644
(file)
--- a/
make_ext4fs.c
+++ b/
make_ext4fs.c
@@
-33,6
+33,7
@@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <locale.h>
/* TODO: Not implemented:
Allocating blocks in the same block group as the file inode
/* TODO: Not implemented:
Allocating blocks in the same block group as the file inode
@@
-66,6
+67,9
@@
static u32 build_directory_structure(const char *full_path, const char *dir_path
u32 dirs = 0;
bool needs_lost_and_found = false;
u32 dirs = 0;
bool needs_lost_and_found = false;
+ /* alphasort is locale-dependent; let's fix the locale to some sane value */
+ setlocale(LC_COLLATE, "C");
+
if (full_path) {
entries = scandir(full_path, &namelist, filter_dot, (void*)alphasort);
if (entries < 0) {
if (full_path) {
entries = scandir(full_path, &namelist, filter_dot, (void*)alphasort);
if (entries < 0) {