Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Use FIX_UTF8_MAC to enable conversion from UTF8-MAC to UTF8

From: Mark Junker <hidden>
Date: 2016-06-15 22:44:07

Junio C Hamano schrieb:
You memcpy() what the library gave you in *result to the
statically allocated "temp".  d_name[] in "temp" comes from the
structure definition in the user visible include file, which
could be much shorter than what the library gave you in *result.
The structure definition I showed in my message you are
responding to illustrates the issue.  If MacOS uses a similar
trick to define d_name[256] and sometimes returns much longer
name in *result, you are truncating the name by copying only the
first part of the structure and first 256 bytes of d_name[]. 
Now I understand what you mean. Ok, I'll try to change this and make 
this work on other platforms too.

I didn't know that the readdir function is allowed to return something 
longer for d_name than the specified length.

Regards,
Mark
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help