From 27a53acf7190d20985a927f19fb5d0e90ad25e60 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 20 Jul 2005 14:06:53 +0000 Subject: Fixes - Added 'rcc-gtk-config' program to examples - Fixed problems in autoconf configuration - Fixed bug in rccLocaleGetCharset - Fixed visibility of all items in gtkui --- src/librcc.h | 2 ++ src/rcclocale.c | 2 +- src/rccxml.c | 10 ++++------ 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/librcc.h b/src/librcc.h index a72274a..6b28813 100644 --- a/src/librcc.h +++ b/src/librcc.h @@ -1,6 +1,8 @@ #ifndef _LIBRCC_H #define _LIBRCC_H +#include + /******************************************************************************* ***************************** Global Defines *********************************** *******************************************************************************/ diff --git a/src/rcclocale.c b/src/rcclocale.c index c0b4e63..99d2b8f 100644 --- a/src/rcclocale.c +++ b/src/rcclocale.c @@ -108,7 +108,7 @@ int rccLocaleGetCharset(char *result, const char *lv, unsigned int n) { for (i=0;((l[i])&&(l[i]!='@'));i++); if (i>=n) return -1; - strncpy(result,l,i); + strncpy(result,l+1,i-1); result[i]=0; return 0; diff --git a/src/rccxml.c b/src/rccxml.c index 65a9c4d..143f930 100644 --- a/src/rccxml.c +++ b/src/rccxml.c @@ -281,12 +281,12 @@ int rccSave(rcc_context ctx, const char *name) { if (!doc) { doc = xmlNewDoc("1.0"); if (!doc) goto clear; + pnode = NULL; + } else { + xpathctx = xmlXPathNewContext(doc); + pnode = rccNodeFind(xpathctx, XPATH_SELECTED); } - xpathctx = xmlXPathNewContext(doc); - if (!xpathctx) goto clear; - - pnode = rccNodeFind(xpathctx, XPATH_SELECTED); if (pnode) { lnode = rccNodeFind(xpathctx, XPATH_SELECTED_LANGUAGE); onode = rccNodeFind(xpathctx, XPATH_SELECTED_OPTIONS); @@ -483,8 +483,6 @@ int rccLoad(rcc_context ctx, const char *name) { if ((!doc)&&(!sysdoc)) goto clear; - - node = rccNodeFind(xpathctx, XPATH_SELECTED_LANGUAGE); if (!node) node = rccNodeFind(sysxpathctx, XPATH_SELECTED_LANGUAGE); if (node) { -- cgit v1.2.3