Alexandra N. Kossovsky's KOI8-R locale fix #153043
This commit is contained in:
parent
c2af08f5c0
commit
f0b745c222
@ -16,7 +16,7 @@ unsigned print_str(FILE* file, char *s, unsigned max) {
|
||||
fputc(s[i], file);
|
||||
else {
|
||||
if (max - i > 3) {
|
||||
fprintf(file, "\\%03o", s[i]);
|
||||
fprintf(file, "\\%03o", (unsigned char)s[i]);
|
||||
i += 3; /* 4 printed, but i counts one */
|
||||
} else
|
||||
return max - i;
|
||||
@ -36,7 +36,7 @@ unsigned print_strlist(FILE* file, char **strs, char* sep, unsigned max) {
|
||||
fputc(strs[0][i], file);
|
||||
else {
|
||||
if (max-(n+i) > 3) {
|
||||
fprintf(file, "\\%03o", strs[0][i]);
|
||||
fprintf(file, "\\%03o", (unsigned char)strs[0][i]);
|
||||
n += 3; /* 4 printed, but i counts one */
|
||||
} else
|
||||
return max - n;
|
||||
|
3
w.c
3
w.c
@ -23,7 +23,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <utmp.h>
|
||||
/* #include <sys/param.h>*/ /* for HZ */
|
||||
#include <locale.h>
|
||||
|
||||
static int ignoreuser = 0; /* for '-u' */
|
||||
static proc_t **procs; /* our snapshot of the process table */
|
||||
@ -238,6 +238,7 @@ int main(int argc, char **argv) {
|
||||
from = 0;
|
||||
#endif
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
for (args=0; (ch = getopt(argc, argv, "hlusfV")) != EOF; args++)
|
||||
switch (ch) {
|
||||
case 'h': header = 0; break;
|
||||
|
Loading…
Reference in New Issue
Block a user