aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/jot/jot.112
-rw-r--r--usr.bin/quota/quota.c2
-rw-r--r--usr.bin/top/display.c25
-rw-r--r--usr.bin/top/display.h1
-rw-r--r--usr.bin/top/machine.c4
-rw-r--r--usr.bin/top/top.111
-rw-r--r--usr.bin/top/top.c6
7 files changed, 26 insertions, 35 deletions
diff --git a/usr.bin/jot/jot.1 b/usr.bin/jot/jot.1
index d2e38c79aa45..5ba57d9117ad 100644
--- a/usr.bin/jot/jot.1
+++ b/usr.bin/jot/jot.1
@@ -28,7 +28,7 @@
.\" @(#)jot.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 7, 2015
+.Dd September 21, 2019
.Dt JOT 1
.Os
.Sh NAME
@@ -108,14 +108,16 @@ Any three of these arguments determines the fourth.
If four are specified and the given and computed values of
.Ar reps
conflict, the lower value is used.
-If fewer than three are specified, defaults are assigned
-left to right, except for
+If one or two are specified, defaults are assigned
+starting with
.Ar s ,
-which assumes a default of 1 or -1 if both
+which assumes a default of 1 (or -1 if
.Ar begin
and
.Ar end
-are given.
+specify a descending range).
+Then the default values are assigned to the leftmost omitted arguments until
+three arguments are set.
.Pp
Defaults for the four arguments are, respectively,
100, 1, 100, and 1, except that when random data are requested,
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index f4481fecece6..71e63208884f 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype)
call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS,
RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args,
(xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt);
- if (call_stat == RPC_PROGVERSMISMATCH) {
+ if (call_stat == RPC_PROGVERSMISMATCH || call_stat == RPC_PROGNOTREGISTERED) {
if (quotatype == USRQUOTA) {
old_gq_args.gqa_pathp = cp + 1;
old_gq_args.gqa_uid = id;
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 00534fd7f411..38e6657401d0 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -1291,31 +1291,6 @@ line_update(char *old, char *new, int start, int line)
}
}
-/*
- * printable(str) - make the string pointed to by "str" into one that is
- * printable (i.e.: all ascii), by converting all non-printable
- * characters into '?'. Replacements are done in place and a pointer
- * to the original buffer is returned.
- */
-
-char *
-printable(char str[])
-{
- char *ptr;
- char ch;
-
- ptr = str;
- while ((ch = *ptr) != '\0')
- {
- if (!isprint(ch))
- {
- *ptr = '?';
- }
- ptr++;
- }
- return(str);
-}
-
void
i_uptime(struct timeval *bt, time_t *tod)
{
diff --git a/usr.bin/top/display.h b/usr.bin/top/display.h
index 546f21ce34b0..ff3ea8d3fe9a 100644
--- a/usr.bin/top/display.h
+++ b/usr.bin/top/display.h
@@ -11,7 +11,6 @@ int display_updatecpus(struct statics *statics);
void clear_message(void);
int display_resize(void);
void i_header(const char *text);
-char *printable(char *string);
void display_header(int t);
int display_init(struct statics *statics);
void i_arc(int *stats);
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index dd2b7a110419..edfe3e659f13 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1003,7 +1003,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
len = (argbuflen - (dst - argbuf) - 1) / 4;
strvisx(dst, src,
MIN(strlen(src), len),
- VIS_NL | VIS_CSTYLE);
+ VIS_NL | VIS_CSTYLE | VIS_OCTAL | VIS_SAFE);
while (*dst != '\0')
dst++;
if ((argbuflen - (dst - argbuf) - 1) / 4 > 0)
@@ -1102,7 +1102,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
sbuf_printf(procbuf, "%6s ", format_time(cputime));
sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp));
}
- sbuf_printf(procbuf, "%s", printable(cmdbuf));
+ sbuf_printf(procbuf, "%s", cmdbuf);
free(cmdbuf);
return (sbuf_data(procbuf));
}
diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index a2858003d465..d1b0370eb756 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,5 +1,5 @@
.\" $FreeBSD$
-.Dd October 2, 2018
+.Dd September 21, 2019
.Dt TOP 1
.Os
.Sh NAME
@@ -66,6 +66,9 @@ It it useful when you want to watch applications, that
puts their status information there.
If the real name differs from argv[0],
it will be displayed in parenthesis.
+Non-printable characters in the command line are
+encoded in C-style backslash sequences or
+a three digit octal sequences.
.It Fl b
Use \*(lqbatch\*(rq mode.
In this mode, all input from the terminal is
@@ -422,6 +425,12 @@ bytes paged out to swap devices (last interval)
.It Ev TOP
Default set of arguments to
.Nm .
+.It Ev LC_CTYPE
+The locale to use when displaying the
+.Va argv
+vector when
+.Fl a
+flag is specified.
.El
.Sh SEE ALSO
.Xr kill 1 ,
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 650789689b6b..01cad421b64c 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <getopt.h>
#include <jail.h>
+#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -265,6 +266,11 @@ main(int argc, const char *argv[])
setbuffer(stdout, stdoutbuf, Buffersize);
#endif
+ if (setlocale(LC_ALL, "") == NULL) {
+ fprintf(stderr, "invalid locale.\n");
+ exit(1);
+ }
+
mypid = getpid();
/* get our name */