Re: [PATCH] mailsplit.c: remove dead code

2014-08-17 Thread Jeff King
On Tue, Aug 12, 2014 at 06:38:38PM +0200, René Scharfe wrote: Am 11.08.2014 um 23:11 schrieb Stefan Beller: This was found by coverity. (Id: 290001) the variable 'output' is only assigned to a value inequal to NUL, after all gotos to the corrupt label. Therefore we can conclude the two

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread René Scharfe
Am 11.08.2014 um 23:11 schrieb Stefan Beller: This was found by coverity. (Id: 290001) the variable 'output' is only assigned to a value inequal to NUL, after all gotos to the corrupt label. Therefore we can conclude the two removed lines are actually dead code. After reading the above for

[PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Stefan Beller
This was found by coverity. (Id: 290001) The variable 'output' is assigned to a value after all gotos to the corrupt label. Remove the goto by moving the errorhandling code to the condition, which detects the error. Signed-off-by: Stefan Beller stefanbel...@gmail.com Helped-by: René Scharfe

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Matthieu Moy
Stefan Beller stefanbel...@gmail.com writes: + if (is_bare !allow_bare) { + unlink(name); + fprintf(stderr, corrupt mailbox\n); + exit(1); + } Not directly related to your patch, but shouldn't this be using die(_(corrupt mailbox)); instead? --

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Stefan Beller stefanbel...@gmail.com writes: +if (is_bare !allow_bare) { +unlink(name); +fprintf(stderr, corrupt mailbox\n); +exit(1); +} Not directly related to your patch, but shouldn't this

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Junio C Hamano
... answering to myself, the only invoker does not seem to care, so I do not mind if the fprintf/exit gets turned into die() in a follow-up patch. Thanks. On Tue, Aug 12, 2014 at 2:38 PM, Junio C Hamano gits...@pobox.com wrote: Matthieu Moy matthieu@grenoble-inp.fr writes: Stefan Beller

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: Matthieu Moy matthieu@grenoble-inp.fr writes: Stefan Beller stefanbel...@gmail.com writes: + if (is_bare !allow_bare) { + unlink(name); + fprintf(stderr, corrupt mailbox\n); + exit(1); + } Not directly

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Jonathan Nieder
Stefan Beller wrote: This was found by coverity. (Id: 290001) [...] Signed-off-by: Stefan Beller stefanbel...@gmail.com Helped-by: René Scharfe l@web.de --- builtin/mailsplit.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) The idea is to simplify error

[PATCH] mailsplit.c: remove dead code

2014-08-11 Thread Stefan Beller
This was found by coverity. (Id: 290001) the variable 'output' is only assigned to a value inequal to NUL, after all gotos to the corrupt label. Therefore we can conclude the two removed lines are actually dead code. Signed-off-by: Stefan Beller stefanbel...@gmail.com --- builtin/mailsplit.c |