Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh PR bin/38004
details: https://anonhg.NetBSD.org/src/rev/03c249c0c5a6
branches: trunk
changeset: 993304:03c249c0c5a6
user: kre <kre%NetBSD.org@localhost>
date: Tue Sep 04 01:09:28 2018 +0000
description:
PR bin/38004
Save more characters of command in non-interactive jobs, in case of
core dumps and similar (16 effective chars was a few too little).
Arrange for number to increase if command buffer size increases.
diffstat:
bin/sh/jobs.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r 7965cd3d52da -r 03c249c0c5a6 bin/sh/jobs.c
--- a/bin/sh/jobs.c Tue Sep 04 00:01:41 2018 +0000
+++ b/bin/sh/jobs.c Tue Sep 04 01:09:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: jobs.c,v 1.98 2017/12/30 23:24:19 kre Exp $ */
+/* $NetBSD: jobs.c,v 1.99 2018/09/04 01:09:28 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: jobs.c,v 1.98 2017/12/30 23:24:19 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.99 2018/09/04 01:09:28 kre Exp $");
#endif
#endif /* not lint */
@@ -1509,8 +1509,12 @@
int len;
cmdnextc = ps->cmd;
- if (iflag || mflag || sizeof ps->cmd < 100)
+ if (iflag || mflag || sizeof(ps->cmd) <= 60)
len = sizeof(ps->cmd);
+ else if (sizeof ps->cmd <= 400)
+ len = 50;
+ else if (sizeof ps->cmd <= 800)
+ len = 80;
else
len = sizeof(ps->cmd) / 10;
cmdnleft = len;
@@ -1525,7 +1529,7 @@
*cmdnextc = '\0';
VTRACE(DBG_JOBS,
- ("commandtext: ps->cmd %x, end %x, left %d\n\t\"%s\"\n",
+ ("commandtext: ps->cmd %p, end %p, left %d\n\t\"%s\"\n",
ps->cmd, cmdnextc, cmdnleft, ps->cmd));
}
Home |
Main Index |
Thread Index |
Old Index