Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: escaped spaces in bookmark paths



It look like _urls has problems expanding
bookmarks containing spaces :

% cat .zsh/urls/bookmark/f\ o\ o/bar
http://www.foobar.org/
% netscape bookmark:f<TAB>
% netscape bookmark:f\ o\ o/<TAB>
% netscape bookmark:f\ o\ o/bar<TAB>    # <- don't substitute in
                                        # % netscape http://www.foobar.org

Is `(Q)' the right way to cope with this?

Index: Completion/User/_urls
--- Completion/User/_urls Fri, 31 Dec 1999 13:32:44 +0100 Alexandre
+++ Completion/User/_urls Thu, 06 Jan 2000 11:04:52 +0100 Alexandre
@@ -85,11 +85,11 @@
     fi
   ;;
   bookmark)
-    if [[ -f "$urls_path/$scheme/$PREFIX$SUFFIX" &&
-	  -s "$urls_path/$scheme/$PREFIX$SUFFIX" ]]; then
+    if [[ -f "$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" &&
+	  -s "$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" ]]; then
       _wanted -C bookmark bookmarks expl bookmarks &&
           compadd "$expl[@]" "$@" -QU - \
-              "$ipre$(<"$urls_path/$scheme/$PREFIX$SUFFIX")" && ret=0
+              "$ipre$(<"$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}")" && ret=0
     else
       if _wanted -C bookmark files expl 'bookmark'; then
         _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && 


-- 
Alexandre Duret-Lutz



Messages sorted by: Reverse Date, Date, Thread, Author