[Portland] [PATCH] xdg-utils: support digits in uri scheme regex

Cameron Fieber cameron at fieber.ca
Tue Mar 26 05:57:08 UTC 2019


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 09ef6d8..49277fd 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.19.1


More information about the Portland mailing list