When "-c" is specified, don't pad the command with spaces if it is

the last field on the line.  "ps -axlc" was needlessly wrapping
around on 80-character windows.
This commit is contained in:
John Polstra 1997-04-16 16:08:11 +00:00
parent eff7ae0f7b
commit 3cc273e0be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24983

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: print.c,v 1.19 1997/02/22 14:05:05 peter Exp $
*/
#ifndef lint
@ -103,7 +103,10 @@ command(k, ve)
v = ve->var;
if (cflag) {
(void)printf("%-*s", v->width, KI_PROC(k)->p_comm);
if (ve->next == NULL) /* last field, don't pad */
(void)printf("%s", KI_PROC(k)->p_comm);
else
(void)printf("%-*s", v->width, KI_PROC(k)->p_comm);
return;
}