On 4/23/2025 3:59 AM, Christian Franke via Cygwin wrote:
Mark Geisert via Cygwin wrote:
Drat, typo alert:
It looks to me like that 'if' statement should read
if (mbstowcs (*wcs_path, *mbs_path, len) ...
if (mbstowcs (*wcspath, mbs_path, len) ...
Use 'len + 1', otherwise the result would possibly be not null terminated.
POSIX says: "The array shall not be zero-terminated if the value
returned is /n/.".
Linux mbstowcs(3) says: "... the programmer should make sure dsize is
greater than or equal to mbstowcs(NULL,src,0)+1."
Example:
[...]
Thank you for the demonstration code. I was actually asking about
something more subtle in the cygstart code but muffed that with typos;
you've answered that question as well :).
A new version 1.4.17-4 of the cygutils packages with a corrected
'cygstart' is now making its way to the mirrors.
Thanks all,
..mark
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple