aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/FileCommands.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/FileCommands.cxx')
-rw-r--r--src/command/FileCommands.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index 789aa1f28..1e0f9c585 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -202,11 +202,22 @@ read_file_comments(Client &client, const Path path_fs)
}
+static const char *
+translate_uri(const char *uri)
+{
+ if (memcmp(uri, "file:///", 8) == 0)
+ /* drop the "file://", leave only an absolute path
+ (starting with a slash) */
+ return uri + 7;
+
+ return uri;
+}
+
CommandResult
handle_read_comments(Client &client, ConstBuffer<const char *> args)
{
assert(args.size == 1);
- const char *const uri = args.front();
+ const char *const uri = translate_uri(args.front());
if (memcmp(uri, "file:///", 8) == 0) {
/* read comments from arbitrary local file */