emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/net tramp-smb.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net tramp-smb.el
Date: Fri, 16 Oct 2009 14:36:02 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/10/16 14:36:02

Modified files:
        lisp/net       : tramp-smb.el 

Log message:
        * net/tramp-smb.el (tramp-smb-version): New defvar.
        (tramp-smb-maybe-open-connection): Use it, in order to avoid
        repeated checks.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp-smb.el?cvsroot=emacs&r1=1.58&r2=1.59

Patches:
Index: tramp-smb.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp-smb.el,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- tramp-smb.el        15 Oct 2009 13:17:07 -0000      1.58
+++ tramp-smb.el        16 Oct 2009 14:36:02 -0000      1.59
@@ -61,6 +61,9 @@
   :group 'tramp
   :type 'string)
 
+(defvar tramp-smb-version nil
+  "*Version string of the SMB client.")
+
 (defconst tramp-smb-prompt "^smb: .+> \\|^\\s-+Server\\s-+Comment$"
   "Regexp used as prompt in smbclient.")
 
@@ -1209,13 +1212,15 @@
         "Cannot find command %s in %s" tramp-smb-program exec-path))
 
       (let* ((default-directory (tramp-compat-temporary-file-directory))
-            (smbclient-version
-             (shell-command-to-string (concat tramp-smb-program " -V"))))
+            (smbclient-version tramp-smb-version))
+       (unless smbclient-version
+         (setq smbclient-version
+               (shell-command-to-string (concat tramp-smb-program " -V")))
        (tramp-message vec 6 (concat tramp-smb-program " -V"))
        (tramp-message vec 6 "\n%s" smbclient-version)
        (if (string-match "[ \t\n\r]+\\'" smbclient-version)
            (setq smbclient-version
-                 (replace-match "" nil nil smbclient-version)))
+                   (replace-match "" nil nil smbclient-version))))
        (unless
            (string-equal
             smbclient-version
@@ -1223,8 +1228,9 @@
              vec "smbclient-version" smbclient-version))
          (tramp-flush-directory-property vec "")
          (tramp-flush-connection-property vec))
+       (setq tramp-smb-version
        (tramp-set-connection-property
-        vec "smbclient-version" smbclient-version)))
+              vec "smbclient-version" smbclient-version))))
 
     ;; If too much time has passed since last command was sent, look
     ;; whether there has been an error message; maybe due to




reply via email to

[Prev in Thread] Current Thread [Next in Thread]