Am 18.09.2012 17:31, schrieb Mark Cave-Ayland:
Replace any non-ASCII characters with a ? to prevent display errors when converting from Unicode filenames.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
openbios-devel/fs/hfsplus/hfsp_unicode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/openbios-devel/fs/hfsplus/hfsp_unicode.c b/openbios-devel/fs/hfsplus/hfsp_unicode.c index a798085..22da3fa 100644 --- a/openbios-devel/fs/hfsplus/hfsp_unicode.c +++ b/openbios-devel/fs/hfsplus/hfsp_unicode.c @@ -43,7 +43,10 @@ uni2asc( char *astr, const unsigned char *ustr, int ustrlen, int maxlen ) /* might be unrepresentable (or too complicated for us) */ if( ustr[0] || !ustr[1] ) continue;
*astr++ = ustr[1];
if( ustr[1] < 0x20 || ustr[1] > 0x80 )
ASCII didn't have the upper bit, so >= 0x80 would be more correct. Does this correspond to any "upstream" that we should patch as well?
Do we have any kind of agreed-upon Coding Style for C btw?
Regards, Andreas
*astr++ = '?';
else
len++; } *astr = 0;*astr++ = ustr[1];