src/common/sysdefs.h
src/common/tuklib_common.h
src/common/tuklib_config.h
+ src/common/tuklib_mbstr_nonprint.c
+ src/common/tuklib_mbstr_nonprint.h
src/common/tuklib_exit.c
src/common/tuklib_exit.h
src/common/tuklib_gettext.h
endif()
tuklib_progname("${XZDEC}")
+ tuklib_mbstr("${XZDEC}")
install(TARGETS "${XZDEC}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
xzdec_SOURCES = \
xzdec.c \
../common/tuklib_progname.c \
+ ../common/tuklib_mbstr_nonprint.c \
../common/tuklib_exit.c
if COND_W32
lzmadec_SOURCES = \
xzdec.c \
../common/tuklib_progname.c \
+ ../common/tuklib_mbstr_nonprint.c \
../common/tuklib_exit.c
if COND_W32
#include "getopt.h"
#include "tuklib_gettext.h"
#include "tuklib_progname.h"
+#include "tuklib_mbstr_nonprint.h"
#include "tuklib_exit.h"
#ifdef TUKLIB_DOSLIKE
// an error occurred. ferror() doesn't
// touch errno.
my_errorf("%s: Error reading input file: %s",
- filename, strerror(errno));
+ tuklib_mask_nonprint(filename),
+ strerror(errno));
exit(EXIT_FAILURE);
}
break;
}
- my_errorf("%s: %s", filename, msg);
+ my_errorf("%s: %s", tuklib_mask_nonprint(filename),
+ msg);
exit(EXIT_FAILURE);
}
}
// We need to set the locale even though we don't have any
// translated messages:
//
+ // - tuklib_mask_nonprint() has locale-specific behavior (LC_CTYPE).
+ //
// - This is needed on Windows to make non-ASCII filenames display
// properly when the active code page has been set to UTF-8
// in the application manifest. Use the helper macro from
src_name = argv[optind];
src_file = fopen(src_name, "rb");
if (src_file == NULL) {
- my_errorf("%s: %s", src_name,
- strerror(errno));
+ my_errorf("%s: %s",
+ tuklib_mask_nonprint(
+ src_name),
+ strerror(errno));
exit(EXIT_FAILURE);
}
}