libopkg/opkg_cmd.c: more robust PATH handling
authorGlenn Strauss <gstrauss@gluelogic.com>
Thu, 2 Mar 2017 22:53:42 +0000 (17:53 -0500)
committerJo-Philipp Wich <jo@mein.io>
Wed, 15 Mar 2017 00:42:49 +0000 (01:42 +0100)
commit1ff24753478ceea81ec6c8e90bb1a59d57cc0501
tree7807ca2bfd785e10976273518c2e5b33b9da4546
parent5dc3e3363159939fcfb429a959bc91296541dc09
libopkg/opkg_cmd.c: more robust PATH handling

preserve semantics of PATH when PATH is not set in environment

error and undefined behavior reported in
  https://github.com/openwrt/packages/issues/1922
when PATH not set in environment
(lighttpd executes CGI with empty base env, plus standard CGI env vars)

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
[Jo-Philipp Wich: avoid free() on NULL, use default from cmake cache string]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/opkg_cmd.c