convert narrow stderr output to wide forms

On some platforms, notably GNU libc, you cannot mix narrow and wide
stdio functions on a stream like stdout or stderr. Doing so will drop
the output of one or the other. This change makes all output to the
stderr stream consistently use the wide forms.

This change also converts some fprintf(stderr,...) calls to debug()
calls where appropriate.

Fixes #3692
This commit is contained in:
Kurtis Rader
2017-01-02 21:11:53 -08:00
parent dddbdddcff
commit b118ed69d3
21 changed files with 165 additions and 182 deletions

View File

@@ -242,7 +242,7 @@ static void maybe_issue_path_warning(const wcstring &which_dir, const wcstring &
debug(0, _(L"The error was '%s'."), strerror(saved_errno));
debug(0, _(L"Please set $%ls to a directory where you have write access."), env_var);
}
putc('\n', stderr);
fputwc(L'\n', stderr);
}
static void path_create(wcstring &path, const wcstring &xdg_var, const wcstring &which_dir,