jot: allow %F conversion?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

jot: allow %F conversion?

Theo Buehler-3
I see no reason to disallow %F:

$ jot -w '%F' 11 0 1
jot: illegal or unsupported format '%F'

while 'jot -w '%f' 11 0 1' works just fine. Granted, jot isn't going to
print inf or nan, so there is no visible difference between '%f' and
'%F', but the above command seems perfectly legitimate to me.

Note however that FreeBSD and NetBSD don't allow %F either.

Index: jot.c
===================================================================
RCS file: /var/cvs/src/usr.bin/jot/jot.c,v
retrieving revision 1.43
diff -u -p -r1.43 jot.c
--- jot.c 12 Jan 2018 06:22:31 -0000 1.43
+++ jot.c 13 Jan 2018 07:53:40 -0000
@@ -427,6 +427,7 @@ getformat(void)
  case 'e':
  case 'E':
  case 'f':
+ case 'F':
  case 'g':
  case 'G':
  if (longdata)

Reply | Threaded
Open this post in threaded view
|

Re: jot: allow %F conversion?

Todd C. Miller-2
On Sat, 13 Jan 2018 09:28:42 +0100, Theo Buehler wrote:

> while 'jot -w '%f' 11 0 1' works just fine. Granted, jot isn't going to
> print inf or nan, so there is no visible difference between '%f' and
> '%F', but the above command seems perfectly legitimate to me.

I see no reason to disallow this either, it may simply be an oversight.
OK millert@

 - todd