zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@m17n.org>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: completion problem with filename including # (and pathmax stuff)
Date: 05 Aug 2000 06:51:33 +0900	[thread overview]
Message-ID: <hvo66pgu23e.fsf@serein.m17n.org> (raw)
In-Reply-To: <200008031330.PAA22832@beta.informatik.hu-berlin.de> (Sven Wischnowsky's message of "Thu, 3 Aug 2000 15:30:56 +0200 (MET DST)")

In article <200008031330.PAA22832@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> Rats. I had tried some others, too, but missed (inter alia) these two.

\ has the problem yet.

Z(2):akr@flux% Src/zsh -f  
flux% bindkey -e; autoload -U compinit; compinit -D
flux% mkdir -p '\ab/cd'
flux% ls \\<TAB>

This completes nothing.

I made a test to check this problem and found other problems.

flux% mkdir -p '=ab/cd'
flux% ls \=<TAB>
_path_files:327: * not found

Note that the completion with = behaves curiously as follows.

flux% ls ./=<TAB>
flux% ls ./\=ab/<TAB>
flux% ls ./=ab/cd/

Also note that metafied characters (0x83 to 0x9c) is printed in
metafied form.

The test is follows but I'll not commit it because I feel it's too
slow.  It spends over two minutes on my machine until first test
(0x00 - 0x7f) is failed.

Index: 53completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/53completion.ztst,v
retrieving revision 1.7
diff -u -r1.7 53completion.ztst
--- 53completion.ztst	2000/07/17 10:36:00	1.7
+++ 53completion.ztst	2000/08/04 21:33:47
@@ -13,8 +13,61 @@
   touch file1
   touch file2
 
+  cd dir1
+  setopt braceccl
+  dirs=()
+  for x in {0-9a-f}{0-9a-f}
+  do
+    if [[ $x == 00 || $x == 2f ]]; then continue; fi
+    eval "ch=\$'\\x$x'"
+    dirs=("$dirs[@]" "./${ch}ab")
+  done
+  mkdir $dirs ${^dirs}/cd      
+  cd ..
+
+  special_character_test() {
+    sp_input=''
+    sp_output=''
+    for x in "$@" # {0-9a-f}{0-9a-f}
+    do
+      eval "ch=\$'\\x$x'"
+      case $x in
+      00|2f) continue;; # filename cannot contain `\0' or `/'.
+      09) ch_input=$'\\\C-v'"$ch" ch_output="\\$ch";;
+      0a) continue;; # cannot input `\n'.
+      0[1-8b-f]|1[0-9a-f]|7f) ch_input=$'\C-v'"$ch" ch_output="$ch";;
+      2[012346789a]|3[bcdef]|5[bcde]|60|7[bcde]) ch_input="\\$ch" ch_output="\\$ch";;
+      *) ch_input="$ch" ch_output="$ch";;
+      esac
+      sp_input="$sp_input: $ch_input"$'\t\t\C-u'
+      sp_output="${sp_output}line: {: ${ch_output}ab/}{}"$'\n'"line: {: ${ch_output}ab/cd/}{}"$'\n'
+    done
+  }
+ 
+  special_character_test {0-7}{0-9a-f}
+  sp_input1="$sp_input"
+  sp_output1="$sp_output"
+
+  special_character_test {89a-f}{0-9a-f}
+  sp_input2="$sp_input"
+  sp_output2="$sp_output"
+
 %test
 
+  # stty is required to input C-c, C-q and C-s.
+  comptesteval $'stty intr "" stop "" start ""'
+  comptesteval $'cd dir1'
+  comptest "$sp_input1"
+  echo
+0q:filename with special characters (0x00 - 0x7f)
+>$sp_output1
+
+  comptest "$sp_input2"
+  echo
+0q:filename with special characters (0x80 - 0xff)
+>$sp_output2
+
+  comptesteval 'cd ..'
   comptest $': \t\t\t\t\t\t\t'
 0:directories and files
 >line: {: }{}
-- 
Tanaka Akira



  parent reply	other threads:[~2000-08-04 21:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-03 13:30 Sven Wischnowsky
2000-08-03 14:38 ` Clint Adams
2000-08-03 14:53   ` Clint Adams
2000-08-04 21:51 ` Tanaka Akira [this message]
2000-08-04  7:01 Sven Wischnowsky
2000-08-04  7:16 ` Bart Schaefer
2000-08-04  7:38   ` Bart Schaefer
2000-08-04 10:47   ` Andrej Borsenkow
2000-08-04 13:35     ` Clint Adams
2000-08-04  7:42 Sven Wischnowsky
2000-08-04 13:38 ` Clint Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hvo66pgu23e.fsf@serein.m17n.org \
    --to=akr@m17n.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).