Peter Wang writes:
> On Sat, 05 Jul 2014 10:18:05 -0300, David Bremner
> wrote:
>> Peter Wang writes:
>>
>> > -cleanup_path = tmppath;
>> > -
>> > -if (! copy_stdin (fdin, fdout))
>> > - goto FAIL;
>> > +if (! copy_stdin (fdin, fdout)) {
>> > + close (fdout);
>> > + unlink (tmp
Peter Wang writes:
> On Sat, 05 Jul 2014 10:18:05 -0300, David Bremner wrote:
>> Peter Wang writes:
>>
>> > -cleanup_path = tmppath;
>> > -
>> > -if (! copy_stdin (fdin, fdout))
>> > - goto FAIL;
>> > +if (! copy_stdin (fdin, fdout)) {
>> > + close (fdout);
>> > + unlink (tmppat
Peter Wang writes:
>> Is there a good reason to use TRUE and FALSE for return values rather
>> than EXIT_SUCCESS and EXIT_FAILURE? It seems like the latter would be
>> overall slightly simpler in notmuch_insert_command.
>
> Not sure what you have in mind. I think CLI exit codes should be
> confi
Peter Wang writes:
>> Is there a good reason to use TRUE and FALSE for return values rather
>> than EXIT_SUCCESS and EXIT_FAILURE? It seems like the latter would be
>> overall slightly simpler in notmuch_insert_command.
>
> Not sure what you have in mind. I think CLI exit codes should be
> confi
On Sat, 05 Jul 2014 10:18:05 -0300, David Bremner wrote:
> Peter Wang writes:
>
> > -cleanup_path = tmppath;
> > -
> > -if (! copy_stdin (fdin, fdout))
> > - goto FAIL;
> > +if (! copy_stdin (fdin, fdout)) {
> > + close (fdout);
> > + unlink (tmppath);
> > + return FALSE;
> >
On Sat, 05 Jul 2014 10:18:05 -0300, David Bremner wrote:
> Peter Wang writes:
>
> > -cleanup_path = tmppath;
> > -
> > -if (! copy_stdin (fdin, fdout))
> > - goto FAIL;
> > +if (! copy_stdin (fdin, fdout)) {
> > + close (fdout);
> > + unlink (tmppath);
> > + return FALSE;
> >
Peter Wang writes:
> -cleanup_path = tmppath;
> -
> -if (! copy_stdin (fdin, fdout))
> - goto FAIL;
> +if (! copy_stdin (fdin, fdout)) {
> + close (fdout);
> + unlink (tmppath);
> + return FALSE;
> +}
I'm not completely convinced by replacement of the "goto FAIL"
Peter Wang writes:
> -cleanup_path = tmppath;
> -
> -if (! copy_stdin (fdin, fdout))
> - goto FAIL;
> +if (! copy_stdin (fdin, fdout)) {
> + close (fdout);
> + unlink (tmppath);
> + return FALSE;
> +}
I'm not completely convinced by replacement of the "goto FAIL"
Change insert_message into write_message and move its responsibilities
for indexing the message into the main function, to simplify the control
flow.
---
notmuch-insert.c | 63 +++-
1 file changed, 30 insertions(+), 33 deletions(-)
diff --git a/
Change insert_message into write_message and move its responsibilities
for indexing the message into the main function, to simplify the control
flow.
---
notmuch-insert.c | 63 +++-
1 file changed, 30 insertions(+), 33 deletions(-)
diff --git a/
10 matches
Mail list logo