https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254091

--- Comment #8 from Ed Maste <[email protected]> ---
As far as I can tell there is no compatible way to specify no backup extension
(between GNU and current FreeBSD sed), but we could have FreeBSD sed handle
both -i and -i '' (assuming that there's no legitimate other interpretation of
-i '').

Maybe we can do this in a couple of steps, starting with a warning on '-i
.bak'?

something like:

                case 'i':
                        if (optarg) {
                                inplace = optarg;
                        } else {
                                if (optind >= argc)
                                        errx(1, "no arg for -i");
                                if (*argv[optind] == '\0') {
                                        inplace = "";
                                } else {
                                        inplace = argv[optind];
                                        warnx("-i %s deprecated, use -i%s",
inplace, inplace);
                                }
                                optind++;
                        }
                }

and then later:

                case 'i':
                        if (optarg) {
                                inplace = optarg;
                        } else {
                                inplace = "";
                                // Backwards compat for historical -i ''
                                if (optind < argc && *argv[optind] == '\0')
                                        optind++;
                        }
                        break;

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to