From 8378ecc67bce43856881b3921f6204f5fd651ac9 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Mon, 6 Sep 2021 01:40:45 -0400 Subject: [PATCH] TextEditor/FileArgument: Remove file existance check for early exit This check was fine earlier when we had access to the full filesystem, but now that we are moving away from applications having unveiled access to the filesystem, this check would just get rejected from the kernel. This is rare / fast enough that performance should not really matter in any case. --- Userland/Applications/TextEditor/FileArgument.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Userland/Applications/TextEditor/FileArgument.cpp b/Userland/Applications/TextEditor/FileArgument.cpp index a0772c053c..732889c48c 100644 --- a/Userland/Applications/TextEditor/FileArgument.cpp +++ b/Userland/Applications/TextEditor/FileArgument.cpp @@ -15,12 +15,6 @@ FileArgument::FileArgument(String file_argument) m_line = {}; m_column = {}; - if (Core::File::exists(file_argument)) { - // A file exists with the full specified name, don't attempt to parse it. - m_filename = move(file_argument); - return; - } - // A file doesn't exist with the full specified name, maybe the user entered line/column coordinates? Regex re("^(.+?)(:([0-9]+):?([0-9]+)?)?$"); RegexResult result = match(file_argument, re, PosixFlags::Global | PosixFlags::Multiline | PosixFlags::Ungreedy);