fix typo.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-base / hddtemp / hddtemp / hddtemp-no-nls-support.patch
1 diff -ru hddtemp-0.3-beta15.orig/configure.in hddtemp-0.3-beta15/configure.in
2 --- hddtemp-0.3-beta15.orig/configure.in        2005-10-17 20:14:19.000000000 +0100
3 +++ hddtemp-0.3-beta15/configure.in     2008-06-27 00:00:46.000000000 +0100
4 @@ -17,6 +17,7 @@
5  # append the host alias to the tools for cross compiling
6  AC_HEADER_STDC
7  AC_CHECK_HEADERS(fcntl.h)
8 +AC_CHECK_HEADERS(iconv.h)
9  AC_CHECK_HEADERS(netinet/in.h)
10  AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE_UNQUOTED([in_addr_t], [uint32_t], [Define to 'uint32_t' if <netinet/in.h> does not define.])], [#include <netinet/in.h>])
11  
12 @@ -29,6 +30,8 @@
13  AM_GNU_GETTEXT
14  #AM_GNU_GETTEXT([external])
15  
16 +AC_CHECK_FUNCS([bindtextdomain textdomain iconv])
17 +
18  dnl reasonable guesses for where stuff is installed
19  dnl if we don't do that now, the config.h will use ${prefix}
20  dnl for DEFAULT_DATABASE_PATH.
21 diff -ru hddtemp-0.3-beta15.orig/src/hddtemp.c hddtemp-0.3-beta15/src/hddtemp.c
22 --- hddtemp-0.3-beta15.orig/src/hddtemp.c       2006-04-19 03:37:35.000000000 +0100
23 +++ hddtemp-0.3-beta15/src/hddtemp.c    2008-06-26 23:59:40.000000000 +0100
24 @@ -276,8 +276,12 @@
25    backtrace_sigbus();
26  
27    setlocale (LC_ALL, "");
28 +#ifdef HAVE_BINDTEXTDOMAIN
29    bindtextdomain (PACKAGE, LOCALEDIR);
30 +#endif
31 +#ifdef HAVE_TEXTDOMAIN
32    textdomain (PACKAGE);
33 +#endif
34    
35    show_db = debug = numeric = quiet = wakeup = af_hint = syslog_interval = 0;
36    unit = DEFAULT;
37 diff -ru hddtemp-0.3-beta15.orig/src/utf8.c hddtemp-0.3-beta15/src/utf8.c
38 --- hddtemp-0.3-beta15.orig/src/utf8.c  2006-04-19 03:37:02.000000000 +0100
39 +++ hddtemp-0.3-beta15/src/utf8.c       2008-06-27 00:02:15.000000000 +0100
40 @@ -23,7 +23,9 @@
41  
42  // Standard includes
43  #include <stdlib.h>
44 +#ifdef HAVE_ICONV_H
45  #include <iconv.h>
46 +#endif
47  #include <langinfo.h>
48  #include <locale.h>
49  #include <string.h>
50 @@ -34,6 +36,7 @@
51  
52  static char *iconv_from_utf8_to_locale(const char *string, const char* fallback_string)
53  {
54 +#ifdef HAVE_ICONV
55    const size_t buffer_inc = 80;        // Increment buffer size in 80 bytes step
56    const char *charset;
57    iconv_t cd;
58 @@ -93,6 +96,8 @@
59    if (dest_buffer != NULL)
60      free(dest_buffer);                 // free buffer
61    free(src_buffer);                    // free string
62 +#endif
63 +
64    return strdup(fallback_string);      // and return fallback string
65  }
66