karolherbst / Gamekeeper-Framework

Library for hooking up game stores and merging them into one single library
GNU Lesser General Public License v2.1
2 stars 0 forks source link

Use $LOGNAME instead of getlogin_r. #87

Closed Jookia closed 10 years ago

Jookia commented 10 years ago

This fixes tmux breaking but also is simpler than using the passwd interface. It also allows users to override the environmental variable if needed. LOGNAME and HOME are both part of POSIX.

karolherbst commented 10 years ago

really nice catch. @Cheeseness would you lik to check if $LOGNAME is defined on Mac OS X? It seems like some BSD variants only have $USER defined and not $LOGNAME Maybe we should use $USER instead of $LOGNAME? Or check against both?

Cheeseness commented 10 years ago

$LOGNAME is defined in Max OS 10.8.5, as is $USER. Perhaps checking against both is safest though?

Jookia commented 10 years ago

LOGNAME is specifically specified in POSIX, so I don't know what's up with that. Checking out USER would be a good backup. Which BSD variants? Cygwin discussion on this topic.

Jookia commented 10 years ago

I fixed the patch to fall back to $USER if it's able to.