From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Claesson Newsgroups: gmane.emacs.bugs Subject: bug#18037: 24.3; term.el cannot track non-ascii directories Date: Wed, 16 Jul 2014 21:52:07 +0200 Message-ID: <87k37dcc9k.fsf@bredband.net> References: <877g3ddvkj.fsf@bredband.net> <83oawp6rrr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1405540411 10687 80.91.229.3 (16 Jul 2014 19:53:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jul 2014 19:53:31 +0000 (UTC) Cc: 18037@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 16 21:53:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X7VGT-0003ae-LF for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jul 2014 21:53:21 +0200 Original-Received: from localhost ([::1]:40961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7VGT-0001Ii-7o for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jul 2014 15:53:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7VGI-00017q-If for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 15:53:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7VGB-0003o8-1j for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 15:53:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7VGA-0003ny-Uh for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 15:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X7VGA-0002iZ-7T for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 15:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Johan Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Jul 2014 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18037 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18037-submit@debbugs.gnu.org id=B18037.140554033810300 (code B ref 18037); Wed, 16 Jul 2014 19:53:02 +0000 Original-Received: (at 18037) by debbugs.gnu.org; 16 Jul 2014 19:52:18 +0000 Original-Received: from localhost ([127.0.0.1]:56839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7VFQ-0002g1-U0 for submit@debbugs.gnu.org; Wed, 16 Jul 2014 15:52:17 -0400 Original-Received: from smtprelay-b32.telenor.se ([213.150.131.21]:35607) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7VFN-0002fU-Mi for 18037@debbugs.gnu.org; Wed, 16 Jul 2014 15:52:15 -0400 Original-Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b32.telenor.se (Postfix) with ESMTP id 5FFEF84A87 for <18037@debbugs.gnu.org>; Wed, 16 Jul 2014 21:52:07 +0200 (CEST) X-SMTPAUTH-B2: [b157288] X-SENDER-IP: [213.114.152.236] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMMAJTWxlPVcpjsPGdsb2JhbABZgw6BKYIlhQjDRwICAYEIFwQBAQEBODaEAwEBBAFWIxAIAxQBDCUPAQQZDAoaE4g6DAHKVhcYjyIRB4RDAQSzDzsv X-IPAS-Result: ApMMAJTWxlPVcpjsPGdsb2JhbABZgw6BKYIlhQjDRwICAYEIFwQBAQEBODaEAwEBBAFWIxAIAxQBDCUPAQQZDAoaE4g6DAHKVhcYjyIRB4RDAQSzDzsv X-IronPort-AV: E=Sophos;i="5.01,673,1400018400"; d="diff'?scan'208";a="43995156" Original-Received: from c-ec9872d5.04-99-73746f3.cust.bredbandsbolaget.se (HELO goblin) ([213.114.152.236]) by ipb1.telenor.se with ESMTP; 16 Jul 2014 21:52:06 +0200 In-Reply-To: <83oawp6rrr.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Jul 2014 22:13:44 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91596 Archived-At: --=-=-= Content-Type: text/plain Ok, good catch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=term.el.diff --- a/term.el 2014-07-16 19:22:09.348823919 +0200 +++ b/term.el 2014-07-16 21:30:28.272894153 +0200 @@ -3424,7 +3424,8 @@ (substring string (1+ first-colon) second-colon)))) (setq term-pending-frame (cons filename fileline)))) ((= (aref string 0) ?/) - (cd (substring string 1))) + (cd (decode-coding-string (substring string 1) + locale-coding-system))) ;; Allowing the inferior to call functions in Emacs is ;; probably too big a security hole. ;; ((= (aref string 0) ?!) --=-=-= Content-Type: text/plain Regards, /Johan Eli Zaretskii writes: >> From: Johan Claesson >> Date: Wed, 16 Jul 2014 20:09:48 +0200 >> >> --- a/term.el 2014-07-16 19:22:09.348823919 +0200 >> +++ b/term.el 2014-07-16 19:25:33.920825786 +0200 >> @@ -3424,7 +3424,7 @@ >> (substring string (1+ first-colon) second-colon)))) >> (setq term-pending-frame (cons filename fileline)))) >> ((= (aref string 0) ?/) >> - (cd (substring string 1))) >> + (cd (string-as-multibyte (substring string 1)))) >> ;; Allowing the inferior to call functions in Emacs is >> ;; probably too big a security hole. >> ;; ((= (aref string 0) ?!) > > string-as-multibyte is not right. > >> (Motivation: in term-exec-1 the coding-system-for-read is set to 'binary >> with the following comment: >> >> ;; The process's output contains not just chars but also binary >> ;; escape codes, so we need to see the raw output. We will have to >> ;; do the decoding by hand on the parts that are made of chars. >> >> I think term-command-hook is one place where such decoding is needed.) > > Indeed; but string-as-multibyte is not the way to decode the string. > You need to use decode-coding-string and locale-coding-system. --=-=-=--