From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: handle cygwin path from ldapsearch Date: Tue, 21 Sep 2004 17:47:45 -0700 (PDT) Organization: Sony Electronics Inc. Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <20040921.174745.207589496.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1095814159 2305 80.91.229.6 (22 Sep 2004 00:49:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Sep 2004 00:49:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 22 02:49:01 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C9vJd-0002lc-00 for ; Wed, 22 Sep 2004 02:49:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C9vPa-0000dx-CK for ged-emacs-devel@m.gmane.org; Tue, 21 Sep 2004 20:55:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C9vPN-0000dr-Qb for emacs-devel@gnu.org; Tue, 21 Sep 2004 20:54:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C9vPJ-0000aw-00 for emacs-devel@gnu.org; Tue, 21 Sep 2004 20:54:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C9vPI-0000an-Tr for emacs-devel@gnu.org; Tue, 21 Sep 2004 20:54:52 -0400 Original-Received: from [160.33.82.68] (helo=mail1.fw-sj.sony.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C9vIc-0002Bp-29 for emacs-devel@gnu.org; Tue, 21 Sep 2004 20:47:58 -0400 Original-Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail1.fw-sj.sony.com (8.12.11/8.12.11) with ESMTP id i8M0lkiM008395 for ; Wed, 22 Sep 2004 00:47:51 GMT Original-Received: from localhost ([43.191.19.62]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id i8M0lj7H023045 for ; Wed, 22 Sep 2004 00:47:45 GMT Original-To: emacs-devel@gnu.org X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-4.0.69 on Emacs-21.3.50.1 (i386-mingw-nt5.1.2600) of 2004-09-14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27405 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27405 The following patch provides correct handling of file path generated by cygwin version of ldapsearch. -Tak 2004-09-21 Takaaki Ota * net/ldap.el (ldap-search): Handle cygwin file path appropriately. *** ../../../../pub/emacs/emacs-21.3.50/lisp/net/ldap.el Wed May 19 12:06:54 2004 --- ldap.el Tue Sep 21 17:33:16 2004 *************** *** 582,592 **** (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$") (setq name (match-string 1) value (match-string 3)) ! ;; Need to handle file:///D:/... as generated by OpenLDAP ! ;; on DOS/Windows as local files. ! (if (and (memq system-type '(windows-nt ms-dos)) ! (eq (string-match "/\\(.:.*\\)$" value) 0)) ! (setq value (match-string 1 value))) ;; Do not try to open non-existent files (if (equal value "") (setq value " ") --- 582,596 ---- (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$") (setq name (match-string 1) value (match-string 3)) ! ;; Need to handle pagan path ! (if (memq system-type '(windows-nt ms-dos)) ! (cond ! ;; file:///D:/... as generated by OpenLDAP on DOS/Windows as local files. ! ((string-match "/\\(.:.*\\)$" value) ! (setq value (match-string 1 value))) ! ;; /cygdrive/c/... as generated by OpenLDAP on Cygwin ! ((string-match "/cygdrive/\\(.\\)\\(/.*\\)$" value) ! (setq value (concat (match-string 1 value) ":" (match-string 2 value)))))) ;; Do not try to open non-existent files (if (equal value "") (setq value " ")