]> git.ipfire.org Git - thirdparty/systemd.git/commit
extract_first_word: Refactor allocation in empty argument case
authorFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 02:16:50 +0000 (19:16 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 02:48:30 +0000 (19:48 -0700)
commitd3ef6c5560613fe98fcd227b0256ab4af6078ad0
treeaa518a08ff230ea10fa31348293b7a751dd56773
parent40ec276fdfc98f9fa7ed155b906235a79711066d
extract_first_word: Refactor allocation in empty argument case

This covers the case where an argument is an empty string, such as ''.

Instead of allocating the empty string in the individual conditions when
state == VALUE, just always allocate it at the end of state == START, at
which point we know we will have an argument.

Tested that test-util keeps passing after the refactor.

Follow up to: 14e685c29d5b317b815e3e9f056648027852b07e
src/basic/util.c