add command line option for user dir to allow portable install#159
add command line option for user dir to allow portable install#159camthesaxman wants to merge 4 commits intoNeverball:masterfrom
Conversation
|
I don't know if you're aware of this, but this doesn't actually do what it claims to do. It doesn't set the user directory, it sets the parent directory of the user directory (referred to as "home" as in the HOME env var). |
|
Yeah, guess I got caught up on the difference between the home dir and the user dir. It should work as expected, now. |
|
Any reason why this is not yet merged? |
|
As I wrote in the pull review, this patch creates a bug by freeing memory that wasn't allocated. Do you not see it? That would make pull reviews pretty useless. |
|
Hmm, no, I don't see it... |
| home = pick_home_path(); | ||
| user = concat_string(home, "/", CONFIG_USER, NULL); | ||
| if (arg_user_path) | ||
| user = arg_user_path; |
There was a problem hiding this comment.
user is passed to free() down the line, which will do something unexpected if user is a passed-in option string. This should either be wrapped in a strdup() or the concat_string() result should be a separate variable that can be passed to free() safely.
|
Whoops, I guess I had to "submit" it. I wrote it 7 months ago. |
Since commit 8a6e84a , it doesn't appear to be possible to make a portable installation of Neverball that can run completely from a USB drive (at least not that I know of). With 1.5.4, you could make a launcher that set the
APPDATAenvironment variable to control that, but that method doesn't appear to work with SHGetFolderPath.