Re: Error in posix_spawn(3) man page
Keith Thompson <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CAAHpriMQOt6N7H5tBvZbz-fCWf_sRi_ci-De+zF=Akd4pDS4sw@mail.gmail.com> |
On Fri, Jan 7, 2022 at 4:01 PM Keith Thompson <[email protected]> wrote: > > On Fri, Jan 7, 2022 at 1:32 AM Corinna Vinschen <[email protected]> wrote: > > > > Hi Keith, > > > > On Jan 5 13:39, Keith Thompson wrote: > > > On Wed, Jan 5, 2022 at 3:47 AM Corinna Vinschen <[email protected]> wrote: > > > > > > > > Hi Keith, > > > > > > > > On Dec 28 19:24, Keith Thompson wrote: > > > > > The posix_spawn(3) man page has incorrect types for the argv and > > > > > envp parameters for the posix_spawn and posix_spawnp functions. > > > > > > > > > > They're shown as > > > > > char *const argv, char *const envp > > > > > when they should be > > > > > char *const argv[], char *const envp[] > > > > > > > > > > Suggested patch (though I'm not 100% sure how the square brackets > > > > > are handled when generating the man page): > > > > > > > > Please send a git compatible patch in `git format-patch' format. > > > > > > > > > > > > Thanks, > > > > Corinna > > > > > > As requested. Given the way I copy-and-pasted the patch into my email, > > > it might not have > > > treated tabs correctly. > > > > It's not TABs, it's an incorrect patch format: > > > > $ git am 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch > > Applying: Fix documented argv and envp params for posix_spawn > > error: libc/posix/posix_spawn.c: does not exist in index > > Patch failed at 0001 Fix documented argv and envp params for posix_spawn > > hint: Use 'git am --show-current-patch=diff' to see the failed patch > > [...] > > > > Did you actually create the patch with `git format-patch'? > > > > > > Thanks, > > Corinna > > The problem was that I had diff.noprefix=true in my $HOME/.gitconfig. > It caused `git format-patch` to omit the `a/` and `b/` prefixes, and `git am` > doesn't appear to have any way to consume a patch with those prefixes missing. > > I've attached an updated patch that should apply cleanly. > > (I'd argue that this is a git bug, but of course this isn't the place > to report it.) I submitted a Git bug report. The response: ] The -p<num> flag controls how many segments `git am` or `git apply` ] removes. The default is -p1. `git am -p0` should apply the patch ] correctly. The "-p<n>" option to "git am" is mentioned in the git-am(1) man page, but explained only by reference to git-apply(1), so it's easy to miss (I certainly did). My original patch could have been applied with `git am -p0`. I hope this is useful if you receive any future patches with the same issue.