See simple attached patch
Created attachment 226657 [details] 0001-PREFIX-and-ED-quoting-check.patch 0001-PREFIX-and-ED-quoting-check.patch
ah, thanks, I just commited a similar patch also including EROOT 1 minute ago.
This has been fixed since 2.1.9.25 or so: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6212d08bff80cb49b5f648878fcb52f2bc019b31