Bug with equal in abutting short option

2008-03-08 Thread Wayne Davison
Popt has a bug where a short option with an abutting arg is parsed incorrectly if there is an equal sign in the arg. This can be seen using the test1 executable: % ./test1 -2foo-bar arg1: 0 arg2: foo-bar % ./test1 -2foo=bar test1: bad argument -2foo=bar: invalid numeric value % ./test1 -21=bar

Re: Allow equal after a short option

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 12:02 PM, Wayne Davison wrote: I think it would be nice to allow an equal to separate a short option letter from its abutting argument. e.g. these commands using the test1 executable would all work the same: ./test1 -2 foo ./test1 -2=foo ./test1 -2foo ./test1 --arg2

Re: Allow equal after a short option

2008-03-08 Thread Wayne Davison
On Sat, Mar 08, 2008 at 12:10:52PM -0500, Jeff Johnson wrote: Test test1 -2 foo failed with: arg1: 0 arg2: rest: foo != arg1: 0 arg2: foo I'm not seeing that error with the CVS version. I do note that my prior patch to fix the longArg pointer (e.g. ./test1 -2foo=bar) isn't there, but even

Any interest in eliminating sprintf(), strcpy(), and strcat()?

2008-03-08 Thread Wayne Davison
In rsync I eliminated all use of sprintf(), strcpy(), and strcat(), replacing them with snprintf(), strlcpy(), and strlcat(). Would you be interested in such changes if appropriate compatibility functions were defined? For instance, I could imagine a configure test to see if snprintf() returns a

Re: Any interest in eliminating sprintf(), strcpy(), and strcat()?

2008-03-08 Thread Jeff Johnson
On Mar 8, 2008, at 1:42 PM, Wayne Davison wrote: In rsync I eliminated all use of sprintf(), strcpy(), and strcat(), replacing them with snprintf(), strlcpy(), and strlcat(). Would you be interested in such changes if appropriate compatibility functions were defined? For instance, I could

Re: Allow equal after a short option

2008-03-08 Thread Wayne Davison
On Sat, Mar 08, 2008 at 06:11:09PM -0500, Jeff Johnson wrote: Hmmm, we appear to have different behavior wrto echo. Your patch changes testit.sh to include an explicit --, which (when I last fixed testit.sh like 3 weeks ago) does not appear in the output I am (and was) seeing. I tried it on