public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Under Cygwin ZSH, "diff -" fails unless forced into text mode
@ 2008-07-16 21:19 Gerald.Williams
  0 siblings, 0 replies; only message in thread
From: Gerald.Williams @ 2008-07-16 21:19 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]

Does anyone know why, under Cygwin ZSH, the following fails?

 zsh% cat foo | diff - foo
 diff: -: Illegal seek
 zsh%

It passes if I force it into text mode:

 zsh% cat foo | diff -a - foo
 zsh%

And of course it works in bash:

 bash% cat foo | diff - foo
 bash%

It doesn't matter whether I'm running under a console window or
in RXVT, and experimenting with $LANG didn't seem to make any
difference. I do not see this problem on various flavors of Unix
(with various versions of ZSH: 3.0.8 through 4.2.0).

---

I imagine this probably relates to the following:

 zsh% set | grep ZSH
 Binary file (standard input) matches
 zsh% set | grep -a ZSH
 ZSH_NAME=zsh
 ZSH_VERSION=4.3.4
 zsh%

which of course also works correctly in bash:

 bash% set | grep BASH
 BASH=/usr/bin/bash
 BASH_ARGC=()
 BASH_ARGV=()
 BASH_LINENO=()
 BASH_SOURCE=()
 BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="19" [4]="release" [5]="i686-pc-cygwin")
 BASH_VERSION='3.2.39(19)-release'
 bash%

I get similar behavior on Linux, although that's caused by
Unicode (I think). I have at times been able to fix it in
Linux by playing around with $LANG, although I don't seem
to be able to fix it that way under Cygwin.

---

Am I forgetting the trick to make these pipes work without
the forced text conversions? It seems like there's also an
issue with diff it it's trying to seek on a pipe, even if
it *does* think it's binary. :-)

-Jerry

P.S. cygcheck.out attached, if anyone needs it.

[-- Attachment #2: cygcheck.out --]
[-- Type: application/octet-stream, Size: 76682 bytes --]

[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-16 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-16 21:19 Under Cygwin ZSH, "diff -" fails unless forced into text mode Gerald.Williams

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 read-only IMAP folder(s) and NNTP newsgroup(s).