* Directory not recognized as directory @ 2005-11-02 14:02 DervishD 2005-11-02 18:42 ` Andrey Borzenkov 0 siblings, 1 reply; 7+ messages in thread From: DervishD @ 2005-11-02 14:02 UTC (permalink / raw) To: Zsh Workers Hi all :) In this message I will use \xNN notation for nonprintable characters, but obviously they aren't shown this way except in the $'' construct I use in the example. Any other instance should be substituted on your minds with the appropriate nonprintable character ;))))) Using version 4.2.5: $ mkdir -- $'\x90' $ stat * stat: \M-^P: no such file or directory It's because of this: stat64("\x90\xB0"...) If instead of "90" we use "91", then the added character is "B1", etc. This has two problems: first one is that the builtin "stat" fails. The second is that completion doesn't work because the offending file name is not considered a directory. OTOH, this works: $ print *(/) \x90 I'm really confused because I expected the last command to fail too, I assumed that any "stat64" call will have its first parameter mangled. Thanks in advance :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to... ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 14:02 Directory not recognized as directory DervishD @ 2005-11-02 18:42 ` Andrey Borzenkov 2005-11-02 18:56 ` DervishD 0 siblings, 1 reply; 7+ messages in thread From: Andrey Borzenkov @ 2005-11-02 18:42 UTC (permalink / raw) To: zsh-workers; +Cc: DervishD -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 02 November 2005 17:02, DervishD wrote: > Hi all :) > > In this message I will use \xNN notation for nonprintable > characters, but obviously they aren't shown this way except in the > $'' construct I use in the example. Any other instance should be > substituted on your minds with the appropriate nonprintable character > ;))))) > > Using version 4.2.5: > > $ mkdir -- $'\x90' > $ stat * > stat: \M-^P: no such file or directory > I can't reproduce it: {pts/2}% mkdir -- $'\x90' {pts/2}% stat * File: `\220' Size: 40 Blocks: 0 IO Block: 4096 Каталог ... {pts/2}% echo $ZSH_VERSION 4.2.5 - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDaQigR6LMutpd94wRAgvEAJ9wljYG5uXAHCnso0AaUqVoKDj+GQCgnNsL Xj8CxZy5DVHEMm7WqiFjVZ8= =cJj4 -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 18:42 ` Andrey Borzenkov @ 2005-11-02 18:56 ` DervishD 2005-11-02 19:24 ` Andrey Borzenkov 0 siblings, 1 reply; 7+ messages in thread From: DervishD @ 2005-11-02 18:56 UTC (permalink / raw) To: Andrey Borzenkov; +Cc: zsh-workers Hi Andrey :) * Andrey Borzenkov <arvidjaar@newmail.ru> dixit: > > Using version 4.2.5: > > > > $ mkdir -- $'\x90' > > $ stat * > > stat: \M-^P: no such file or directory > > > > I can't reproduce it: > > {pts/2}% mkdir -- $'\x90' > {pts/2}% stat * > File: `\220' > Size: 40 Blocks: 0 IO Block: 4096 ?????????????? > ... > {pts/2}% echo $ZSH_VERSION > 4.2.5 Looks like you're using "stat" from coreutils, and not builtin stat. Sorry, my fault, in my example I didn't do "builtin stat" instead of stat: $ mkdir -- $'\x90' $ builtin stat * stat: \x90: no such file or directory The output of stat is the character corresponding to 0x90, but since it is non printable I'm doing the same as in my last message and using the corresponding "print/bindkey" escape sequence. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to... ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 18:56 ` DervishD @ 2005-11-02 19:24 ` Andrey Borzenkov 2005-11-02 19:32 ` DervishD 0 siblings, 1 reply; 7+ messages in thread From: Andrey Borzenkov @ 2005-11-02 19:24 UTC (permalink / raw) To: zsh-workers; +Cc: DervishD -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 02 November 2005 21:56, DervishD wrote: > Looks like you're using "stat" from coreutils, and not builtin > stat. Sorry, my fault, No, it is my fault :) Index: Src/Modules/stat.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/stat.c,v retrieving revision 1.8 diff -u -p -r1.8 stat.c - --- Src/Modules/stat.c 18 Feb 2005 13:57:27 -0000 1.8 +++ Src/Modules/stat.c 2 Nov 2005 19:23:28 -0000 @@ -532,8 +532,8 @@ bin_stat(char *name, char **args, Option for (; OPT_ISSET(ops,'f') || *args; args++) { char outbuf[PATH_MAX + 9]; /* "link " + link name + NULL */ int rval = OPT_ISSET(ops,'f') ? fstat(fd, &statbuf) : - - OPT_ISSET(ops,'L') ? lstat(*args, &statbuf) : - - stat(*args, &statbuf); + OPT_ISSET(ops,'L') ? lstat(unmeta(*args), &statbuf) : + stat(unmeta(*args), &statbuf); if (rval) { if (OPT_ISSET(ops,'f')) sprintf(outbuf, "%d", fd); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDaRJ5R6LMutpd94wRAil/AKCOj3hPEMftGiUOh9My8XaP51jZ+wCePR1D nknu+geujFWCZbpAIjDwJII= =uQya -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 19:24 ` Andrey Borzenkov @ 2005-11-02 19:32 ` DervishD 2005-11-02 19:55 ` Andrey Borzenkov 0 siblings, 1 reply; 7+ messages in thread From: DervishD @ 2005-11-02 19:32 UTC (permalink / raw) To: Andrey Borzenkov; +Cc: zsh-workers Hi Andrey :) * Andrey Borzenkov <arvidjaar@newmail.ru> dixit: > On Wednesday 02 November 2005 21:56, DervishD wrote: > > Looks like you're using "stat" from coreutils, and not builtin > > stat. Sorry, my fault, > > No, it is my fault :) Anyway, this problem doesn't affect just the "stat" builtin. It fools the completion system (at least compctl), too. Thanks for fixing the builtin "stat" part :)) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to... ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 19:32 ` DervishD @ 2005-11-02 19:55 ` Andrey Borzenkov 2005-11-02 20:32 ` DervishD 0 siblings, 1 reply; 7+ messages in thread From: Andrey Borzenkov @ 2005-11-02 19:55 UTC (permalink / raw) To: zsh-workers; +Cc: DervishD -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 02 November 2005 22:32, DervishD wrote: > Anyway, this problem doesn't affect just the "stat" builtin. It > fools the completion system (at least compctl), too. > Could you give specific example? It seems to work in current CVS: {pts/1}% ~/pkg/bin/zsh -f cooker% ls йцукен/ notice "/" so it correctly stats directory. - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDaRmcR6LMutpd94wRAml1AJ98U34n9feiLc1IibA0YjD2Uv5JDwCaAl+9 Yt4r4Vcu/qsmJDcD/veZY74= =9L38 -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Directory not recognized as directory 2005-11-02 19:55 ` Andrey Borzenkov @ 2005-11-02 20:32 ` DervishD 0 siblings, 0 replies; 7+ messages in thread From: DervishD @ 2005-11-02 20:32 UTC (permalink / raw) To: Andrey Borzenkov; +Cc: zsh-workers Hi Andrey :) * Andrey Borzenkov <arvidjaar@newmail.ru> dixit: > > Anyway, this problem doesn't affect just the "stat" builtin. It > > fools the completion system (at least compctl), too. > > > > Could you give specific example? It seems to work in current CVS: > > {pts/1}% ~/pkg/bin/zsh -f > cooker% ls ????????????/ > > notice "/" so it correctly stats directory. In 4.2.5 the same doesn't work. The completion cycles between all files and dirs, adding a "/" to all directories *except* the "\x90" one. $ zsh -f $ mkdir A B C $'\x90' $ ls <TAB> \- ls A/<TAB> \- ls B/<TAB> \- ls C/<TAB> \- ls ^Ð I'm representing the cycle using the "\-" thingie (sorry, I couldn't think of anything better) and I hope you can see the last line, which is exactly what appears in my system, a caret and a capital "D" crossed by a line. Do you want me to test anything more? I'm a bit lost here and don't know which tests to carry to help you O:) Thanks a lot for your interest :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to... ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-11-02 20:31 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-11-02 14:02 Directory not recognized as directory DervishD 2005-11-02 18:42 ` Andrey Borzenkov 2005-11-02 18:56 ` DervishD 2005-11-02 19:24 ` Andrey Borzenkov 2005-11-02 19:32 ` DervishD 2005-11-02 19:55 ` Andrey Borzenkov 2005-11-02 20:32 ` DervishD
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).