diff options
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | librcc.spec.in | 37 | ||||
-rw-r--r-- | src/rcciconv.c | 4 | ||||
-rw-r--r-- | src/recode.c | 9 |
4 files changed, 29 insertions, 23 deletions
@@ -1 +1 @@ -0.2.1 +0.2.2 diff --git a/librcc.spec.in b/librcc.spec.in index 0ec151b..0e162df 100644 --- a/librcc.spec.in +++ b/librcc.spec.in @@ -53,27 +53,29 @@ is part of rusxmms patch. rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/rcc -mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/rcc/engines/ -mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/rcc/engines/ +mkdir -p $RPM_BUILD_ROOT/%{_bindir} + make install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT%{prefix}/lib/*.la -rm -f $RPM_BUILD_ROOT%{prefix}/lib/rcc/engines/*.a -rm -f $RPM_BUILD_ROOT%{prefix}/lib/rcc/engines/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/rcc/engines/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/rcc/engines/*.la make -C examples make -C examples install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT%{prefix}/bin/example* +rm -f $RPM_BUILD_ROOT%{_bindir}/example* install -m 644 examples/rcc.xml $RPM_BUILD_ROOT/etc -if [ -f $RPM_BUILD_ROOT/usr/bin/rcc-gtk2-config ]; then - ln -s rcc-gtk2-config $RPM_BUILD_ROOT/usr/bin/rcc-config -elif [ -f $RPM_BUILD_ROOT/usr/bin/rcc-gtk-config ]; then - ln -s rcc-gtk-config $RPM_BUILD_ROOT/usr/bin/rcc-config +if [ -f $RPM_BUILD_ROOT/%{_bindir}/rcc-gtk2-config ]; then + ln -s rcc-gtk2-config $RPM_BUILD_ROOT/%{_bindir}/rcc-config +elif [ -f $RPM_BUILD_ROOT/%{_bindir}/rcc-gtk-config ]; then + ln -s rcc-gtk-config $RPM_BUILD_ROOT/%{_bindir}/rcc-config else echo "#!/bin/bash" > $RPM_BUILD_ROOT/usr/bin/rcc-config - echo "echo \"Configuration UI is not available!\"" >> $RPM_BUILD_ROOT/usr/bin/rcc-config + echo "echo \"Configuration UI is not available!\"" >> $RPM_BUILD_ROOT/%{_bindir}/rcc-config fi + %clean rm -rf $RPM_BUILD_ROOT @@ -87,14 +89,15 @@ rm -rf $RPM_BUILD_ROOT %doc examples/rcc-example.xml %dir /etc/rcc /etc/rcc.xml -%{prefix}/lib/lib*.so.* -%{prefix}/lib/rcc/ -%{prefix}/bin/rcc-*config +%{_libdir}/lib*.so.* +%{_libdir}/rcc/ +%{_bindir}/rcc-*config %files devel %defattr(-, root, root) -%{prefix}/include/ -%{prefix}/lib/lib*.so -%{prefix}/lib/*.a +%{_includedir} +%{_libdir}/lib*.so +%{_libdir}/*.a + %changelog diff --git a/src/rcciconv.c b/src/rcciconv.c index b518cd7..6d3d1b0 100644 --- a/src/rcciconv.c +++ b/src/rcciconv.c @@ -9,7 +9,7 @@ #define RCC_MAX_ERRORS 3 -static void rccIConvCopySymbol(char **in_buf, int *in_left, char **out_buf, int *out_left) { +static void rccIConvCopySymbol(char **in_buf, size_t *in_left, char **out_buf, size_t *out_left) { if ((out_left>0)&&(in_left>0)) { /* (**out_buf)=(**in_buf); (*out_buf)++; @@ -57,7 +57,7 @@ int rccIConvGetError(rcc_iconv icnv) { size_t rccIConvRecode(rcc_iconv icnv, char *outbuf, size_t outsize, const char *buf, size_t size) { char *in_buf, *out_buf, err; - int in_left, out_left; + size_t in_left, out_left; int ub, utf_mode=0; int errors=0; diff --git a/src/recode.c b/src/recode.c index 9e19078..8c6cc40 100644 --- a/src/recode.c +++ b/src/recode.c @@ -511,17 +511,20 @@ rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, } } else icnv = ctx->iconv_from[class_id]; - + if (icnv) { ret = rccIConvInternal(ctx, icnv, buf, len); - if (ret == (size_t)-1) return NULL; + if (ret == (size_t)-1) { + rccMutexUnLock(ctx->mutex); + return NULL; + } if ((rccGetOption(ctx, RCC_OPTION_TRANSLATE))&&(rccGetClassType(ctx, class_id) == RCC_CLASS_TRANSLATE_FROM)) { config = rccGetCurrentConfig(ctx); translate = rccRecodeTranslate(&config , class_id, ctx->tmpbuffer); if (translate) language_id = rccConfigGetLanguage(config); } - + result = rccCreateString(language_id, translate?translate:ctx->tmpbuffer, translate?0:ret); } else { if ((rccGetOption(ctx, RCC_OPTION_TRANSLATE))&&(rccGetClassType(ctx, class_id) == RCC_CLASS_TRANSLATE_FROM)) { |