Date: Fri, 4 Jan 2013 22:30:01 GMT From: "J.R. Oldroyd" <fbsd@opal.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/166364: [patch] make ps(1) display 8-bit characters as such Message-ID: <201301042230.r04MU18l078834@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/166364; it has been noted by GNATS. From: "J.R. Oldroyd" <fbsd@opal.com> To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/166364: [patch] make ps(1) display 8-bit characters as such Date: Fri, 4 Jan 2013 17:08:11 -0500 --MP_/SrLCoOr8Z25xe/DdN6rIFAm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline A minor update is needed for this patch for it to apply cleanly to the ps(1) source that's on FreeBSD-9.1. --MP_/SrLCoOr8Z25xe/DdN6rIFAm Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=ps-9.1.diff --- fmt.c.orig 2013-01-02 19:27:13.000000000 -0500 +++ fmt.c 2013-01-04 17:02:11.000000000 -0500 @@ -47,7 +47,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <vis.h> #include "ps.h" @@ -82,8 +81,7 @@ if (*src == '\0') continue; len = (buf_size - 1 - (dst - buf)) / 4; - strvisx(dst, src, strlen(src) < len ? strlen(src) : len, - VIS_NL | VIS_CSTYLE); + strcpy(dst, src); while (*dst != '\0') dst++; if ((buf_size - 1 - (dst - buf)) / 4 > 0) --- print.c.orig 2013-01-02 19:27:13.000000000 -0500 +++ print.c 2013-01-04 17:03:01.000000000 -0500 @@ -60,7 +60,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <vis.h> #include "ps.h" @@ -105,7 +104,7 @@ v = ve->var; if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); - strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); + strcpy(vis_args, k->ki_args); if (STAILQ_NEXT(ve, next_ve) != NULL && strlen(vis_args) > ARGUMENTS_WIDTH) vis_args[ARGUMENTS_WIDTH] = '\0'; @@ -135,7 +134,7 @@ } if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); - strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); + strcpy(vis_args, k->ki_args); if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field */ @@ -144,8 +143,7 @@ if ((vis_env = malloc(strlen(k->ki_env) * 4 + 1)) == NULL) errx(1, "malloc failed"); - strvis(vis_env, k->ki_env, - VIS_TAB | VIS_NL | VIS_NOSLASH); + strcpy(vis_env, k->ki_env); } else vis_env = NULL; --MP_/SrLCoOr8Z25xe/DdN6rIFAm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301042230.r04MU18l078834>