summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/keymap.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/Userland/Utilities/keymap.cpp b/Userland/Utilities/keymap.cpp
index 47c4b00623..1ee4631e25 100644
--- a/Userland/Utilities/keymap.cpp
+++ b/Userland/Utilities/keymap.cpp
@@ -42,17 +42,22 @@ int main(int argc, char** argv)
return 1;
}
- if (unveil(nullptr, nullptr) < 0) {
- perror("unveil");
- return 1;
- }
-
const char* path = nullptr;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "The mapping file to be used", "file", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
- dbgln("path is at {:p}, and contains {}", path, path);
+ if (path && path[0] == '/') {
+ if (unveil(path, "r") < 0) {
+ perror("unveil path");
+ return 1;
+ }
+ }
+
+ if (unveil(nullptr, nullptr) < 0) {
+ perror("unveil");
+ return 1;
+ }
if (!path) {
auto keymap = Keyboard::CharacterMap::fetch_system_map();