{"thread":{"id":"45154","subject":"[PATCH V2 0/2] Fix l10n","startedAt":"2017-02-16T17:07:25Z","lastAt":"2017-02-17T01:17:01Z","messageCount":6,"participants":["Maxim Moseychuk","Junio C Hamano","Unknown"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"311773","messageId":"20170216170713.10065-1-franchesko.salias.hudro.pedros@gmail.com","threadId":"45154","inReplyTo":null,"subject":"[PATCH V2 0/2] Fix l10n","fromName":"Maxim Moseychuk","fromEmail":"franchesko.salias.hudro.pedros@gmail.com","sentAt":"2017-02-16T17:07:11Z","receivedAt":"2017-02-16T17:07:25Z","isPatch":true,"sender":{"key":"franchesko.salias.hudro.pedros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3121341?v=4"},"body":"In some places static size buffers can't store formatted string.\nIf it be happen then git die.\n\nJonathan Tan: Thanks a lot for your help.\n\nMaxim Moseychuk (2):\n  bisect_next_all: convert xsnprintf to xstrfmt\n  stop_progress_msg: convert xsnprintf to xstrfmt\n\n bisect.c   | 9 +++++----\n progress.c | 9 +++------\n 2 files changed, 8 insertions(+), 10 deletions(-)\n\n--\n2.11.1\n\n"},{"id":"311774","messageId":"20170216170713.10065-2-franchesko.salias.hudro.pedros@gmail.com","threadId":"45154","inReplyTo":"20170216170713.10065-1-franchesko.salias.hudro.pedros@gmail.com","subject":"[PATCH V2 1/2] bisect_next_all: convert xsnprintf to xstrfmt","fromName":"Maxim Moseychuk","fromEmail":"franchesko.salias.hudro.pedros@gmail.com","sentAt":"2017-02-16T17:07:12Z","receivedAt":"2017-02-16T17:07:28Z","isPatch":true,"sender":{"key":"franchesko.salias.hudro.pedros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3121341?v=4"},"body":"Git can't run bisect between 2048+ commits if use russian translation.\nReproduce \"LANG=ru_RU.UTF8 git bisect start v4.9 v4.8\" on linux sources.\n\nDummy solution: just increase buffer size but is not safe.\nSize gettext string is a runtime value.\n\nSigned-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>\n---\n bisect.c | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 21bc6daa4..787543cad 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -940,7 +940,7 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \tstruct commit_list *tried;\n \tint reaches = 0, all = 0, nr, steps;\n \tconst unsigned char *bisect_rev;\n-\tchar steps_msg[32];\n+\tchar *steps_msg;\n \n \tread_bisect_terms(&term_bad, &term_good);\n \tif (read_bisect_refs())\n@@ -990,14 +990,15 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \n \tnr = all - reaches - 1;\n \tsteps = estimate_bisect_steps(all);\n-\txsnprintf(steps_msg, sizeof(steps_msg),\n-\t\t  Q_(\"(roughly %d step)\", \"(roughly %d steps)\", steps),\n-\t\t  steps);\n+\n+\tsteps_msg = xstrfmt(Q_(\"(roughly %d step)\", \"(roughly %d steps)\",\n+\t\t  steps), steps);\n \t/* TRANSLATORS: the last %s will be replaced with\n \t   \"(roughly %d steps)\" translation */\n \tprintf(Q_(\"Bisecting: %d revision left to test after this %s\\n\",\n \t\t  \"Bisecting: %d revisions left to test after this %s\\n\",\n \t\t  nr), nr, steps_msg);\n+\tfree(steps_msg);\n \n \treturn bisect_checkout(bisect_rev, no_checkout);\n }\n-- \n2.11.1\n\n"},{"id":"311775","messageId":"20170216170713.10065-3-franchesko.salias.hudro.pedros@gmail.com","threadId":"45154","inReplyTo":"20170216170713.10065-1-franchesko.salias.hudro.pedros@gmail.com","subject":"[PATCH V2 2/2] stop_progress_msg: convert xsnprintf to xstrfmt","fromName":"Maxim Moseychuk","fromEmail":"franchesko.salias.hudro.pedros@gmail.com","sentAt":"2017-02-16T17:07:13Z","receivedAt":"2017-02-16T17:07:31Z","isPatch":true,"sender":{"key":"franchesko.salias.hudro.pedros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3121341?v=4"},"body":"Replace local safe string buffer allocation by xstrfmt.\n\nSigned-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>\n---\n progress.c | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/progress.c b/progress.c\nindex 76a88c573..29d0dad58 100644\n--- a/progress.c\n+++ b/progress.c\n@@ -243,21 +243,18 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)\n \t*p_progress = NULL;\n \tif (progress->last_value != -1) {\n \t\t/* Force the last update */\n-\t\tchar buf[128], *bufp;\n-\t\tsize_t len = strlen(msg) + 5;\n+\t\tchar *bufp;\n \t\tstruct throughput *tp = progress->throughput;\n \n-\t\tbufp = (len < sizeof(buf)) ? buf : xmallocz(len);\n \t\tif (tp) {\n \t\t\tunsigned int rate = !tp->avg_misecs ? 0 :\n \t\t\t\t\ttp->avg_bytes / tp->avg_misecs;\n \t\t\tthroughput_string(&tp->display, tp->curr_total, rate);\n \t\t}\n \t\tprogress_update = 1;\n-\t\txsnprintf(bufp, len + 1, \", %s.\\n\", msg);\n+\t\tbufp = xstrfmt(\", %s.\\n\", msg);\n \t\tdisplay(progress, progress->last_value, bufp);\n-\t\tif (buf != bufp)\n-\t\t\tfree(bufp);\n+\t\tfree(bufp);\n \t}\n \tclear_progress_signal();\n \tif (progress->throughput)\n-- \n2.11.1\n\n"},{"id":"311830","messageId":"xmqq8tp5vhgk.fsf@gitster.mtv.corp.google.com","threadId":"45154","inReplyTo":"20170216170713.10065-1-franchesko.salias.hudro.pedros@gmail.com","subject":"Re: [PATCH V2 0/2] Fix l10n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-02-16T23:33:47Z","receivedAt":"2017-02-16T23:33:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com> writes:\n\n> In some places static size buffers can't store formatted string.\n> If it be happen then git die.\n>\n> Jonathan Tan: Thanks a lot for your help.\n>\n> Maxim Moseychuk (2):\n>   bisect_next_all: convert xsnprintf to xstrfmt\n>   stop_progress_msg: convert xsnprintf to xstrfmt\n>\n>  bisect.c   | 9 +++++----\n>  progress.c | 9 +++------\n>  2 files changed, 8 insertions(+), 10 deletions(-)\n>\n> --\n> 2.11.1\n\nThanks.  Queued with minor log message fixes and pushed out.\n"},{"id":"311831","messageId":"1487288237.25073.1.camel@gmail.com","threadId":"45154","inReplyTo":"xmqq8tp5vhgk.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH V2 0/2] Fix l10n","fromName":"Unknown","fromEmail":"franchesko.salias.hudro.pedros@gmail.com","sentAt":"2017-02-16T23:37:17Z","receivedAt":"2017-02-16T23:37:28Z","isPatch":true,"sender":{"key":"franchesko.salias.hudro.pedros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3121341?v=4"},"body":"В Чт, 16/02/2017 в 15:33 -0800, Junio C Hamano пишет:\n> Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com> writes:\n> \n> > In some places static size buffers can't store formatted string.\n> > If it be happen then git die.\n> > \n> > Jonathan Tan: Thanks a lot for your help.\n> > \n> > Maxim Moseychuk (2):\n> >   bisect_next_all: convert xsnprintf to xstrfmt\n> >   stop_progress_msg: convert xsnprintf to xstrfmt\n> > \n> >  bisect.c   | 9 +++++----\n> >  progress.c | 9 +++------\n> >  2 files changed, 8 insertions(+), 10 deletions(-)\n> > \n> > --\n> > 2.11.1\n> \n> Thanks.  Queued with minor log message fixes and pushed out.\n\nIf is not too late, please check the version 3.\n"},{"id":"311832","messageId":"xmqq4lztvcoq.fsf@gitster.mtv.corp.google.com","threadId":"45154","inReplyTo":"1487288237.25073.1.camel@gmail.com","subject":"Re: [PATCH V2 0/2] Fix l10n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-02-17T01:16:53Z","receivedAt":"2017-02-17T01:17:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Unknown <franchesko.salias.hudro.pedros@gmail.com> writes:\n\n> В Чт, 16/02/2017 в 15:33 -0800, Junio C Hamano пишет:\n>> \n>> Thanks.  Queued with minor log message fixes and pushed out.\n>\n> If is not too late, please check the version 3.\n\nI already squashed in the change s/bufp/buf/ in the version I queued\nand pushed out on 'pu', so we should be good.  I compared the result\nof applying your updated patches and did not see any other changes.\n\nThanks.\n"}]}