Re: [PATCH 3/5] sequencer: sequencer state is useless without todo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 13, 2011, 20:50 UTC
- Message-ID
- <7v7h33oifq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALkWK0nGhUshwJM1vmAUhBG9foH+=6+_KFhfTTF6+kNS0Hm2JA@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 8 quoted lines
>>> static int create_seq_dir(void)
>>> {
>>> + const char *todo_file = git_path(SEQ_TODO_FILE);
>>> const char *seq_dir = git_path(SEQ_DIR);
>>
>> Scary idiom.
>
> What's scary about it?The next person who copies and pastes this code to other codepaths without thinking that the return value of git_path() is ephemeral and may need to be saved away depending on what goes between its assignment and its use.