Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Jul 2018 15:34:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229453] ps (process status) charset problem
Message-ID:  <bug-229453-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229453

            Bug ID: 229453
           Summary: ps (process status) charset problem
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: i386
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: vegaio@yandex.ru

If current LOCALE not UTF-8, national encoding in "ps" output broken.

For example, mplayer with cyrillic args (filename in KOI8-R) not present in
"COMMAND" column.

Bug in bin/ps/ps.c:

# diff -u bin/ps/ps.c.orig bin/ps/ps.c=20
--- bin/ps/ps.c.orig    2017-07-21 06:43:20.000000000 +0700
+++ bin/ps/ps.c 2018-07-01 22:05:52.817718000 +0700
@@ -668,7 +668,7 @@
                        fwidthmin =3D (xo_get_style(NULL) !=3D XO_STYLE_TEX=
T ||
                            (STAILQ_NEXT(vent, next_ve) =3D=3D NULL &&
                            (vent->var->flag & LJUST))) ? 0 : vent->var->wi=
dth;
-                       snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%ds}=
",
+                       snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%dhs=
}",
                            vent->var->field ?: vent->var->name,
                            (vent->var->flag & LJUST) ? "-" : "",
                            fwidthmin, fwidthmax);


Function xo_emit requires an argument %s in UTF-8 only encoding. But accept=
ably
replace %s with %hs, in which case pass argument in $LANG encoding.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229453-227>