set -i option without argument wongly handle next option as argument

Issue #254 resolved
Takehiko NOZAKI repo owner created an issue

NG

$ cat aaa >test.txt
$ sed -i -e ‘s/aaa/bbb’ text.txt
bbb
$ ls
test.txt
test.txt-e
$ cat test.txt

OK

$ cat aaa >test.txt
$ sed -i -e ‘s/aaa/bbb’ text.txt
$ ls
test.txt
$ cat test.txt
bbb

there’s getopt(3) compatibility issue, GNU’s getopt can treat tri-state:

  • no_argument … getopt(“i”)
  • require_argument … getopt(“i:”)
  • optional_argumemt … getopt(“i::”)

but our traditional getopt(3) doesn’t support this fearture.

TNF HEAD has this feature, see attached patch.

Comments (5)

  1. Log in to comment