xdg-utils/0013-support-digits-in-uri-scheme-regex.patch

31 lines
889 B
Diff
Raw Normal View History

From bfcefa162b1dcd6d62e193019969ff2f5ff331cf Mon Sep 17 00:00:00 2001
From: Cameron Fieber <cameron@fieber.ca>
Date: Mon, 25 Mar 2019 22:30:25 -0700
Subject: [PATCH 13/16] support digits in uri scheme regex
As per RFC 2396[1] a valid URI scheme may contain a digit:
scheme = alpha *( alpha | digit | + | - | . )
[1]: https://www.ietf.org/rfc/rfc2396.txt
---
scripts/xdg-open.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
index c38e1e0..202f3e3 100644
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
@@ -72,7 +72,7 @@ get_key()
is_file_url_or_path()
{
if echo "$1" | grep -q '^file://' \
- || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then
+ || ! echo "$1" | egrep -q '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then
return 0
else
return 1
--
2.31.1