From: Phillip Wood Date: Wed, 08 Aug 2018 16:00:59 GMT Subject: Re: [GSoC][PATCH v5 02/20] rebase -i: rewrite append_todo_help() in C Message-ID: <89a83826-53e6-aea1-2012-475a09f76ddc@talktalk.net> In-Reply-To: Hi Alban On 08/08/18 16:16, Alban Gruin wrote: > Hi Phillip, > > Le 07/08/2018 à 15:57, Phillip Wood a écrit : >>> + if (ret < 0) >>> + error_errno(_("could not append help text to '%s'"), rebase_path_todo()); >>> + >>> + fclose(todo); >> >> You should definitely check the return value and return an error if >> appropriate as fputs() might not actually write any data until you try >> and close the file. >> > > Is this worth a reroll, as this goes away in a later patch (refactored > in 08/20, removed in 12/20)? > Ah, I've only made it to patch 10 at the moment! If this is going to be removed don't worry about it. Best Wishes Phillip >> Best Wishes >> >> Phillip >> >>> + strbuf_release(&buf); >>> + >>> + return ret; >>> +} >>> diff --git a/rebase-interactive.h b/rebase-interactive.h >>> new file mode 100644 >>> index 0000000000..47372624e0 >>> --- /dev/null >>> +++ b/rebase-interactive.h >>> @@ -0,0 +1,6 @@ >>> +#ifndef REBASE_INTERACTIVE_H >>> +#define REBASE_INTERACTIVE_H >>> + >>> +int append_todo_help(unsigned edit_todo, unsigned keep_empty); >>> + >>> +#endif >>> >> > > Cheers, > Alban >