]> git.ipfire.org Git - thirdparty/systemd.git/commit
extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling 1083/head
authorFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 02:40:44 +0000 (19:40 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 02:48:38 +0000 (19:48 -0700)
commit8ab00959fb9758510c7b88bb1e8cf03162361e15
treeac21d0c56cd6ab7141d9b3ecbc397a5c62544222
parentd3ef6c5560613fe98fcd227b0256ab4af6078ad0
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