runtime(zip): Use :lcd instead of :cd in zip.vim

Commit: 
https://github.com/vim/vim/commit/1a4a1b9fa6a57af49e2d0955850f21c631e92263
Author: zoumi <[email protected]>
Date:   Sat Dec 20 16:25:16 2025 +0000

    runtime(zip): Use :lcd instead of :cd in zip.vim
    
    closes: https://github.com/vim/vim/issues/18967
    
    Signed-off-by: zoumi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim
index 49e4e8198..74b0d28fa 100644
--- a/runtime/autoload/zip.vim
+++ b/runtime/autoload/zip.vim
@@ -17,6 +17,7 @@
 " 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly
 " 2025 Jul 12 by Vim Project: drop ../ on write to prevent path traversal 
attacks
 " 2025 Sep 22 by Vim Project: support PowerShell Core
+" 2025 Dec 20 by Vim Project: use :lcd instead of :cd
 " License:     Vim License  (see vim's :help license)
 " Copyright:   Copyright (C) 2005-2019 Charles E. Campbell {{{1
 "              Permission is hereby granted to use and distribute this code,
@@ -371,7 +372,7 @@ fun! zip#Write(fname)
   call mkdir(tmpdir,"p")
 
   " attempt to change to the indicated directory
-  if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
+  if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot lcd to temporary directory")
     return
   endif
 
@@ -380,7 +381,7 @@ fun! zip#Write(fname)
     call delete("_ZIPVIM_", "rf")
   endif
   call mkdir("_ZIPVIM_")
-  cd _ZIPVIM_
+  lcd _ZIPVIM_
 
   if has("unix")
     let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\].*$',' ','')
@@ -455,7 +456,7 @@ fun! zip#Write(fname)
   endif
 
   " cleanup and restore current directory
-  cd ..
+  lcd ..
   call delete("_ZIPVIM_", "rf")
   call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
   call delete(tmpdir, "rf")
@@ -536,7 +537,7 @@ endfun
 " s:ChgDir: {{{2
 fun! s:ChgDir(newdir,errlvl,errmsg)
   try
-   exe "cd ".fnameescape(a:newdir)
+   exe "lcd ".fnameescape(a:newdir)
   catch /^Vim\%(( \+)\)\=:E344/
    redraw!
    if a:errlvl == s:NOTE

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vWzqI-007BXV-6f%40256bit.org.

Raspunde prin e-mail lui