summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2020-11-04 11:49:50 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-04 19:36:27 +0100
commite558f6b184e6a8d2a42814726c500d8103022236 (patch)
tree63ae0ced6b2017a94f56efccf7c9f6cdcd05a7ff
parent0603402c80cce7e5e39d6d9d56a943c1cfaf7b79 (diff)
downloadserenity-e558f6b184e6a8d2a42814726c500d8103022236.zip
Minesweeper+Snake: load config file before calling unveil()
-rw-r--r--Base/home/anon/.config/Minesweeper.ini8
-rw-r--r--Games/Minesweeper/main.cpp4
-rw-r--r--Games/Snake/main.cpp4
3 files changed, 12 insertions, 4 deletions
diff --git a/Base/home/anon/.config/Minesweeper.ini b/Base/home/anon/.config/Minesweeper.ini
new file mode 100644
index 0000000000..ce44bcaf45
--- /dev/null
+++ b/Base/home/anon/.config/Minesweeper.ini
@@ -0,0 +1,8 @@
+[Minesweeper]
+SingleChording=0
+
+[Game]
+MineCount=10
+Columns=9
+Rows=9
+
diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp
index 389d735ae1..e9358abfe5 100644
--- a/Games/Minesweeper/main.cpp
+++ b/Games/Minesweeper/main.cpp
@@ -53,13 +53,13 @@ int main(int argc, char** argv)
return 1;
}
+ auto config = Core::ConfigFile::get_for_app("Minesweeper");
+
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
- auto config = Core::ConfigFile::get_for_app("Minesweeper");
-
if (unveil(config->file_name().characters(), "crw") < 0) {
perror("unveil");
return 1;
diff --git a/Games/Snake/main.cpp b/Games/Snake/main.cpp
index f59818af4a..82437dfc42 100644
--- a/Games/Snake/main.cpp
+++ b/Games/Snake/main.cpp
@@ -51,13 +51,13 @@ int main(int argc, char** argv)
return 1;
}
+ auto config = Core::ConfigFile::get_for_app("Snake");
+
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
- auto config = Core::ConfigFile::get_for_app("Snake");
-
if (unveil(config->file_name().characters(), "crw") < 0) {
perror("unveil");
return 1;