On 2025-03-06 05:31, Eli Zaretskii wrote: >> Date: Tue, 4 Mar 2025 10:37:05 -0800 >> Cc: 76322@debbugs.gnu.org >> From: Paul Eggert >> >> Thanks for the review. Revised patch attached, which I think addresses >> all the comments. > > Thanks. This mostly worked, but I needed a few minor changes (below). > We should use _spawnvp, not _execvp, since the latter doesn't return, > so we cannot return the exit status of etags to the caller. More > importantly, the counting of bytes to allocate missed the PROGRAM part > of --ctags=PROGRAM, so ctags would crash in weird ways. Finally, I > need to include stdio.h to get the declaration of perror. Here's the > patch: Thanks, I incorporated all that into the proposed patch. A couple of things, though. First, when _spawnvp returns -1 I assume ctags should call perror and exit with status 127 rather than simply try to exit with status -1. Second and more important, my earlier proposal violated the GNU Coding Standards because its behavior depended on its name.[1] Fixing the second problem simplified the C and shell code a bit. Revised patch attached. [1]: https://www.gnu.org/prep/standards/html_node/User-Interfaces.html#index-program-name-and-its-behavior