Page MenuHomePhabricator

eina_vpath: fix homedirectory fetching

Authored by bu5hm4n on Aug 3 2018, 5:04 AM.



the fetching of the homedirectorty did not work. pw_dir was never
prepended. Additionally you would get a silent NULL string back
if the system does not support HAVE_GETPWENT.

ref T7107

Depends on D6737

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
bu5hm4n created this revision.Aug 3 2018, 5:04 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added:

bu5hm4n edited the summary of this revision. (Show Details)Aug 3 2018, 5:06 AM
bu5hm4n added a reviewer: zmike.
bu5hm4n added a project: Restricted Project.
zmike added a subscriber: vtorri.Aug 3 2018, 6:52 AM

This should have a test...I guess where the vpath result is compared to $HOME.

eio usage of getpwnam implies that this will not work on Windows, @vtorri can you look?


I would prefer if you did *str = NULL; at the top of this function unconditionally so that it would be applied for all failure cases automatically.


There is no error string in this case...

zmike added inline comments.Aug 3 2018, 6:54 AM

This could probably use one of the eina_str_join functions?

Tests are added in the next revision.


Will be done


What do you mean with that ?


What do you mean ? The error is passed to the function, which is the path.


Will be done


Tried that, does not work out, since eina_str_join has a seperator, which cannot be spared out.

Sorry for the multiple replies, no idea what happened.

zmike accepted this revision.Aug 6 2018, 4:44 AM
zmike added inline comments.

Oh I misread.


Wow, this is not a super useful behavior? And I guess it cannot be changed since probably someone has used it to nul separate two strings somewhere.

This revision is now accepted and ready to land.Aug 6 2018, 4:44 AM
raster added a subscriber: raster.Aug 6 2018, 6:25 PM

eio usage of getpwnam implies that this will not work on Windows, @vtorri can you look?

It seems a few buglets moved their way in when going from efl vpath => eina vpath. and getpwnam doesn't work on windows (mingw32) i understand.

vtorri added a comment.EditedAug 6 2018, 9:28 PM

getpwnam does not exist on Windows. it may be possible to get the home directory of a user. It is not straightforward, but i have seen some ideas about that

bu5hm4n removed a project: Restricted Project.Aug 20 2018, 3:17 AM
Closed by commit rEFLaa416afffbbf: eina_vpath: fix homedirectory fetching (authored by Marcel Hollerbach <>, committed by zmike). · Explain WhyAug 20 2018, 10:07 AM
This revision was automatically updated to reflect the committed changes.