Skip to content

Instantly share code, notes, and snippets.

@smgoller
Created September 29, 2012 06:46
Show Gist options
  • Save smgoller/3803377 to your computer and use it in GitHub Desktop.
Save smgoller/3803377 to your computer and use it in GitHub Desktop.
homebrew unac formula iconv patch
diff --git a/configure.ac b/configure.ac
index 4a4eab6..9f25d50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,7 @@ AM_MAINTAINER_MODE
AM_ICONV
+LIBS="$LIBS -liconv"
AC_CHECK_FUNCS(iconv_open,,AC_MSG_ERROR([
iconv_open not found try to install replacement from
http://www.gnu.org/software/libiconv/
--- a/unac.c-orig 2011-04-19 13:54:18.659570997 +0100
+++ b/unac.c 2011-04-19 13:45:46.165065548 +0100
@@ -13873,9 +13873,9 @@
*out_lengthp = 0;
} else {
char* utf16 = 0;
- int utf16_length = 0;
+ size_t utf16_length = 0;
char* utf16_unaccented = 0;
- int utf16_unaccented_length = 0;
+ size_t utf16_unaccented_length = 0;
if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) {
return -1;
--- a/unaccent.c-orig 2011-04-19 14:53:35.164957877 +0100
+++ b/unaccent.c 2011-04-19 14:55:49.669615437 +0100
@@ -90,7 +90,7 @@
const char* charset = argv[optind++];
char* unaccented = 0;
- int unaccented_length = 0;
+ size_t unaccented_length = 0;
if(optind >= argc) {
#define BUFFER_SIZE 10240
@@ -101,7 +101,7 @@
perror("");
exit(1);
}
- printf("%.*s", unaccented_length, unaccented);
+ printf("%.*s", (int)unaccented_length, unaccented);
}
} else {
const char* string = argv[optind++];
@@ -114,7 +114,7 @@
if(debug_level > UNAC_DEBUG_NONE)
fprintf(stderr, "unaccented version is ");
- printf("%.*s\n", unaccented_length, unaccented);
+ printf("%.*s\n", (int)unaccented_length, unaccented);
if(optind < argc) {
const char* expected = argv[optind++];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment