unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Brad Howes via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 68632@debbugs.gnu.org
Subject: bug#68632: [PATCH] Downcase host name to match URL parsing behavior
Date: Sun, 21 Jan 2024 11:05:26 +0100	[thread overview]
Message-ID: <E75DBC94-A398-47E5-964E-A8805573D910@mac.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

Tags: patch

Tags: patch

Tags: patch


When using `comint-osc-process-output' to track directory changes, there
can be a failure to match host names due to inconsistent behavior
between `url-generic-parse-url' and `ansi-osc-directory-tracker. The
former applies `downcase' to the result extracted from the URL but the
latter does not.


In GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2023-08-17 built on
armbob.lan
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.2.1

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000
-DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no'


[-- Attachment #2: 0001-Downcase-host-name-to-match-URL-parsing-behavior.patch --]
[-- Type: application/octet-stream, Size: 963 bytes --]

From 1be1c11a33b87612dd2b768f3cdf43b11c1ecdc9 Mon Sep 17 00:00:00 2001
From: Brad Howes <bradhowes@mac.com>
Date: Sun, 21 Jan 2024 10:07:24 +0100
Subject: [PATCH] Downcase host name to match URL parsing behavior

---
 lisp/ansi-osc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ansi-osc.el b/lisp/ansi-osc.el
index 7e686193f69..8dbaeb45132 100644
--- a/lisp/ansi-osc.el
+++ b/lisp/ansi-osc.el
@@ -121,7 +121,8 @@ ansi-osc-directory-tracker
   (let ((url (url-generic-parse-url text)))
     (when (and (string= (url-type url) "file")
                (or (null (url-host url))
-                   (string= (url-host url) (system-name))))
+                   ;; Use `downcase' to match `url-generic-parse-url' behavior
+                   (string= (url-host url) (downcase (system-name)))))
       (ignore-errors
         (cd-absolute (url-unhex-string (url-filename url)))))))
 
-- 
2.39.3 (Apple Git-145)


[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




             reply	other threads:[~2024-01-21 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 10:05 Brad Howes via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-27 10:33 ` bug#68632: [PATCH] Downcase host name to match URL parsing behavior Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E75DBC94-A398-47E5-964E-A8805573D910@mac.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68632@debbugs.gnu.org \
    --cc=bradhowes@mac.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).