summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2010-03-11 18:52:52 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2010-03-11 18:52:52 +0100
commit6d7c759b430bebb5a2a3ef6954bbb889ff55c378 (patch)
tree6ed30e8423e7cc136679a0c0492e5474f083f1ea /src
parentee5803048cecea310be065e068cee40d08135ef9 (diff)
downloadlibrcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.gz
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.bz2
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.xz
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.zip
Few bugs found by lint of OpenSuSE, many thanks to Novel
Diffstat (limited to 'src')
-rw-r--r--src/librcc.c4
-rw-r--r--src/rccexternal.c9
-rw-r--r--src/rccstring.c2
3 files changed, 10 insertions, 5 deletions
diff --git a/src/librcc.c b/src/librcc.c
index 2d1d7e4..a2d4718 100644
--- a/src/librcc.c
+++ b/src/librcc.c
@@ -401,8 +401,8 @@ rcc_language_id rccRegisterLanguage(rcc_context ctx, rcc_language *language) {
if ((i==1)&&(!language->charsets[1])&&(rccIsUTF8(language->charsets[0])))
ctx->ilang[ctx->n_languages].latin = 1;
- ctx->languages[ctx->n_languages++] = (rcc_language_ptr)(ctx->ilang + ctx->n_languages);
- ctx->languages[ctx->n_languages] = NULL;
+ ctx->languages[ctx->n_languages] = (rcc_language_ptr)(ctx->ilang + ctx->n_languages);
+ ctx->languages[++ctx->n_languages] = NULL;
if (!ctx->current_language)
ctx->current_config = rccGetCurrentConfig(ctx);
diff --git a/src/rccexternal.c b/src/rccexternal.c
index 080e4da..f1e8fba 100644
--- a/src/rccexternal.c
+++ b/src/rccexternal.c
@@ -70,6 +70,7 @@ static char *addr = NULL;
int rccExternalInit() {
#ifdef HAVE_SIGNAL_H
struct sigaction act;
+ struct stat st;
#endif /* HAVE_SIGNAL_H */
if (pid != (pid_t)-1) return 0;
@@ -93,8 +94,12 @@ int rccExternalInit() {
return 0;
}
-
- execl(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+
+ /*if ((!stat("../external/" RCC_EXT_PROG_NAME, &st))&&(st.st_mode&S_IXOTH)) {
+ execl ("../external/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+ } else*/ if ((!stat(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, &st))&&(st.st_mode&S_IXOTH)) {
+ execl(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+ }
exit(1);
}
diff --git a/src/rccstring.c b/src/rccstring.c
index 34fc831..eee2ac2 100644
--- a/src/rccstring.c
+++ b/src/rccstring.c
@@ -64,7 +64,7 @@ int rccStringFixID(rcc_string string, rcc_context ctx) {
header = (rcc_string_header*)string;
- memcpy(lang, header->language, 2); lang[3] = 0;
+ memcpy(lang, header->language, 2); lang[2] = 0;
curlang = rccGetLanguageName(ctx, header->language_id);
if ((curlang)&&(!strcasecmp(lang, curlang))) return 0;