[vlc-commits] commit: utf8_vasprintf(): avoid useless strdup if UTF-8 is assumed ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Sun Jul 18 11:18:18 CEST 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 18 12:09:55 2010 +0300| [9f1a2dccb55a21de912f580e95100f5a99ecbd06] | committer: Rémi Denis-Courmont
utf8_vasprintf(): avoid useless strdup if UTF-8 is assumed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9f1a2dccb55a21de912f580e95100f5a99ecbd06
---
src/text/unicode.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/text/unicode.c b/src/text/unicode.c
index aad409d..12d0ae9 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -212,8 +212,12 @@ static int utf8_vasprintf( char **str, const char *fmt, va_list ap )
if( res == -1 )
return -1;
+#ifdef ASSUME_UTF8
+ *str = utf8;
+#else
*str = ToLocaleDup( utf8 );
free( utf8 );
+#endif
return res;
}
More information about the vlc-commits
mailing list