mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
Minesweeper+Snake: load config file before calling unveil()
This commit is contained in:
parent
0603402c80
commit
e558f6b184
3 changed files with 12 additions and 4 deletions
8
Base/home/anon/.config/Minesweeper.ini
Normal file
8
Base/home/anon/.config/Minesweeper.ini
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Minesweeper]
|
||||||
|
SingleChording=0
|
||||||
|
|
||||||
|
[Game]
|
||||||
|
MineCount=10
|
||||||
|
Columns=9
|
||||||
|
Rows=9
|
||||||
|
|
|
@ -53,13 +53,13 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
||||||
|
|
||||||
if (unveil("/res", "r") < 0) {
|
if (unveil("/res", "r") < 0) {
|
||||||
perror("unveil");
|
perror("unveil");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
|
||||||
|
|
||||||
if (unveil(config->file_name().characters(), "crw") < 0) {
|
if (unveil(config->file_name().characters(), "crw") < 0) {
|
||||||
perror("unveil");
|
perror("unveil");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -51,13 +51,13 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto config = Core::ConfigFile::get_for_app("Snake");
|
||||||
|
|
||||||
if (unveil("/res", "r") < 0) {
|
if (unveil("/res", "r") < 0) {
|
||||||
perror("unveil");
|
perror("unveil");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto config = Core::ConfigFile::get_for_app("Snake");
|
|
||||||
|
|
||||||
if (unveil(config->file_name().characters(), "crw") < 0) {
|
if (unveil(config->file_name().characters(), "crw") < 0) {
|
||||||
perror("unveil");
|
perror("unveil");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue