On Thu, 1 May 2025, Jeremy Drake via Cygwin-patches wrote: > On Thu, 1 May 2025, Jon Turney wrote: > > > Seems like this should also touch: > > > > https://cygwin.com/cygwin-api/func-cygwin-conv-path.html > > > > (source in winsup/doc/path.xml) > > > > > > I'm not sure what the conventional language to use for this common > > behaviour: > > > > "If size is 0, (to is ignored|to can be NULL) and cygwin_conv_path just > > returns the required buffer size in bytes" ? > > > Hmm, did you read the rust backtrace thread? The reviewer there was > concerned that the docs didn't specify that to could be NULL if size was > 0, even though the example on that page does just that. It'd also be nice > to guarantee that to will always be NUL-terminated and never truncated. > > > I'd probably go with 'can be NULL', I don't want somebody to think that > it'd be a better idea to use (void *)8 :P
To clarify, I would do the docs update as a separate patch. This patch doesn't change the conditions on cygwin_conv_path (as evidenced by cygwin_create_path calling with NULL, 0), it just corrects a bug where the condition wasn't followed.