Subject: Re: misc/23763
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: ishit <ishit@oak.dti.ne.jp>
List: netbsd-bugs
Date: 02/02/2005 20:40:02
The following reply was made to PR misc/23763; it has been noted by GNATS.
From: ishit <ishit@oak.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: misc/23763
Date: Thu, 03 Feb 2005 05:39:36 +0900
> jot(1) man page EXAMPLES said,
>
>
> The command:
> jot 0 9 - -.5
> prints the stuttering sequence 9, 9, 8, 8, 7, etc.
>
>
> but my NetBSD Box jot run
>
>
> % jot 0 9 - -.5 | head -10
> 9
> 8
> 8
> 8
> 7
> 6
> 6
> 6
> 5
> 4
> %
if jot(1) man page is true, this is jot.c patch.
This patch written by Mr.Hiroki SATO.(at netbsd@re.soum.co.jp ML.)
I can not rewrite this patch and follow /usr/share/misc/style advice,
Because I can not understand C language. I am Sorry.
--
Subject: Re: [netbsd,08882] jot(1) の man について
From: Hiroki Sato <hrs@xxx.xxx.xx.jp>
To: netbsd@re.soum.co.jp, ishit@oak.dti.ne.jp
Date: Mon, 13 Sep 2004 06:53:48 +0900 (JST)
<snip>
Index: jot.c
===================================================================
RCS file: /cvsroot/src/usr.bin/jot/jot.c,v
retrieving revision 1.11
diff -d -u -I\$FreeBSD:.*\$ -I\$NetBSD:.*\$ -I\$OpenBSD:.*\$ -I\$DragonFly:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.11 jot.c
--- jot.c 5 Jan 2004 23:23:34 -0000 1.11
+++ jot.c 12 Sep 2004 21:53:31 -0000
@@ -63,6 +63,7 @@
#define STEP_DEF 1
#define is_default(s) (strcmp((s), "-") == 0)
+#define _round(x) (((x) < 0) ? (((x) - (double)(long)(x) > -0.5) ? (double)(long)(x) : (double)(long)(x) - 1) : (((x) - (double)(long)(x) < 0.5) ? (double)(long)(x) : (double)(long)(x) + 1))
double begin;
double ender;
@@ -317,7 +318,9 @@
printf("%s", format);
else if (dox) /* scalar */
printf(format, *dp);
- else /* real */
+ else if (prec == 0) /* integer */
+ printf(format, _round(x));
+ else /* real */
printf(format, x);
if (notlast != 0)
fputs(sepstring, stdout);
<snip>