Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2019 02:46:36 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343338 - head/usr.bin/systat
Message-ID:  <201901230246.x0N2kaCt039179@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Wed Jan 23 02:46:35 2019
New Revision: 343338
URL: https://svnweb.freebsd.org/changeset/base/343338

Log:
  Fix systat's :only command parser for the multiple arguments case
  
  According to systat(1) :only option is supposed to accept multiple drives
  but the parser for its arguments stops after first entry. Fix the parser
  logic to accept multiple drives.
  
  PR:		59220
  Reported by:	Andy Farkas <andyf@speednet.com.au>
  MFC after:	1 week

Modified:
  head/usr.bin/systat/devs.c

Modified: head/usr.bin/systat/devs.c
==============================================================================
--- head/usr.bin/systat/devs.c	Wed Jan 23 02:43:49 2019	(r343337)
+++ head/usr.bin/systat/devs.c	Wed Jan 23 02:46:35 2019	(r343338)
@@ -288,7 +288,7 @@ dsselect(const char *args, devstat_select_mode select_
 			;
 		if (*cp)
 			*cp++ = '\0';
-		if (cp - args == 0)
+		if (cp - tmpstr1 == 0)
 			break;
 		for (i = 0; i < num_devices; i++) {
 			asprintf(&buffer, "%s%d", dev_select[i].device_name,
@@ -312,7 +312,7 @@ dsselect(const char *args, devstat_select_mode select_
 		}
 		if (i >= num_devices)
 			error("%s: unknown drive", args);
-		args = cp;
+		tmpstr1 = cp;
 	}
 	free(tmpstr);
 



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