[gnac] Updated build system (trac ticket #32)



commit 771427c1ed3963c97afa15dd88c9411f1f5f4bff
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Tue Mar 23 11:48:49 2010 +0000

    Updated build system (trac ticket #32)

 Makefile.am                                  |    5 +-
 TODO                                         |    1 +
 autogen.sh                                   |   11 ++-
 configure.ac                                 |  147 ++++++++++++++------------
 libgnac/libgnac-converter.c                  |    2 +-
 libgnac/libgnac-output.c                     |    1 -
 src/gnac-main.c                              |    5 +-
 src/profiles/formats/gnac-profiles-aac.c     |    3 +-
 src/profiles/formats/gnac-profiles-flac.c    |    3 +-
 src/profiles/formats/gnac-profiles-lame.c    |    3 +-
 src/profiles/formats/gnac-profiles-speex.c   |    3 +-
 src/profiles/formats/gnac-profiles-unknown.c |    5 +-
 src/profiles/formats/gnac-profiles-vorbis.c  |    3 +-
 src/profiles/formats/gnac-profiles-wav.c     |    3 +-
 src/profiles/formats/gnac-profiles-wavpack.c |    3 +-
 src/profiles/gnac-profiles-default.c         |    3 +-
 src/profiles/gnac-profiles-properties.c      |   13 +--
 src/profiles/gnac-profiles-utils.c           |    2 +-
 src/profiles/gnac-profiles-xml-engine.c      |   17 ++--
 19 files changed, 116 insertions(+), 117 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0d115e5..77b953e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ SUBDIRS = \
 	man \
 	src
 
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
 INTLTOOL_BUILT = \
 	intltool-extract \
@@ -13,8 +13,7 @@ INTLTOOL_BUILT = \
 	intltool-update
 
 EXTRA_DIST = \
-	autogen.sh \
-	$(INTLTOOL_BUILT:=.in)
+	autogen.sh
 
 DISTCLEANFILES = \
 	po/.intltool-merge-cache \
diff --git a/TODO b/TODO
index e69de29..ecf0b98 100644
--- a/TODO
+++ b/TODO
@@ -0,0 +1 @@
+- Upgrade the license of libgnac to LGPL
diff --git a/autogen.sh b/autogen.sh
index 7edd107..43cd62e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,14 +6,17 @@ test -z "$srcdir" && srcdir=.
 
 PKG_NAME="gnac"
 
-(test -f $srcdir/src/gnac.h) || {
-    echo "**Error**: Directory "\`$srcdir\'" does not look like the top-level $PKG_NAME directory"
+(test -f $srcdir/configure.ac \
+  && test -f $srcdir/src/gnac.h) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level $PKG_NAME directory"
     exit 1
 }
 
 which gnome-autogen.sh || {
-	echo "You need to install gnome-common from the GNOME CVS"
+	echo "You need to install gnome-common from GNOME Git (or from"
+  echo "your vendor's package manager)."
 	exit 1
 }
 
-REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh
+USE_GNOME2_MACROS=1 . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index 95183d8..6b18b97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,48 +1,73 @@
-AC_PREREQ(2.60)
+dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([gnac], [0.3], [http://bugzilla.gnome.org/enter_bug.cgi?product=gnac])
+AC_PREREQ([2.64])
 
-AM_INIT_AUTOMAKE([dist-bzip2])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SRCDIR([src/gnac-main.c])
-AC_CONFIG_HEADER([config.h])
+m4_define([gnac_major_version], [0])
+m4_define([gnac_minor_version], [2])
+m4_define([gnac_micro_version], [2])
+m4_define([gnac_version],
+  gnac_major_version.gnac_minor_version.gnac_micro_version)
 
-AM_MAINTAINER_MODE
+AC_INIT(
+  [Gnac],
+  [gnac_version],
+  [http://bugzilla.gnome.org/enter_bug.cgi?product=gnac],
+  [gnac],
+  [http://gnac.sf.net])
 
-GNOME_COMMON_INIT
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_SRCDIR([src/gnac-main.c])
+AC_CONFIG_MACRO_DIR([m4])
 
-dnl Do the gettext/i18n stuff
-GETTEXT_PACKAGE=gnac
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The name of the gettext package.])
-AC_SUBST(GETTEXT_PACKAGE)
-AM_GLIB_GNU_GETTEXT
+AC_DEFINE([GNAC_MAJOR_VERSION], [gnac_major_version], [Gnac major version])
+AC_SUBST([GNAC_MAJOR_VERSION], [gnac_major_version])
+AC_DEFINE([GNAC_MINOR_VERSION], [gnac_minor_version], [Gnac minor version])
+AC_SUBST([GNAC_MINOR_VERSION], [gnac_minor_version])
+AC_DEFINE([GNAC_MICRO_VERSION], [gnac_micro_version], [Gnac micro version])
+AC_SUBST([GNAC_MICRO_VERSION], [gnac_micro_version])
 
-dnl Standard C compiler
-AC_ISC_POSIX
+dnl FIXME Automake 1.10 and 1.11 suffer from critical security issues
+AM_INIT_AUTOMAKE([1.11 dist-bzip2])
+dnl Silent make mode (require automake >= 1.11)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+dnl Checks for programs
 AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_RANLIB
-AC_FUNC_MALLOC
-AC_TYPE_SIZE_T
-AM_PROG_CC_STDC
-AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
 
-dnl Check for standard headers
-AC_HEADER_STDC
-AC_HEADER_DIRENT
-AC_CHECK_HEADERS([stdio.h libintl.h])
+PKG_PROG_PKG_CONFIG
 
-AC_PROG_LIBTOOL
-AC_PROG_INSTALL
-IT_PROG_INTLTOOL([0.35.0])
+dnl Initialize libtool
+LT_PREREQ([2.2.6])
+LT_INIT
 
-GNOME_COMPILE_WARNINGS([maximum])
+dnl Internationalization support (gettext/i18n stuff)
+IT_PROG_INTLTOOL([0.40.6])
+AC_SUBST([GETTEXT_PACKAGE], [PACKAGE_TARNAME])
+AM_GNU_GETTEXT_VERSION([0.17])
+AM_GLIB_GNU_GETTEXT
+AC_DEFINE(
+  [GETTEXT_PACKAGE],
+  [PACKAGE_NAME],
+  [Define to the full name of the gettext package.])
+
+dnl Check for gconftool-2
+AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
+if test "$GCONFTOOL" = "no"; then
+  AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
+fi
+AM_GCONF_SOURCE_2
+
+GNOME_COMMON_INIT
 GNOME_DEBUG_CHECK
+GNOME_COMPILE_WARNINGS([maximum])
+GNOME_CXX_WARNINGS([yes])
 GNOME_MAINTAINER_MODE_DEFINES
 
-dnl Use the GNOME documentation framework
-#GNOME_DOC_INIT
-
 dnl Find GLib and GObject
 PKG_CHECK_MODULES(GLIB, [
   glib-2.0 
@@ -64,6 +89,7 @@ PKG_CHECK_MODULES(UI, [
 AC_SUBST(UI_CFLAGS)
 AC_SUBST(UI_LIBS)
 
+dnl Find the Gstreamer libraries
 PKG_CHECK_MODULES(GSTREAMER, [
   gstreamer-0.10 >= 0.10.20
   gstreamer-plugins-base-0.10
@@ -73,44 +99,27 @@ PKG_CHECK_MODULES(GSTREAMER, [
 AC_SUBST(GSTREAMER_CFLAGS)
 AC_SUBST(GSTREAMER_LIBS)
 
-dnl Find the GStreamer elements we use, and warn if they are not present
-AM_GST_ELEMENT_CHECK(giosrc, , AC_MSG_ERROR([The 'giosrc' element was not found. This will Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(giosink, , AC_MSG_ERROR([The 'giosink' element was not found. This will cause Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(decodebin, , AC_MSG_ERROR([The 'decodebin' element was not found. This will cause Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(vorbisenc, , AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.]))
-AM_GST_ELEMENT_CHECK(flacenc, , AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.]))
-AM_GST_ELEMENT_CHECK(wavenc, , AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to WAV to fail.]))
-AM_GST_ELEMENT_CHECK(wavpackenc, , AC_MSG_WARN([The 'wavpackenc' element was not found. This will cause encoding to WAVPACK to fail.]))
-AM_GST_ELEMENT_CHECK(faac, , AC_MSG_WARN([The 'faac' element was not found. This will cause encoding to AAC to fail.]))
-AM_GST_ELEMENT_CHECK(lame, , AC_MSG_WARN([The 'lame' element was not found. This will cause encoding to MP3 to fail.]))
-
-dnl Find how and where to put the GConf schemas
-AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
-if test "$GCONFTOOL" = "no"; then
-  AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
-fi
-AM_GCONF_SOURCE_2
-
-dnl Optionnaly enable G* deprecations
-AC_MSG_CHECKING([Wether to enable deprecation warnings])
-AC_ARG_ENABLE([deprecation],
-  [AS_HELP_STRING([--enable-deprecations],
-  [enable deprecation warnings [default=no]])],
-  [], [enable_deprecations=no])
-AC_MSG_RESULT([$enable_deprecations])
-
-if test "$enable_deprecations" = "no"; then
-  DISABLE_DEPRECATED=""
-  AC_SUBST(DISABLE_DEPRECATED)
-fi
-
-dnl We require Scroll Keeper 0.3.5 or above for the help
-#SCROLLKEEPER_BUILD_REQUIRED=0.3.5
-#AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED)
-
-AC_SUBST([AM_CPPFLAGS])
-AC_SUBST([AM_CFLAGS])
-AC_SUBST([AM_LDFLAGS])
+dnl The giosrc, giosink and decodebin elements are compulsory.
+AM_GST_ELEMENT_CHECK(giosrc, [],
+  AC_MSG_ERROR([The 'giosrc' element was not found. This will cause Gnac to fail at runtime.]))
+AM_GST_ELEMENT_CHECK(giosink, [],
+  AC_MSG_ERROR([The 'giosink' element was not found. This will cause Gnac to fail at runtime.]))
+AM_GST_ELEMENT_CHECK(decodebin, [],
+  AC_MSG_ERROR([The 'decodebin' element was not found. This will cause Gnac to fail at runtime.]))
+dnl The encoders are optional (a missing encoder will simply prevent
+dnl encoding to the given format)
+AM_GST_ELEMENT_CHECK(vorbisenc, [],
+  AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.]))
+AM_GST_ELEMENT_CHECK(flacenc, [],
+  AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.]))
+AM_GST_ELEMENT_CHECK(wavenc, [],
+  AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to WAV to fail.]))
+AM_GST_ELEMENT_CHECK(wavpackenc, [],
+  AC_MSG_WARN([The 'wavpackenc' element was not found. This will cause encoding to WAVPACK to fail.]))
+AM_GST_ELEMENT_CHECK(faac, [],
+  AC_MSG_WARN([The 'faac' element was not found. This will cause encoding to AAC to fail.]))
+AM_GST_ELEMENT_CHECK(lame, [],
+  AC_MSG_WARN([The 'lame' element was not found. This will cause encoding to MP3 to fail.]))
 
 dnl Finally, generate the files
 AC_CONFIG_FILES([
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index 05cf35f..8c9c7ba 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -1051,7 +1051,7 @@ libgnac_converter_error_cb(GstBus      *bus,
 
     } else if (g_error_matches(error,
                   GST_RESOURCE_ERROR,
-                  GST_RESOURCE_ERROR_OPEN_READ))
+                  GST_RESOURCE_ERROR_OPEN_WRITE))
     {
       if (g_file_test(g_file_get_path(item->destination), G_FILE_TEST_EXISTS))
       {
diff --git a/libgnac/libgnac-output.c b/libgnac/libgnac-output.c
index 8e5a4b1..8213bfe 100644
--- a/libgnac/libgnac-output.c
+++ b/libgnac/libgnac-output.c
@@ -32,7 +32,6 @@
 #include <glib/gi18n.h>
 #include <gst/gst.h>
 #include <stdarg.h>
-#include <string.h>
 
 #include "libgnac-debug.h"
 #include "libgnac-error.h"
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 53c5b30..7c101d4 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -30,13 +30,10 @@
 #include <gdk/gdkkeysyms.h>
 #include <gio/gio.h>
 #include <glib/gi18n.h>
-#include <glib/gstdio.h>
 #include <gst/gst.h>
+#include <glib/gstdio.h>
 #include <gst/pbutils/pbutils.h>
-#include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
 
 #include "gnac.h"
 #include "gnac-bars.h"
diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c
index 95cf4cf..62076d0 100755
--- a/src/profiles/formats/gnac-profiles-aac.c
+++ b/src/profiles/formats/gnac-profiles-aac.c
@@ -23,9 +23,8 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gnac-profiles-aac.h"
 
diff --git a/src/profiles/formats/gnac-profiles-flac.c b/src/profiles/formats/gnac-profiles-flac.c
index 7d5b0d0..a225f22 100755
--- a/src/profiles/formats/gnac-profiles-flac.c
+++ b/src/profiles/formats/gnac-profiles-flac.c
@@ -23,9 +23,8 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gnac-profiles-flac.h"
 
diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c
index ccf2815..51cb87a 100755
--- a/src/profiles/formats/gnac-profiles-lame.c
+++ b/src/profiles/formats/gnac-profiles-lame.c
@@ -23,8 +23,7 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
-#include <string.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
 
 #include "gnac-profiles-lame.h"
diff --git a/src/profiles/formats/gnac-profiles-speex.c b/src/profiles/formats/gnac-profiles-speex.c
index f3f0648..779650b 100644
--- a/src/profiles/formats/gnac-profiles-speex.c
+++ b/src/profiles/formats/gnac-profiles-speex.c
@@ -23,9 +23,8 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gnac-profiles-speex.h"
 
diff --git a/src/profiles/formats/gnac-profiles-unknown.c b/src/profiles/formats/gnac-profiles-unknown.c
index ce3f743..2f18366 100644
--- a/src/profiles/formats/gnac-profiles-unknown.c
+++ b/src/profiles/formats/gnac-profiles-unknown.c
@@ -23,10 +23,9 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <stdlib.h>
 
 #include "gnac-profiles-unknown.h"
 
diff --git a/src/profiles/formats/gnac-profiles-vorbis.c b/src/profiles/formats/gnac-profiles-vorbis.c
index 9798862..dd71b1e 100755
--- a/src/profiles/formats/gnac-profiles-vorbis.c
+++ b/src/profiles/formats/gnac-profiles-vorbis.c
@@ -23,9 +23,8 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gnac-profiles-vorbis.h"
 
diff --git a/src/profiles/formats/gnac-profiles-wav.c b/src/profiles/formats/gnac-profiles-wav.c
index b0d5cb9..32d7b9b 100755
--- a/src/profiles/formats/gnac-profiles-wav.c
+++ b/src/profiles/formats/gnac-profiles-wav.c
@@ -23,9 +23,8 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gnac-profiles-wav.h"
 
diff --git a/src/profiles/formats/gnac-profiles-wavpack.c b/src/profiles/formats/gnac-profiles-wavpack.c
index e029c30..6ba46fa 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.c
+++ b/src/profiles/formats/gnac-profiles-wavpack.c
@@ -23,8 +23,7 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <stdio.h>
-#include <string.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
 
 #include "gnac-profiles-wavpack.h"
diff --git a/src/profiles/gnac-profiles-default.c b/src/profiles/gnac-profiles-default.c
index 15c8515..9e5b810 100755
--- a/src/profiles/gnac-profiles-default.c
+++ b/src/profiles/gnac-profiles-default.c
@@ -26,9 +26,8 @@
 #include "gnac-profiles-default.h"
 #include "libgnac-debug.h"
 
-#include <stdio.h>
+#include <glib/gstdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 void
 gnac_profiles_default_init(BasicFormatInfo *bfi, GCallback pipeline_callback)
diff --git a/src/profiles/gnac-profiles-properties.c b/src/profiles/gnac-profiles-properties.c
index 3673230..67592af 100644
--- a/src/profiles/gnac-profiles-properties.c
+++ b/src/profiles/gnac-profiles-properties.c
@@ -31,7 +31,6 @@
 #include <gio/gio.h>
 #include <gmodule.h>
 #include <stdlib.h>
-#include <string.h>
 #include <glib/gi18n.h>
 
 #include "gnac-profiles-properties.h"
@@ -587,7 +586,7 @@ gnac_profiles_properties_update_textbuffer(const gchar *pipeline)
   text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
     "gstreamer_pipeline_text_view"));
   pipeline_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
-  gtk_text_buffer_set_text(pipeline_text_buffer,pipeline,strlen(pipeline));
+  gtk_text_buffer_set_text(pipeline_text_buffer,pipeline,g_utf8_strlen(pipeline,-1));
 }
 
 static void
@@ -642,7 +641,7 @@ gnac_profiles_properties_name_description_set_text(const gchar *name,
       "profile_description_text_view"));
     text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
     gtk_text_buffer_set_text(GTK_TEXT_BUFFER(text_buffer),description,
-      strlen(description));
+      g_utf8_strlen(description,-1));
   }
 }
 
@@ -783,11 +782,11 @@ gnac_profiles_properties_is_valid_filename_char(guint keyval)
 
 static gboolean
 gnac_profiles_properties_is_valid_filename_chars(const gchar *chars) {
-  size_t len;
+  glong len;
   int i;
   int j;
   
-  len = strlen(chars);
+  len = g_utf8_strlen(chars, -1);
   for (i = 0; i<len; ++i) {
     for (j = 0; j<nb_forbidden_chars; ++j) {
       if (chars[i] == forbidden_chars[j]) {
@@ -880,10 +879,10 @@ gchar *
 gnac_profiles_properties_filter_text_for_displaying(const gchar *text, int length) {
   gchar *str1;
   gchar *str2;
-  size_t len;
+  glong  len;
   
   if (text != NULL) {
-    len = strlen(text);
+    len = g_utf8_strlen(text, -1);
     if (len > length) {
       str2 = g_strndup(text, length);
       str1 = g_strconcat(str2,"...", NULL);
diff --git a/src/profiles/gnac-profiles-utils.c b/src/profiles/gnac-profiles-utils.c
index 34f9b7f..9ba1c40 100755
--- a/src/profiles/gnac-profiles-utils.c
+++ b/src/profiles/gnac-profiles-utils.c
@@ -26,7 +26,7 @@
 #include "gnac-profiles-utils.h"
 #include "libgnac-debug.h"
 
-#include "stdlib.h"
+#include <stdlib.h>
 
 gchar *raw = NULL;
 gchar *audioconvert = NULL;
diff --git a/src/profiles/gnac-profiles-xml-engine.c b/src/profiles/gnac-profiles-xml-engine.c
index fcf6c1e..2a7aea0 100755
--- a/src/profiles/gnac-profiles-xml-engine.c
+++ b/src/profiles/gnac-profiles-xml-engine.c
@@ -23,15 +23,16 @@
  * Boston, MA  02110-1301  USA
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
+#include <glib/gi18n.h>
 #include <glib/gstdio.h>
-#include <stdio.h>
-#include <string.h>
-#include <libintl.h>
-
 
 #include "gnac-profiles-xml-engine.h"
 
@@ -53,7 +54,7 @@ gnac_profiles_xml_engine_load_doc_xpath(const gchar *filename)
   if (doc != NULL) {
     xpath = xmlXPathNewContext(doc);
     if (xpath != NULL) {
-      dx = malloc(sizeof(XMLDoc));
+      dx = g_malloc(sizeof(XMLDoc));
       dx->doc = (void*) doc;
       dx->xpath_context = (void*) xpath;
     } else {
@@ -140,7 +141,7 @@ gnac_profiles_xml_engine_get_list_values( XMLDoc *dx,
         Value *v;
         
         if (!gnac_profiles_xml_engine_is_i12n_node(current_node)) {
-          v = malloc(sizeof(Value));
+          v = g_malloc(sizeof(Value));
           v->name = g_strdup(gettext((const gchar*) current_node->children->content));
           v->value = g_strdup((const gchar*) current_node->properties->children->content);
           list = g_list_append(list,v);
@@ -424,13 +425,13 @@ gchar *
 gnac_profiles_xml_engine_format_text_to_xml(const gchar *text) {
   if (text != NULL) {
     gchar *text_return = NULL;
-    size_t text_size;
+    glong text_size;
     const gchar *replacement;
     gchar *temp;
     int last_replacement = 0;
     int i;
     
-    text_size = strlen(text);
+    text_size = g_utf8_strlen(text, -1);
     for (i = 0; i<text_size; ++i) {
       switch (text[i]) {
         case '&':



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]