From dc88e8545a834df924004ad1a4742ee06e3e7416 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Thu, 13 Dec 2001 19:47:20 +0000 Subject: [PATCH] Little better error messages. --- gedcom/encoding.c | 6 +++--- gedcom/gedcom_lex_common.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gedcom/encoding.c b/gedcom/encoding.c index 0c7af44..8b980ac 100644 --- a/gedcom/encoding.c +++ b/gedcom/encoding.c @@ -81,7 +81,7 @@ char* get_encoding(char* gedcom_n, ENCODING enc) datum = tfind(&search_node, &encoding_mapping, node_compare); free(buffer); if (datum == NULL) { - gedcom_error(_("No encoding found for '%s'"), gedcom_n); + gedcom_error(_("No encoding defined for '%s'"), gedcom_n); return NULL; } else { @@ -118,8 +118,7 @@ void init_encodings() GCONV_SEARCH_PATH, gconv_path, PKGDATADIR); } if (putenv(new_gconv_path) != 0) { - gedcom_warning(_("Failed updating environment variable %s"), - GCONV_SEARCH_PATH); + gedcom_warning(_("Failed updating conversion module path")); } } @@ -135,6 +134,7 @@ void init_encodings() ENCODING_CONF_FILE); } else { + line_no = 1; while (fgets(buffer, sizeof(buffer), in) != NULL) { if (buffer[strlen(buffer) - 1] != '\n') { gedcom_error(_("Line too long in encoding configuration file '%s'"), diff --git a/gedcom/gedcom_lex_common.c b/gedcom/gedcom_lex_common.c index 93c26f3..e1c17bb 100644 --- a/gedcom/gedcom_lex_common.c +++ b/gedcom/gedcom_lex_common.c @@ -97,7 +97,7 @@ int test_loop(ENCODING enc, char* code) { if (line_len != (size_t)-1) { \ line_len += strlen(yytext); \ if (line_len > MAXGEDCLINELEN * encoding_width) { \ - gedcom_error(_("Line too long, max %d characters"), \ + gedcom_error(_("Line too long, max %d characters allowed"), \ MAXGEDCLINELEN); \ line_len = (size_t)-1; \ return BADTOKEN; \ @@ -170,7 +170,7 @@ int test_loop(ENCODING enc, char* code) #define ACTION_0_DIGITS \ - { gedcom_error (_("Level number with leading zero")); \ + { gedcom_error (_("Level number with leading zero not allowed")); \ return BADTOKEN; \ } @@ -206,7 +206,7 @@ int test_loop(ENCODING enc, char* code) #define ACTION_ALPHANUM \ { if (strlen(yytext) > MAXGEDCTAGLEN * encoding_width) { \ - gedcom_error(_("Tag '%s' too long, max %d characters"), \ + gedcom_error(_("Tag '%s' too long, max %d characters allowed"), \ yytext, MAXGEDCTAGLEN); \ return BADTOKEN; \ } \ @@ -248,7 +248,7 @@ int test_loop(ENCODING enc, char* code) #define ACTION_POINTER \ { CHECK_LINE_LEN; \ if (strlen(yytext) > MAXGEDCPTRLEN * encoding_width) { \ - gedcom_error(_("Pointer '%s' too long, max %d characters"), \ + gedcom_error(_("Pointer '%s' too long, max %d characters allowed"), \ yytext, MAXGEDCPTRLEN); \ return BADTOKEN; \ } \ -- 2.30.2