poe

Уређивач .po фајлова
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 240cbac70f9d365dc08a141e5441ffa7abf7e5f2
родитељ f812d1c31155a73a299cac13e72b8a2da5c3a511
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 12 Jul 2021 16:51:26 +0200

Optimization: Don't take into account empty lines when deciding whether to output as one or multiple lines on file save

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mdraw.c | 2+-
Mpo.c | 22++++++++++++++--------
Mpoe.c | 9+++++----
Mtest/sr.po | 205+++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
Mutil.c | 30++++++++++++++++++++++++++++--
Mutil.h | 4++--
измењених датотека: 6, додавања: 184(+), брисања: 88(-)

diff --git a/draw.c b/draw.c @@ -209,7 +209,7 @@ split(const uint32_t* s) if (!s) return NULL; - size_t num_lines = u32_lines_in_string(s); + size_t num_lines = u32_lines_in_string(s, NULL); struct BufferLine* newbuf = NULL; struct BufferLine* pnewbuf = NULL; const uint32_t* ps = s; diff --git a/po.c b/po.c @@ -493,8 +493,10 @@ save_file(const struct PoEntry* entries, const size_t real_msgid_count, { char msgid[MAXMSG]; unicode_string_to_u8(msgid, current->msgid, MAXMSG); - size_t num_lines = u32_lines_in_string(current->msgid); - if (num_lines > 1) + size_t actual_lines = 0; + size_t num_lines = u32_lines_in_string(current->msgid, + &actual_lines); + if (actual_lines > 1) { struct BufferLine* msgid_split = split( current->msgid); @@ -541,9 +543,10 @@ save_file(const struct PoEntry* entries, const size_t real_msgid_count, char msgid_plural[MAXMSG]; unicode_string_to_u8(msgid_plural, current->msgid_plural, MAXMSG); + size_t actual_lines = 0; size_t num_lines = u32_lines_in_string( - current->msgid_plural); - if (num_lines > 1) + current->msgid_plural, &actual_lines); + if (actual_lines > 1) { struct BufferLine* msgid_split = split( current->msgid_plural); @@ -587,9 +590,10 @@ save_file(const struct PoEntry* entries, const size_t real_msgid_count, if (current->msgstr_count == 1) { + size_t actual_lines = 0; size_t num_lines = u32_lines_in_string( - *current->msgstr); - if (num_lines > 1) + *current->msgstr, &actual_lines); + if (actual_lines > 1) { int first_entry = current == entries && !current->msgid; @@ -669,9 +673,11 @@ save_file(const struct PoEntry* entries, const size_t real_msgid_count, { for (size_t m = 0; m < current->msgstr_count; m++) { + size_t actual_lines = 0; size_t num_lines = u32_lines_in_string( - *current->msgstr); - if (num_lines > 1) + *current->msgstr, + &actual_lines); + if (actual_lines > 1) { struct BufferLine* msgstr_split = split(*(current->msgstr + m)); diff --git a/poe.c b/poe.c @@ -173,9 +173,9 @@ load_info(struct DrawState* state) { struct PoEntry* first = &state->entries[0]; struct PoEntry* current = &state->entries[state->msgid_number-1]; - size_t msgid_num_lines = u32_lines_in_string(current->msgid); + size_t msgid_num_lines = u32_lines_in_string(current->msgid, NULL); size_t msgid_plural_num_lines = u32_lines_in_string( - current->msgid_plural); + current->msgid_plural, NULL); size_t num_lines = 0; struct BufferLine* newbuf = NULL; struct BufferLine* pnewbuf = NULL; @@ -361,7 +361,8 @@ load_msgstr(struct DrawState* state) int msgstr_index = state->msgstr_index; struct PoEntry* current = &state->entries[state->msgid_number-1]; size_t num_lines = current->msgstr_count == 0 ? 1 - : u32_lines_in_string(*(current->msgstr+msgstr_index)); + : u32_lines_in_string(*(current->msgstr+msgstr_index), + NULL); struct BufferLine* newbuf = NULL; struct BufferLine* pnewbuf = NULL; @@ -790,7 +791,7 @@ copy_msgid_to_input(struct DrawState* state) if (state->edit_info_focused) return state; struct PoEntry* current = &state->entries[state->msgid_number-1]; - size_t msgid_num_lines = u32_lines_in_string(current->msgid); + size_t msgid_num_lines = u32_lines_in_string(current->msgid, NULL); size_t lines_to_init = state->input_rows_count < msgid_num_lines ? msgid_num_lines - state->input_rows_count : 0; size_t lines_to_free = state->input_rows_count > msgid_num_lines diff --git a/test/sr.po b/test/sr.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: neomutt 20210205\n" "Report-Msgid-Bugs-To: neomutt-devel@neomutt.org\n" "POT-Creation-Date: 2021-06-19 23:57+0100\n" -"PO-Revision-Date: 2021-07-11 20:17+0200\n" +"PO-Revision-Date: 2021-07-12 16:46+0200\n" "Last-Translator: Страхиња Радић <contact@strahinja.org>\n" "Language-Team: Serbian <sr@li.org>\n" "Language: sr\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: poe v0.5-alpha-8-g4cd6e1a\n" +"X-Generator: poe v0.5-alpha-12-gf812d1c\n" #. L10N: prompt to add a new alias #: alias/alias.c:397 @@ -37,7 +37,8 @@ msgstr "Упозорење: Овај назив алијаса можда нећ msgid "Address: " msgstr "Адреса: " -#: alias/alias.c:451 commands.c:478 compose/compose.c:491 conn/raw.c:151 conn/raw.c:208 recvcmd.c:228 send/send.c:207 +#: alias/alias.c:451 commands.c:478 compose/compose.c:491 conn/raw.c:151 +#: conn/raw.c:208 recvcmd.c:228 send/send.c:207 #, c-format msgid "Bad IDN: '%s'" msgstr "Лош IDN: „%s“" @@ -54,7 +55,8 @@ msgstr "Коментар: " msgid "Accept?" msgstr "Прихватити?" -#: alias/alias.c:500 recvattach.c:624 recvattach.c:647 recvattach.c:662 recvattach.c:678 recvattach.c:782 +#: alias/alias.c:500 recvattach.c:624 recvattach.c:647 recvattach.c:662 +#: recvattach.c:678 recvattach.c:782 msgid "Save to file: " msgstr "Чување у датотеку: " @@ -88,17 +90,21 @@ msgstr "Упозорење: Лоша адреса „%s“ у алијасу „ msgid "Warning: Bad IDN '%s' in alias '%s'" msgstr "Упозорење: Лош IDN ‘%s’ у алијасу ‘%s’" -#: alias/dlgalias.c:55 alias/dlgquery.c:61 autocrypt/dlgautocrypt.c:60 browser.c:72 browser.c:85 conn/dlgverifycert.c:43 history/dlghistory.c:44 -#: ncrypt/dlggpgme.c:64 ncrypt/dlgpgp.c:59 ncrypt/dlgsmime.c:46 pager/dlg_pager.c:178 pager/dlg_pager.c:189 pager/dlg_pager.c:199 +#: alias/dlgalias.c:55 alias/dlgquery.c:61 autocrypt/dlgautocrypt.c:60 +#: browser.c:72 browser.c:85 conn/dlgverifycert.c:43 history/dlghistory.c:44 +#: ncrypt/dlggpgme.c:64 ncrypt/dlgpgp.c:59 ncrypt/dlgsmime.c:46 +#: pager/dlg_pager.c:178 pager/dlg_pager.c:189 pager/dlg_pager.c:199 #: pager/dlg_pager.c:215 pattern/dlgpattern.c:60 postpone.c:66 recvattach.c:72 msgid "Exit" msgstr "Излаз" -#: alias/dlgalias.c:56 index/dlg_index.c:112 index/dlg_index.c:128 pager/dlg_pager.c:203 pager/dlg_pager.c:220 postpone.c:67 +#: alias/dlgalias.c:56 index/dlg_index.c:112 index/dlg_index.c:128 +#: pager/dlg_pager.c:203 pager/dlg_pager.c:220 postpone.c:67 msgid "Del" msgstr "Бриши" -#: alias/dlgalias.c:57 index/dlg_index.c:113 index/dlg_index.c:129 postpone.c:68 +#: alias/dlgalias.c:57 index/dlg_index.c:113 index/dlg_index.c:129 +#: postpone.c:68 msgid "Undel" msgstr "Од-обриши" @@ -110,13 +116,17 @@ msgstr "Сорт" msgid "Rev-Sort" msgstr "Обр-сорт" -#: alias/dlgalias.c:60 history/dlghistory.c:45 ncrypt/dlggpgme.c:65 ncrypt/dlgpgp.c:60 ncrypt/dlgsmime.c:47 pattern/dlgpattern.c:61 +#: alias/dlgalias.c:60 history/dlghistory.c:45 ncrypt/dlggpgme.c:65 +#: ncrypt/dlgpgp.c:60 ncrypt/dlgsmime.c:47 pattern/dlgpattern.c:61 msgid "Select" msgstr "Избор" -#: alias/dlgalias.c:61 alias/dlgquery.c:68 autocrypt/dlgautocrypt.c:79 browser.c:76 browser.c:91 compose/compose.c:154 compose/compose.c:169 -#: conn/dlgverifycert.c:44 history/dlghistory.c:47 index/dlg_index.c:118 index/dlg_index.c:134 ncrypt/dlggpgme.c:67 ncrypt/dlgpgp.c:62 -#: ncrypt/dlgsmime.c:48 pager/dlg_pager.c:181 pager/dlg_pager.c:206 pager/dlg_pager.c:222 pattern/dlgpattern.c:62 postpone.c:69 recvattach.c:76 +#: alias/dlgalias.c:61 alias/dlgquery.c:68 autocrypt/dlgautocrypt.c:79 +#: browser.c:76 browser.c:91 compose/compose.c:154 compose/compose.c:169 +#: conn/dlgverifycert.c:44 history/dlghistory.c:47 index/dlg_index.c:118 +#: index/dlg_index.c:134 ncrypt/dlggpgme.c:67 ncrypt/dlgpgp.c:62 +#: ncrypt/dlgsmime.c:48 pager/dlg_pager.c:181 pager/dlg_pager.c:206 +#: pager/dlg_pager.c:222 pattern/dlgpattern.c:62 postpone.c:69 recvattach.c:76 msgid "Help" msgstr "Помоћ" @@ -167,7 +177,8 @@ msgstr "Search" msgid "Waiting for response..." msgstr "Чекање на одговор..." -#: alias/dlgquery.c:354 alias/dlgquery.c:396 alias/dlgquery.c:413 alias/dlgquery.c:701 +#: alias/dlgquery.c:354 alias/dlgquery.c:396 alias/dlgquery.c:413 +#: alias/dlgquery.c:701 msgid "Query: " msgstr "Упит: " @@ -215,7 +226,8 @@ msgstr "%s не постоји. Да га креирам?" #. L10N: mkdir() on the directory %s failed. The second %s is the #. error message returned by libc -#: autocrypt/autocrypt.c:82 bcache/bcache.c:228 hcache/hcache.c:233 main.c:821 nntp/newsrc.c:1104 +#: autocrypt/autocrypt.c:82 bcache/bcache.c:228 hcache/hcache.c:233 main.c:821 +#: nntp/newsrc.c:1104 #, c-format msgid "Can't create %s: %s" msgstr "Не могу да креирам %s: %s" @@ -271,7 +283,8 @@ msgstr "Неуспешно креирање налога за аутошифро #. L10N: Error displayed if the user tries to force sending an Autocrypt #. email when the engine is not available. -#: autocrypt/autocrypt.c:594 autocrypt/autocrypt.c:603 autocrypt/autocrypt.c:610 +#: autocrypt/autocrypt.c:594 autocrypt/autocrypt.c:603 +#: autocrypt/autocrypt.c:610 msgid "Autocrypt is not available" msgstr "Аутошифровање није доступно" @@ -653,15 +666,18 @@ msgstr[0] "source: %d упозорење у %s" msgstr[1] "source: %d упозорења у %s" msgstr[2] "source: %d упозорења у %s" -#: command_parse.c:298 command_parse.c:320 command_parse.c:465 command_parse.c:1053 command_parse.c:1137 gui/color.c:736 gui/color.c:899 -#: gui/color.c:1106 gui/color.c:1135 gui/color.c:1159 gui/color.c:1226 gui/color.c:1249 hook.c:112 hook.c:121 hook.c:135 hook.c:390 hook.c:406 +#: command_parse.c:298 command_parse.c:320 command_parse.c:465 +#: command_parse.c:1053 command_parse.c:1137 gui/color.c:736 gui/color.c:899 +#: gui/color.c:1106 gui/color.c:1135 gui/color.c:1159 gui/color.c:1226 +#: gui/color.c:1249 hook.c:112 hook.c:121 hook.c:135 hook.c:390 hook.c:406 #: keymap.c:1277 score.c:96 subjectrx.c:73 subjectrx.c:101 subjectrx.c:109 #, c-format msgid "%s: too few arguments" msgstr "%s: премало аргумената" -#: command_parse.c:344 command_parse.c:1327 command_parse.c:1657 gui/color.c:1258 gui/color.c:1364 hook.c:142 hook.c:413 keymap.c:1209 keymap.c:1382 -#: keymap.c:1543 keymap.c:1624 mutt_lua.c:498 score.c:104 +#: command_parse.c:344 command_parse.c:1327 command_parse.c:1657 +#: gui/color.c:1258 gui/color.c:1364 hook.c:142 hook.c:413 keymap.c:1209 +#: keymap.c:1382 keymap.c:1543 keymap.c:1624 mutt_lua.c:498 score.c:104 #, c-format msgid "%s: too many arguments" msgstr "%s: превише аргумената" @@ -723,12 +739,12 @@ msgstr "Не може се користити префикс при постав #: command_parse.c:828 msgid "Prefixes 'no' and 'inv' may only be used with bool/quad variables" -msgstr "Префикси „no“ и „inv“ се могу користити само са bool/quad променљивама" +msgstr "Префикси „no“ и „inv“ се могу користити само са bool/quad променљивим" #: command_parse.c:833 #, c-format msgid "Command '%s' can only be used with bool/quad variables" -msgstr "Наредба „%s“ се може користити само са bool/quad променљивама" +msgstr "Наредба „%s“ се може користити само са bool/quad променљивим" #: command_parse.c:1116 #, c-format @@ -817,8 +833,10 @@ msgstr "PGP потпис успешно верификован" msgid "PGP signature could NOT be verified" msgstr "PGP потпис није било могуће верификовати" -#: commands.c:404 compmbox/compress.c:338 compose/compose.c:1877 gui/curs_lib.c:389 index/dlg_index.c:1266 index/dlg_index.c:1319 mutt_attach.c:162 -#: mutt_attach.c:296 pager/dlg_pager.c:2662 pager/do_pager.c:136 send/sendlib.c:1062 +#: commands.c:404 compmbox/compress.c:338 compose/compose.c:1877 +#: gui/curs_lib.c:389 index/dlg_index.c:1266 index/dlg_index.c:1319 +#: mutt_attach.c:162 mutt_attach.c:296 pager/dlg_pager.c:2662 +#: pager/do_pager.c:136 send/sendlib.c:1062 #, c-format msgid "Error running \"%s\"" msgstr "Грешка приликом покретања „%s“" @@ -1031,7 +1049,8 @@ msgstr "Скуп знакова промењен у %s; конвертоваће msgid "Can't append without an append-hook or close-hook : %s" msgstr "Не може се дописати на крај без append-hook или close-hook: %s" -#: compmbox/compress.c:454 compmbox/compress.c:518 compmbox/compress.c:594 compmbox/compress.c:632 mbox/mbox.c:1188 +#: compmbox/compress.c:454 compmbox/compress.c:518 compmbox/compress.c:594 +#: compmbox/compress.c:632 mbox/mbox.c:1188 msgid "Unable to lock mailbox" msgstr "Не може се закључати сандуче" @@ -1127,7 +1146,8 @@ msgstr "Безбедност: " #. other compose menu fields. However, if possible, it should not be longer #. than the other compose menu fields. Since it shares the row with "Encrypt #. with:", it should not be longer than 15-20 character cells. -#: compose/compose.c:125 ncrypt/crypt_gpgme.c:4277 ncrypt/pgp.c:1995 ncrypt/smime.c:2220 +#: compose/compose.c:125 ncrypt/crypt_gpgme.c:4277 ncrypt/pgp.c:1995 +#: ncrypt/smime.c:2220 msgid "Sign as: " msgstr "Потписати као: " @@ -1337,7 +1357,8 @@ msgid "Rename to: " msgstr "Преименовати у: " #. L10N: "stat" is a system call. Do "man 2 stat" for more information. -#: compose/compose.c:1683 editmsg.c:99 editmsg.c:133 editmsg.c:152 notmuch/db.c:96 send/sendlib.c:485 +#: compose/compose.c:1683 editmsg.c:99 editmsg.c:133 editmsg.c:152 +#: notmuch/db.c:96 send/sendlib.c:485 #, c-format msgid "Can't stat %s: %s" msgstr "Не може се stat-овати %s: %s" @@ -1505,7 +1526,8 @@ msgstr "Неисправна boolean вредност: %ld" msgid "'charset' must contain exactly one character set name" msgstr "„charset“ мора садржати тачно један назив скупа знакова" -#: config/charset.c:66 hcache/config.c:53 hcache/config.c:72 hcache/config.c:94 mutt_config.c:126 +#: config/charset.c:66 hcache/config.c:53 hcache/config.c:72 hcache/config.c:94 +#: mutt_config.c:126 #, c-format msgid "Invalid value for option %s: %s" msgstr "Неисправна вредност опције %s: %s" @@ -1520,7 +1542,8 @@ msgstr "Неисправна enum вредност: %s" msgid "Invalid enum value: %ld" msgstr "Неисправна enum вредност: %ld" -#: config/long.c:47 config/number.c:48 config/path.c:93 config/path.c:166 config/sort.c:54 config/string.c:65 config/string.c:139 +#: config/long.c:47 config/number.c:48 config/path.c:93 config/path.c:166 +#: config/sort.c:54 config/string.c:65 config/string.c:139 #, c-format msgid "Option %s may not be empty" msgstr "Опција %s не може бити празна" @@ -1530,7 +1553,8 @@ msgstr "Опција %s не може бити празна" msgid "Invalid long: %s" msgstr "Неисправан long: %s" -#: config/long.c:60 config/long.c:112 config/long.c:157 config/long.c:193 config/number.c:67 config/number.c:126 config/number.c:177 +#: config/long.c:60 config/long.c:112 config/long.c:157 config/long.c:193 +#: config/number.c:67 config/number.c:126 config/number.c:177 #: config/number.c:216 #, c-format msgid "Option %s may not be negative" @@ -1571,7 +1595,8 @@ msgstr "Непостојећа променљива: %s" msgid "Variable '%s' has an invalid type %d" msgstr "Променљива „%s“ има неисправан тип %d" -#: config/set.c:401 config/set.c:467 config/set.c:528 config/set.c:604 config/set.c:670 config/set.c:746 config/set.c:926 config/set.c:1009 +#: config/set.c:401 config/set.c:467 config/set.c:528 config/set.c:604 +#: config/set.c:670 config/set.c:746 config/set.c:926 config/set.c:1009 #, c-format msgid "Unknown variable '%s'" msgstr "Непозната променљива „%s“" @@ -1982,8 +2007,9 @@ msgstr "Не може се дописати у фолдер: %s" msgid "multipart message has no boundary parameter" msgstr "порука са више делова нема параметар границе" -#: flags.c:383 index/dlg_index.c:2722 index/dlg_index.c:2767 index/dlg_index.c:3343 index/dlg_index.c:3384 mutt_thread.c:1143 mutt_thread.c:1210 -#: mutt_thread.c:1296 +#: flags.c:383 index/dlg_index.c:2722 index/dlg_index.c:2767 +#: index/dlg_index.c:3343 index/dlg_index.c:3384 mutt_thread.c:1143 +#: mutt_thread.c:1210 mutt_thread.c:1296 msgid "Threading is not enabled" msgstr "Нити нису омогућене" @@ -2099,7 +2125,8 @@ msgstr "" msgid "Invoking autoview command: %s" msgstr "Покретање наредбе за аутопреглед: %s" -#: handler.c:585 mutt_attach.c:546 mutt_attach.c:748 mutt_attach.c:1162 mutt_attach.c:1230 ncrypt/dlgpgp.c:617 ncrypt/pgpkey.c:278 +#: handler.c:585 mutt_attach.c:546 mutt_attach.c:748 mutt_attach.c:1162 +#: mutt_attach.c:1230 ncrypt/dlgpgp.c:617 ncrypt/pgpkey.c:278 msgid "Can't create filter" msgstr "Не може се креирати филтер" @@ -2373,13 +2400,19 @@ msgstr "Историја „%s“" msgid "Bad history file format (line %d)" msgstr "Лош формат датотеке историје (ред %d)" -#: history/history.c:261 ncrypt/crypt_gpgme.c:818 ncrypt/crypt_gpgme.c:2249 ncrypt/crypt_gpgme.c:2269 ncrypt/crypt_gpgme.c:2328 -#: ncrypt/crypt_gpgme.c:2345 ncrypt/crypt_gpgme.c:2377 ncrypt/crypt_gpgme.c:2395 ncrypt/crypt_gpgme.c:2480 ncrypt/crypt_gpgme.c:3071 -#: ncrypt/crypt_gpgme.c:3171 ncrypt/dlggpgme.c:847 ncrypt/dlgpgp.c:600 ncrypt/pgp.c:578 ncrypt/pgp.c:585 ncrypt/pgp.c:901 ncrypt/pgp.c:1019 -#: ncrypt/pgp.c:1168 ncrypt/pgp.c:1188 ncrypt/pgp.c:1222 ncrypt/pgp.c:1581 ncrypt/pgpkey.c:260 ncrypt/pgpmicalg.c:191 ncrypt/smime.c:883 -#: ncrypt/smime.c:891 ncrypt/smime.c:984 ncrypt/smime.c:1096 ncrypt/smime.c:1164 ncrypt/smime.c:1172 ncrypt/smime.c:1380 ncrypt/smime.c:1791 -#: ncrypt/smime.c:1869 ncrypt/smime.c:1876 ncrypt/smime.c:1980 ncrypt/smime.c:2104 ncrypt/smime.c:2120 nntp/nntp.c:1296 nntp/nntp.c:2151 -#: pattern/exec.c:150 pop/pop.c:121 +#: history/history.c:261 ncrypt/crypt_gpgme.c:818 ncrypt/crypt_gpgme.c:2249 +#: ncrypt/crypt_gpgme.c:2269 ncrypt/crypt_gpgme.c:2328 +#: ncrypt/crypt_gpgme.c:2345 ncrypt/crypt_gpgme.c:2377 +#: ncrypt/crypt_gpgme.c:2395 ncrypt/crypt_gpgme.c:2480 +#: ncrypt/crypt_gpgme.c:3071 ncrypt/crypt_gpgme.c:3171 ncrypt/dlggpgme.c:847 +#: ncrypt/dlgpgp.c:600 ncrypt/pgp.c:578 ncrypt/pgp.c:585 ncrypt/pgp.c:901 +#: ncrypt/pgp.c:1019 ncrypt/pgp.c:1168 ncrypt/pgp.c:1188 ncrypt/pgp.c:1222 +#: ncrypt/pgp.c:1581 ncrypt/pgpkey.c:260 ncrypt/pgpmicalg.c:191 +#: ncrypt/smime.c:883 ncrypt/smime.c:891 ncrypt/smime.c:984 ncrypt/smime.c:1096 +#: ncrypt/smime.c:1164 ncrypt/smime.c:1172 ncrypt/smime.c:1380 +#: ncrypt/smime.c:1791 ncrypt/smime.c:1869 ncrypt/smime.c:1876 +#: ncrypt/smime.c:1980 ncrypt/smime.c:2104 ncrypt/smime.c:2120 nntp/nntp.c:1296 +#: nntp/nntp.c:2151 pattern/exec.c:150 pop/pop.c:121 msgid "Can't create temporary file" msgstr "Не може се креирати привремена датотека" @@ -2428,7 +2461,8 @@ msgid "%s: no macros for this menu" msgstr "%s: нема макроа за овај мени" #. L10N: '%s' is the file name of the temporary file -#: icommands.c:285 icommands.c:306 icommands.c:332 icommands.c:370 icommands.c:389 imap/message.c:1115 +#: icommands.c:285 icommands.c:306 icommands.c:332 icommands.c:370 +#: icommands.c:389 imap/message.c:1115 #, c-format msgid "Could not create temporary file %s" msgstr "Не може се креирати привремена датотека %s" @@ -2438,14 +2472,16 @@ msgid "No authenticators available or wrong credentials" msgstr "Нема доступних аутентификатора или су овлашћења погрешна" #. L10N: (%s) is the method name, e.g. Anonymous, CRAM-MD5, GSSAPI, SASL -#: imap/auth_anon.c:56 imap/auth_cram.c:106 imap/auth_gss.c:168 imap/auth_oauth.c:66 imap/auth_sasl.c:125 nntp/nntp.c:503 nntp/nntp.c:569 +#: imap/auth_anon.c:56 imap/auth_cram.c:106 imap/auth_gss.c:168 +#: imap/auth_oauth.c:66 imap/auth_sasl.c:125 nntp/nntp.c:503 nntp/nntp.c:569 #: pop/auth.c:98 pop/auth.c:243 pop/auth.c:339 send/smtp.c:470 send/smtp.c:556 #, c-format msgid "Authenticating (%s)..." msgstr "Аутентификовање (%s)..." #. L10N: %s is the method name, e.g. Anonymous, CRAM-MD5, GSSAPI, SASL -#: imap/auth_anon.c:89 imap/auth_cram.c:180 imap/auth_gss.c:347 imap/auth_oauth.c:99 imap/auth_sasl.c:257 nntp/nntp.c:664 pop/auth.c:196 +#: imap/auth_anon.c:89 imap/auth_cram.c:180 imap/auth_gss.c:347 +#: imap/auth_oauth.c:99 imap/auth_sasl.c:257 nntp/nntp.c:664 pop/auth.c:196 #: pop/auth.c:264 send/smtp.c:621 send/smtp.c:695 send/smtp.c:784 #, c-format msgid "%s authentication failed" @@ -2677,7 +2713,8 @@ msgstr "Добављање поруке..." msgid "The message index is incorrect. Try reopening the mailbox." msgstr "Индекс порука није исправан. Покушајте да поново отворите сандуче." -#: imap/msn.c:47 mutt/memory.c:58 mutt/memory.c:98 mutt/memory.c:134 mutt/string.c:1112 mx.c:1218 +#: imap/msn.c:47 mutt/memory.c:58 mutt/memory.c:98 mutt/memory.c:134 +#: mutt/string.c:1112 mx.c:1218 msgid "Out of memory" msgstr "Нема меморије" @@ -3002,11 +3039,13 @@ msgstr "Нема непрочитаних порука у овом ограни msgid "No unread messages" msgstr "Нема непрочитаних порука" -#: index/dlg_index.c:3086 menu/menu.c:190 pager/dlg_pager.c:2894 pattern/pattern.c:580 pattern/pattern.c:736 +#: index/dlg_index.c:3086 menu/menu.c:190 pager/dlg_pager.c:2894 +#: pattern/pattern.c:580 pattern/pattern.c:736 msgid "Search wrapped to top" msgstr "Претрага се вратила на почетак" -#: index/dlg_index.c:3091 pager/dlg_pager.c:2921 pattern/pattern.c:591 pattern/pattern.c:747 +#: index/dlg_index.c:3091 pager/dlg_pager.c:2921 pattern/pattern.c:591 +#: pattern/pattern.c:747 msgid "Search wrapped to bottom" msgstr "Претрага се вратила на дно" @@ -3098,7 +3137,8 @@ msgstr "Нема Message-ID-а за макро" msgid "Reply by mail as poster prefers?" msgstr "Одговорити мејлом, као што постављач преферира?" -#: index/dlg_index.c:3967 pager/dlg_pager.c:3595 pager/dlg_pager.c:3620 pager/dlg_pager.c:3668 +#: index/dlg_index.c:3967 pager/dlg_pager.c:3595 pager/dlg_pager.c:3620 +#: pager/dlg_pager.c:3668 msgid "Posting to this group not allowed, may be moderated. Continue?" msgstr "Постављање у ову групу није дозвољено, можда је модерисана. Наставити?" @@ -3231,13 +3271,15 @@ msgstr "maildir_commit_message(): не може се поставити врем msgid "Scanning %s..." msgstr "Скенирање %s..." -#: maildir/maildir.c:702 maildir/mh.c:719 mbox/mbox.c:213 mbox/mbox.c:381 mx.c:372 +#: maildir/maildir.c:702 maildir/mh.c:719 mbox/mbox.c:213 mbox/mbox.c:381 +#: mx.c:372 #, c-format msgid "Reading %s..." msgstr "Читање %s..." #. L10N: Displayed before/as a mailbox is being synced -#: maildir/maildir.c:1389 maildir/mh.c:1045 mbox/mbox.c:1257 mx.c:479 notmuch/notmuch.c:2215 +#: maildir/maildir.c:1389 maildir/mh.c:1045 mbox/mbox.c:1257 mx.c:479 +#: notmuch/notmuch.c:2215 #, c-format msgid "Writing %s..." msgstr "Писање %s..." @@ -3571,8 +3613,9 @@ msgstr "Не може се поново отворити сандуче" msgid "Can't write message" msgstr "Не може се исписати порука" -#: menu/menu.c:66 menu/menu.c:481 menu/move.c:51 menu/move.c:105 menu/move.c:177 menu/move.c:195 menu/move.c:213 menu/move.c:229 menu/move.c:262 -#: menu/move.c:277 menu/move.c:310 +#: menu/menu.c:66 menu/menu.c:481 menu/move.c:51 menu/move.c:105 +#: menu/move.c:177 menu/move.c:195 menu/move.c:213 menu/move.c:229 +#: menu/move.c:262 menu/move.c:277 menu/move.c:310 msgid "No entries" msgstr "Нема уноса" @@ -3584,15 +3627,18 @@ msgstr "Скочи на: " msgid "Invalid index number" msgstr "Неисправан број индекса" -#: menu/menu.c:154 pager/dlg_pager.c:2945 pattern/pattern.c:506 pattern/pattern.c:664 +#: menu/menu.c:154 pager/dlg_pager.c:2945 pattern/pattern.c:506 +#: pattern/pattern.c:664 msgid "Search for: " msgstr "Тражи: " -#: menu/menu.c:155 pager/dlg_pager.c:2946 pattern/pattern.c:506 pattern/pattern.c:664 +#: menu/menu.c:155 pager/dlg_pager.c:2946 pattern/pattern.c:506 +#: pattern/pattern.c:664 msgid "Reverse search for: " msgstr "Тражи уназад: " -#: menu/menu.c:209 pager/dlg_pager.c:2891 pager/dlg_pager.c:2918 pager/dlg_pager.c:3055 pattern/pattern.c:638 pattern/pattern.c:794 +#: menu/menu.c:209 pager/dlg_pager.c:2891 pager/dlg_pager.c:2918 +#: pager/dlg_pager.c:3055 pattern/pattern.c:638 pattern/pattern.c:794 msgid "Not found" msgstr "Није пронађено" @@ -3995,7 +4041,8 @@ msgstr "Убачени PGP се не може користити са format=flo msgid "Mail not sent: inline PGP can't be used with format=flowed" msgstr "Порука није послата: убачени PGP се не може користити са format=flowed" -#: ncrypt/crypt.c:220 ncrypt/cryptglue.c:161 ncrypt/dlgpgp.c:606 ncrypt/pgpkey.c:273 +#: ncrypt/crypt.c:220 ncrypt/cryptglue.c:161 ncrypt/dlgpgp.c:606 +#: ncrypt/pgpkey.c:273 msgid "Invoking PGP..." msgstr "Покрећем PGP..." @@ -4081,7 +4128,8 @@ msgstr "грешка приликом омогућавања CMS протоко msgid "error creating GPGME data object: %s" msgstr "грешка приликом креирања GPGME објекта са подацима: %s" -#: ncrypt/crypt_gpgme.c:719 ncrypt/crypt_gpgme.c:746 ncrypt/crypt_gpgme.c:1922 ncrypt/crypt_gpgme.c:2684 +#: ncrypt/crypt_gpgme.c:719 ncrypt/crypt_gpgme.c:746 ncrypt/crypt_gpgme.c:1922 +#: ncrypt/crypt_gpgme.c:2684 #, c-format msgid "error allocating data object: %s" msgstr "грешка приликом алоцирања објекта са подацима: %s" @@ -4262,7 +4310,8 @@ msgstr "Проблематичан потпис од:" msgid " expires: " msgstr " истиче: " -#: ncrypt/crypt_gpgme.c:1929 ncrypt/crypt_gpgme.c:2162 ncrypt/crypt_gpgme.c:2956 +#: ncrypt/crypt_gpgme.c:1929 ncrypt/crypt_gpgme.c:2162 +#: ncrypt/crypt_gpgme.c:2956 msgid "" "[-- Begin signature information --]\n" msgstr "" @@ -4288,7 +4337,8 @@ msgid "" msgstr "" "*** Крај нотације ***\n" -#: ncrypt/crypt_gpgme.c:2018 ncrypt/crypt_gpgme.c:2176 ncrypt/crypt_gpgme.c:2966 +#: ncrypt/crypt_gpgme.c:2018 ncrypt/crypt_gpgme.c:2176 +#: ncrypt/crypt_gpgme.c:2966 msgid "" "[-- End signature information --]\n" "\n" @@ -4317,7 +4367,8 @@ msgid "" msgstr "" "Грешка: неуспешно дешифровање/верификација: %s\n" -#: ncrypt/crypt_gpgme.c:2937 ncrypt/crypt_gpgme.c:3136 ncrypt/pgp.c:731 ncrypt/pgp.c:1281 +#: ncrypt/crypt_gpgme.c:2937 ncrypt/crypt_gpgme.c:3136 ncrypt/pgp.c:731 +#: ncrypt/pgp.c:1281 msgid "PGP message successfully decrypted" msgstr "PGP порука успешно дешифрована" @@ -4409,7 +4460,8 @@ msgid "" msgstr "" "[-- Крај података шифрованих преко PGP/MIME-а --]\n" -#: ncrypt/crypt_gpgme.c:3144 ncrypt/pgp.c:669 ncrypt/pgp.c:722 ncrypt/pgp.c:1285 postpone.c:687 +#: ncrypt/crypt_gpgme.c:3144 ncrypt/pgp.c:669 ncrypt/pgp.c:722 +#: ncrypt/pgp.c:1285 postpone.c:687 msgid "Could not decrypt PGP message" msgstr "Дешифровање PGP поруке није могуће" @@ -4446,12 +4498,14 @@ msgstr "" msgid "gpgme_op_keylist_start failed: %s" msgstr "gpgme_op_keylist_start је неуспешно: %s" -#: ncrypt/crypt_gpgme.c:3460 ncrypt/crypt_gpgme.c:3511 ncrypt/crypt_gpgme.c:4028 +#: ncrypt/crypt_gpgme.c:3460 ncrypt/crypt_gpgme.c:3511 +#: ncrypt/crypt_gpgme.c:4028 #, c-format msgid "gpgme_op_keylist_next failed: %s" msgstr "gpgme_op_keylist_next је неуспешно: %s" -#: ncrypt/crypt_gpgme.c:3578 ncrypt/crypt_gpgme.c:3693 ncrypt/pgpkey.c:377 ncrypt/pgpkey.c:506 +#: ncrypt/crypt_gpgme.c:3578 ncrypt/crypt_gpgme.c:3693 ncrypt/pgpkey.c:377 +#: ncrypt/pgpkey.c:506 #, c-format msgid "Looking for keys matching \"%s\"..." msgstr "Траже се кључеви који одговарају „%s“..." @@ -4466,7 +4520,8 @@ msgstr "Нису пронађени кључеви који одговарају msgid "Use keyID = \"%s\" for %s?" msgstr "Користити keyID = \"%s\" за %s?" -#: ncrypt/crypt_gpgme.c:3910 ncrypt/pgp.c:1517 ncrypt/smime.c:754 ncrypt/smime.c:840 +#: ncrypt/crypt_gpgme.c:3910 ncrypt/pgp.c:1517 ncrypt/smime.c:754 +#: ncrypt/smime.c:840 #, c-format msgid "Enter keyID for %s: " msgstr "Унесите ИБкључа за %s: " @@ -4646,7 +4701,8 @@ msgstr[2] "" msgid "encryption" msgstr "шифровање" -#: ncrypt/dlggpgme.c:674 ncrypt/dlggpgme.c:680 ncrypt/dlggpgme.c:814 ncrypt/dlggpgme.c:819 +#: ncrypt/dlggpgme.c:674 ncrypt/dlggpgme.c:680 ncrypt/dlggpgme.c:814 +#: ncrypt/dlggpgme.c:819 msgid ", " msgstr ", " @@ -4878,7 +4934,8 @@ msgstr "" "[-- Грешка: не може се креирати PGP потпроцес --]\n" "\n" -#: ncrypt/pgp.c:1078 ncrypt/pgp.c:1105 ncrypt/smime.c:1967 postpone.c:797 postpone.c:825 +#: ncrypt/pgp.c:1078 ncrypt/pgp.c:1105 ncrypt/smime.c:1967 postpone.c:797 +#: postpone.c:825 msgid "Decryption failed" msgstr "Неуспешно дешифровање" @@ -4990,7 +5047,8 @@ msgstr "Унесите ИБкључа: " msgid "No (valid) certificate found for %s" msgstr "Није пронађен (исправан) сертификат за %s" -#: ncrypt/smime.c:901 ncrypt/smime.c:930 ncrypt/smime.c:1004 ncrypt/smime.c:1040 ncrypt/smime.c:1119 ncrypt/smime.c:1204 +#: ncrypt/smime.c:901 ncrypt/smime.c:930 ncrypt/smime.c:1004 +#: ncrypt/smime.c:1040 ncrypt/smime.c:1119 ncrypt/smime.c:1204 msgid "Error: unable to create OpenSSL subprocess" msgstr "Грешка: не може се креирати OpenSSL потпроцес" @@ -6347,11 +6405,13 @@ msgstr "празна операција" msgid "Not available in this menu" msgstr "Није доступно у овом менију" -#: pager/dlg_pager.c:179 pager/dlg_pager.c:190 pager/dlg_pager.c:200 pager/dlg_pager.c:216 +#: pager/dlg_pager.c:179 pager/dlg_pager.c:190 pager/dlg_pager.c:200 +#: pager/dlg_pager.c:216 msgid "PrevPg" msgstr "ПретСтр" -#: pager/dlg_pager.c:180 pager/dlg_pager.c:191 pager/dlg_pager.c:201 pager/dlg_pager.c:217 +#: pager/dlg_pager.c:180 pager/dlg_pager.c:191 pager/dlg_pager.c:201 +#: pager/dlg_pager.c:217 msgid "NextPg" msgstr "СледСтр" @@ -6375,11 +6435,13 @@ msgstr "све" msgid "end" msgstr "крај" -#: pager/dlg_pager.c:2762 pager/dlg_pager.c:2803 pager/dlg_pager.c:2848 pager/dlg_pager.c:3234 +#: pager/dlg_pager.c:2762 pager/dlg_pager.c:2803 pager/dlg_pager.c:2848 +#: pager/dlg_pager.c:3234 msgid "Bottom of message is shown" msgstr "Приказан је крај поруке" -#: pager/dlg_pager.c:2777 pager/dlg_pager.c:2812 pager/dlg_pager.c:2821 pager/dlg_pager.c:2834 +#: pager/dlg_pager.c:2777 pager/dlg_pager.c:2812 pager/dlg_pager.c:2821 +#: pager/dlg_pager.c:2834 msgid "Top of message is shown" msgstr "Приказан је почетак поруке" @@ -6810,7 +6872,8 @@ msgstr "прекинуте нити" msgid "IMAP custom server-side search for STRING" msgstr "Прилагођена IMAP претрага сервера за ниском НИСКА" -#: pattern/pattern.c:260 pattern/pattern.c:366 pattern/pattern.c:533 pattern/pattern.c:689 +#: pattern/pattern.c:260 pattern/pattern.c:366 pattern/pattern.c:533 +#: pattern/pattern.c:689 msgid "Compiling search pattern..." msgstr "Компајлирање шеме за претрагу..." diff --git a/util.c b/util.c @@ -236,10 +236,14 @@ u32_line_length(const uint32_t* s) return len; } +/* actual_lines - doesn't take into account empty lines + * */ size_t -u8_lines_in_string(const char* s) +u8_lines_in_string(const char* s, size_t* actual_lines) { size_t result = 1; + if (actual_lines) + *actual_lines = 1; const char* ps = s; if (!s) return result; @@ -248,6 +252,15 @@ u8_lines_in_string(const char* s) if (*ps == '\\' && *(ps+1) == 'n') { result++; + if (actual_lines) + { + (*actual_lines)++; + if (*ps && *(ps+1) && + (!*(ps+2) || + (*(ps+2) == '\\' && + *(ps+3) == 'n'))) + (*actual_lines)--; + } ps++; } ps++; @@ -255,10 +268,14 @@ u8_lines_in_string(const char* s) return result; } +/* actual_lines - doesn't take into account empty lines + * */ size_t -u32_lines_in_string(const uint32_t* s) +u32_lines_in_string(const uint32_t* s, size_t* actual_lines) { size_t result = 1; + if (actual_lines) + *actual_lines = 1; const uint32_t* ps = s; if (!s) return result; @@ -267,6 +284,15 @@ u32_lines_in_string(const uint32_t* s) if (*ps == '\\' && *(ps+1) == 'n') { result++; + if (actual_lines) + { + (*actual_lines)++; + if (*ps && *(ps+1) && + (!*(ps+2) || + (*(ps+2) == '\\' && + *(ps+3) == 'n'))) + (*actual_lines)--; + } ps++; } ps++; diff --git a/util.h b/util.h @@ -35,8 +35,8 @@ size_t u32_u8_strncpy(uint32_t* to, const char* from, size_t max); size_t u8_u32_strncpy(char* to, const uint32_t* from, size_t max); size_t u8_line_length(const char* s); size_t u32_line_length(const uint32_t* s); -size_t u8_lines_in_string(const char* s); -size_t u32_lines_in_string(const uint32_t* s); +size_t u8_lines_in_string(const char* s, size_t* actual_lines); +size_t u32_lines_in_string(const uint32_t* s, size_t* actual_lines); int starts_with(const char* s, const char* with); int u32_starts_with(const uint32_t* s, const uint32_t* with); const char* u8_basename(const char* path);