diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-02 14:04:22 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-02 14:05:03 +0200 |
commit | 2160d037943ef0a3adbf4c6e30a91ee0f205c3f3 (patch) | |
tree | e686d41b19a187e291fd66c658abee116e5a076f | |
parent | 36f8c7639f608313ed4993d55bb03761a9963985 (diff) | |
download | xK-2160d037943ef0a3adbf4c6e30a91ee0f205c3f3.tar.gz xK-2160d037943ef0a3adbf4c6e30a91ee0f205c3f3.tar.xz xK-2160d037943ef0a3adbf4c6e30a91ee0f205c3f3.zip |
xC: slightly clean up character encodings
-rw-r--r-- | xC.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -4234,6 +4234,7 @@ buffer_get_log_path (struct buffer *buffer) (void) mkdir_with_parents (path.str, NULL); str_append_c (&path, '/'); + // FIXME: This mixes up character encodings. make_log_filename (buffer->name, &path); str_append (&path, ".log"); return str_steal (&path); @@ -4255,7 +4256,7 @@ buffer_open_log_file (struct app_context *ctx, struct buffer *buffer) // or an error that includes the below message. char *path = buffer_get_log_path (buffer); if (!(buffer->log_file = fopen (path, "ab"))) - log_global_error (ctx, "Couldn't open log file `#s': #l", + log_global_error (ctx, "Couldn't open log file `#l': #l", path, strerror (errno)); else set_cloexec (fileno (buffer->log_file)); @@ -13085,6 +13086,8 @@ locale_to_utf8 (struct app_context *ctx, const char *locale, const char *p = locale; // Reset the shift state, FWIW + // TODO: Don't use this iconv handle directly at all, elsewhere in xC. + // And ideally use U+FFFD with EILSEQ. (void) iconv (ctx->term_to_utf8, NULL, NULL, NULL, NULL); bool fixed[n_indexes]; @@ -13456,7 +13459,7 @@ static void input_editor_cleanup (struct app_context *ctx) { if (unlink (ctx->editor_filename)) - log_global_error (ctx, "Could not unlink `#s': #l", + log_global_error (ctx, "Could not unlink `#l': #l", ctx->editor_filename, strerror (errno)); cstr_set (&ctx->editor_filename, NULL); |