chiark / gitweb /
extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling
authorFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 02:40:44 +0000 (19:40 -0700)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:19:06 +0000 (10:19 +0100)
commit1308667689580277d99a7fcdf8769752986d31eb
tree23613234d8a96e16bd68045c5c450e0b35026c6c
parentd58deedf28351f217c1348604eab87ec075975c2
extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling

Refactor allocation of the result string to the top, since it is
currently done in both branches of the condition.

Remove unreachable code checking for EXTRACT_DONT_COALESCE_SEPARATORS
when state == SEPARATOR (the only place where SEPARATOR is assigned to
state follows a check for EXTRACT_DONT_COALESCE_SEPARATORS that jumps to
the end of the function.)

Tested by running test-util successfully.

Follow up to: 206644aedeb8859801051ac170ec562c6a113a79
src/basic/util.c