Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2019 16:52:55 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r351872 - stable/12/usr.bin/jot
Message-ID:  <201909051652.x85GqtKV093183@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Sep  5 16:52:55 2019
New Revision: 351872
URL: https://svnweb.freebsd.org/changeset/base/351872

Log:
  MFC r346255:
  
    Fix 'jot -r 0 start end' to work.
  
  Relnotes:	yes

Modified:
  stable/12/usr.bin/jot/jot.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/jot/jot.c
==============================================================================
--- stable/12/usr.bin/jot/jot.c	Thu Sep  5 16:48:43 2019	(r351871)
+++ stable/12/usr.bin/jot/jot.c	Thu Sep  5 16:52:55 2019	(r351872)
@@ -263,12 +263,15 @@ main(int argc, char **argv)
 			mask = 0;
 			break;
 		case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER:
-			if (reps == 0)
-				errx(1, "infinite sequences cannot be bounded");
-			else if (reps == 1)
-				s = 0.0;
-			else
-				s = (ender - begin) / (reps - 1);
+			if (!randomize) {
+				if (reps == 0)
+					errx(1, "infinite sequences cannot "
+					    "be bounded");
+				else if (reps == 1)
+					s = 0.0;
+				else
+					s = (ender - begin) / (reps - 1);
+			}
 			mask = 0;
 			break;
 		case HAVE_REPS | HAVE_BEGIN | HAVE_ENDER | HAVE_STEP:



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