diff options
-rw-r--r-- | include/libintl.h | 2 | ||||
-rw-r--r-- | src/msgfmt.c | 18 | ||||
-rw-r--r-- | src/msgmerge.c | 20 | ||||
-rw-r--r-- | src/poparser.c | 30 |
4 files changed, 35 insertions, 35 deletions
diff --git a/include/libintl.h b/include/libintl.h index ce5f58e..15fb5bf 100644 --- a/include/libintl.h +++ b/include/libintl.h @@ -18,7 +18,7 @@ char *bindtextdomain(const char *domainname, const char *dirname); #ifndef LIBINTL_NO_MACROS /* if these macros are defined, configure checks will detect libintl as * built into the libc because test programs will work without -lintl. - * for example: + * for example: * checking for ngettext in libc ... yes * the consequence is that -lintl will not be added to the LDFLAGS. * so if for some reason you want that libintl.a gets linked, diff --git a/src/msgfmt.c b/src/msgfmt.c index bf5f343..fed7b6c 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -147,7 +147,7 @@ int process(FILE *in, FILE *out) { struct po_parser pb, *p = &pb; int invalid_file = 0; - + mohdr.off_tbl_trans = mohdr.off_tbl_org; for(d.pass = pass_first; d.pass < pass_max; d.pass++) { if(d.pass == pass_second) { @@ -155,32 +155,32 @@ int process(FILE *in, FILE *out) { // check that data gathered in first pass is consistent #ifndef DO_NOTHING if(d.num[pe_msgid] != d.num[pe_msgstr]) { - // one should actually abort here, + // one should actually abort here, // but gnu gettext simply writes an empty .mo and returns success. //abort(); d.num[pe_msgid] = 0; invalid_file = 1; } #endif - + // calculate header fields from len and num arrays mohdr.numstring = d.num[pe_msgid]; mohdr.off_tbl_org = sizeof(struct mo_hdr); mohdr.off_tbl_trans = mohdr.off_tbl_org + d.num[pe_msgid] * (sizeof(unsigned)*2); // print header - fwrite(&mohdr, sizeof(mohdr), 1, out); + fwrite(&mohdr, sizeof(mohdr), 1, out); // set offset startvalue d.off = mohdr.off_tbl_trans + d.num[pe_msgid] * (sizeof(unsigned)*2); if(invalid_file) return 0; } poparser_init(p, convbuf, sizeof(convbuf), process_line_callback, &d); - + while((lp = fgets(line, sizeof(line), in))) { poparser_feed_line(p, lp, sizeof(line)); } - + poparser_finish(p); - + fseek(in, 0, SEEK_SET); } return 0; @@ -238,14 +238,14 @@ int main(int argc, char**argv) { strstarts(A+2, "check-accelerators=") || strstarts(A+2, "resource=") || strstarts(A+2, "locale=") - + ) { } else if((dest = strstarts(A+2, "output-file="))) { set_file(1, dest, &out); } else if(streq(A+2, "version")) { version(); } else if(streq(A+2, "help")) syntax(); - + } else if(streq(A + 1, "o")) { expect_out_fn = 1; } else if( diff --git a/src/msgmerge.c b/src/msgmerge.c index 977f168..b57f06b 100644 --- a/src/msgmerge.c +++ b/src/msgmerge.c @@ -27,7 +27,7 @@ static void version(void) { struct fiLes { FILE *out; - /* we can haz 3 different input files: + /* we can haz 3 different input files: * the .pot, which is the file containing only the ripped out strings from the program * (and no translations) * a .po, which is contains translations and strings made from a previous .pot from that same source file, @@ -38,7 +38,7 @@ struct fiLes { FILE *compend; }; -/* currently we only output input strings as output strings +/* currently we only output input strings as output strings * i.e. there is no translation lookup at all */ int process_line_callback(struct po_info* info, void* user) { char convbuf[8192]; @@ -130,15 +130,15 @@ int main(int argc, char**argv) { streq(A+2, "no-wrap") || streq(A+2, "sort-output") || streq(A+2, "sort-by-file") || - + strstarts(A+2, "lang=") || strstarts(A+2, "color") || // can be --color or --color=xxx strstarts(A+2, "style=") || strstarts(A+2, "width=") || - + streq(A+2, "verbose") || streq(A+2, "quiet") || - streq(A+2, "silent") ) { + streq(A+2, "silent") ) { } else if(streq(A+2, "version")) { version(); } else if((dest = strstarts(A+2, "output-file="))) { @@ -152,14 +152,14 @@ int main(int argc, char**argv) { } else if((dest = strstarts(A+2, "backup"))) { if (*dest == '=') backup = getbackuptype(dest + 1); - else + else backup = 0; } else if(streq(A+2, "update")) { set_update: update = 1; abort(); } else if(streq(A+2, "help")) syntax(); - + } else if(streq(A + 1, "o")) { expect_fn.out = 1; } else if(streq(A + 1, "C")) { @@ -180,7 +180,7 @@ int main(int argc, char**argv) { streq(A+1, "V") || streq(A+1, "q") ) { - + } else if (streq(A+1, "v")) { version(); } else if (streq(A+1, "D")) { @@ -213,8 +213,8 @@ int main(int argc, char**argv) { } for (i = 0; i < 4; i++) { if( - filearr[i] != NULL && - filearr[i] != stdout && + filearr[i] != NULL && + filearr[i] != stdout && filearr[i] != stdin ) fclose(filearr[i]); } diff --git a/src/poparser.c b/src/poparser.c index e677613..2494342 100644 --- a/src/poparser.c +++ b/src/poparser.c @@ -21,10 +21,10 @@ static enum po_entry get_type_and_start(char* lp, char* end, size_t *stringstart if((y = strstarts(lp, "msg"))) { if((x = strstarts(y, "id")) && (isspace(*x) || ((x = strstarts(x, "_plural")) && isspace(*x)))) result_type = pe_msgid; - else if ((x = strstarts(y, "str")) && (isspace(*x) || + else if ((x = strstarts(y, "str")) && (isspace(*x) || (x[0] == '[' && (x[1] == '0' || x[1] == '1') && x[2] == ']' && (x += 3) && isspace(*x)))) result_type = pe_msgstr; - else + else goto inv; while(isspace(*x) && x < end) x++; if(*x != '"') abort(); @@ -40,7 +40,7 @@ static enum po_entry get_type_and_start(char* lp, char* end, size_t *stringstart return result_type; } -/* expects a pointer to the first char after a opening " in a string, +/* expects a pointer to the first char after a opening " in a string, * converts the string into convbuf, and returns the length of that string */ static size_t get_length_and_convert(char* x, char* end, char* convbuf, size_t convbuflen) { size_t result = 0; @@ -77,37 +77,37 @@ int poparser_feed_line(struct po_parser *p, char* line, size_t buflen) { char *convbuf = p->buf; size_t convbuflen = p->bufsize; size_t strstart; - + static const enum lineactions action_tbl[pe_max][pe_max] = { // pe_str will never be set as curr_type - [pe_str] = { + [pe_str] = { [pe_str] = la_abort, [pe_msgid] = la_abort, [pe_msgstr] = la_abort, - [pe_invalid] = la_abort, + [pe_invalid] = la_abort, }, - [pe_msgid] = { + [pe_msgid] = { [pe_str] = la_incr, [pe_msgid] = la_proc, [pe_msgstr] = la_proc, - [pe_invalid] = la_proc, + [pe_invalid] = la_proc, }, - [pe_msgstr] = { + [pe_msgstr] = { [pe_str] = la_incr, [pe_msgid] = la_proc, [pe_msgstr] = la_proc, - [pe_invalid] = la_proc, + [pe_invalid] = la_proc, }, - [pe_invalid] = { + [pe_invalid] = { [pe_str] = la_nop, // this can happen when we have msgstr[2] "" ... "foo", since we only parse msgstr[0] and [1] [pe_msgid] = la_incr, [pe_msgstr] = la_incr, - [pe_invalid] = la_nop, + [pe_invalid] = la_nop, }, }; - + enum po_entry type; - + type = get_type_and_start(line, line + buflen, &strstart); switch(action_tbl[p->prev_type][type]) { case la_incr: @@ -122,7 +122,7 @@ int poparser_feed_line(struct po_parser *p, char* line, size_t buflen) { p->cb(&p->info, p->cbdata); if(type != pe_invalid) p->curr_len = get_length_and_convert(line + strstart, line + buflen, convbuf, convbuflen); - else + else p->curr_len = 0; break; case la_nop: |