mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
Minesweeper+Snake: load config file before calling unveil()
This commit is contained in:
parent
0603402c80
commit
e558f6b184
Notes:
sideshowbarker
2024-07-19 01:33:38 +09:00
Author: https://github.com/bcoles
Commit: e558f6b184
Pull-request: https://github.com/SerenityOS/serenity/pull/3945
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