From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#13553: 24.3.50; incorrect usage of IS_DIRECTORY_SEP Date: Sat, 26 Jan 2013 13:16:50 +0200 Message-ID: <83obgcjisd.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1359199074 18703 80.91.229.3 (26 Jan 2013 11:17:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Jan 2013 11:17:54 +0000 (UTC) Cc: 13553@debbugs.gnu.org, shigeru.fukaya@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 26 12:18:13 2013 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 1Tz3lz-0005JN-Qp for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Jan 2013 12:18:11 +0100 Original-Received: from localhost ([::1]:52117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tz3lh-00011T-Ut for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Jan 2013 06:17:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tz3ld-00011N-Ty for bug-gnu-emacs@gnu.org; Sat, 26 Jan 2013 06:17:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tz3lc-0004VX-TK for bug-gnu-emacs@gnu.org; Sat, 26 Jan 2013 06:17:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tz3lc-0004VT-Pc for bug-gnu-emacs@gnu.org; Sat, 26 Jan 2013 06:17:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tz3lq-0005oB-34 for bug-gnu-emacs@gnu.org; Sat, 26 Jan 2013 06:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Jan 2013 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13553 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13553-submit@debbugs.gnu.org id=B13553.135919905322290 (code B ref 13553); Sat, 26 Jan 2013 11:18:02 +0000 Original-Received: (at 13553) by debbugs.gnu.org; 26 Jan 2013 11:17:33 +0000 Original-Received: from localhost ([127.0.0.1]:50068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tz3lN-0005nT-9l for submit@debbugs.gnu.org; Sat, 26 Jan 2013 06:17:33 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:55299) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tz3lK-0005nL-TX for 13553@debbugs.gnu.org; Sat, 26 Jan 2013 06:17:32 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MH800100CJAF100@a-mtaout20.012.net.il> for 13553@debbugs.gnu.org; Sat, 26 Jan 2013 13:16:40 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MH8001MPCNS6K50@a-mtaout20.012.net.il>; Sat, 26 Jan 2013 13:16:40 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:70337 Archived-At: > From: Stefan Monnier > Date: Sat, 26 Jan 2013 05:26:04 -0500 > Cc: 13553@debbugs.gnu.org > > > It is because IS_DIRECTORY_SEP is wrongly used. > > IS_DIRECTORY_SEP only works when its argument is surely on a start > > byte of dbcs characters. > > If the file name is properly decoded (i.e. in its multibyte form), there > can't be a 0x5c byte other than at the beginning of a char. > > So this bug can only happens if you pass a unibyte filename. IOW the > bug is probably in the caller rather than in the file-attributes function. No, it's not in the caller. It's in w32.c, whose functions almost always manipulate encoded file names (because they shadow system APIs). > Please show us the actual situation where this happens, since file names > are normally always multibyte. You call file-attributes, which encodes the file name and passes it to 'lstat'. The implementation of 'lstat' in w32.c then looks at the last byte of the encoded file name to see if there's a slash or backslash there. Boom! I will fix that.