Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 385660 Details for
Bug 120787
Ebuild for reminiscence, a free rewrite of the Flashback's game engine.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
reminiscence-0.2.1-homedir-fix.patch
reminiscence-0.2.1-homedir-fix.patch (text/plain), 1.53 KB, created by
M8R-u38wij
on 2014-09-28 10:55:49 UTC
(
hide
)
Description:
reminiscence-0.2.1-homedir-fix.patch
Filename:
MIME Type:
Creator:
M8R-u38wij
Created:
2014-09-28 10:55:49 UTC
Size:
1.53 KB
patch
obsolete
>diff --git a/main.cpp b/main.cpp >index 2e05d9b..f987595 100644 >--- a/main.cpp >+++ b/main.cpp >@@ -15,6 +15,10 @@ > * along with this program. If not, see <http://www.gnu.org/licenses/>. > */ > >+#include <sys/types.h> >+#include <sys/stat.h> >+#include <unistd.h> >+ > #include "file.h" > #include "fs.h" > #include "game.h" >@@ -24,10 +28,10 @@ static const char *USAGE = > "REminiscence - Flashback Interpreter\n" > "Usage: %s [OPTIONS]...\n" > " --datapath=PATH Path to data files (default 'DATA')\n" >- " --savepath=PATH Path to save files (default '.')\n" >+ " --savepath=PATH Path to save files (default '~/.reminiscence/')\n" > " --levelnum=NUM Starting level (default '0')"; > >-static bool parseOption(const char *arg, const char *longCmd, const char **opt) { >+static bool parseOption(char *arg, const char *longCmd, char **opt) { > bool handled = false; > if (arg[0] == '-' && arg[1] == '-') { > if (strncmp(arg + 2, longCmd, strlen(longCmd)) == 0) { >@@ -83,9 +87,19 @@ static Language detectLanguage(FileSystem *fs) { > > #undef main > int main(int argc, char *argv[]) { >- const char *dataPath = "DATA"; >- const char *savePath = "."; >- const char *levelNum = "0"; >+ struct stat sb; >+ char *dataPath = "DATA"; >+ char *savePath = (char *)malloc(256); >+ >+ snprintf(savePath, 255, "%s/.reminiscence", getenv("HOME")); >+ >+ if (stat(savePath, &sb)) { >+ if (mkdir(savePath, 0755) == -1) { >+ error("Unable to create %s directory", savePath); >+ } >+ } >+ >+ char *levelNum = "0"; > for (int i = 1; i < argc; ++i) { > bool opt = false; > if (strlen(argv[i]) >= 2) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120787
:
78387
|
78532
|
78533
|
217344
|
217345
|
217347
|
385658
|
385660
|
385680