delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/04/22/23:17:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type; q=dns; s=default; b=NLQ0rR
YxaX+UtntMKXgULvvHkow5xY2VfluYjaOiOubyI+2rs7DTtGqB8uyvV9wUhuWBYi
5xnaC8TjgvbGvduCTw9mvcHW6qm/cP1/g02dgfC69oQjkU1fivJFuAeQvDjHvb38
6Fm2b673C5y2FQRlXkIW6Jg+1qrc3NsZcyfk8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type; s=default; bh=cAC+cejIwbOY
p5toDRiTyQ3LUx8=; b=SxaDMgw5Yv1DHZiRDHpin+xEiPRfwWVWMtNwDdx8h+Sb
wCc6RDAoJgMjLdL2RNPAXtMttulY/JL+IRmYXr5zFDyna2w7x+wyOXiZGb6PMBTk
gzIP2zrbe7af1szaD8rYdCrikTE2f06zamPeO+XLgczO38zx50avycPZ9p5L3UY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: mx1.redhat.com
Message-ID: <5538641A.1090002@redhat.com>
Date: Wed, 22 Apr 2015 21:16:42 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.35: .sh script in dos format does not work.
References: <235472002 DOT 6091440 DOT 1429465717870 DOT JavaMail DOT yahoo AT mail DOT yahoo DOT com> <55351612 DOT 1040803 AT redhat DOT com> <ca8501d07d42$ad751770$085f4650$@gmail.com>
In-Reply-To: <ca8501d07d42$ad751770$085f4650$@gmail.com>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes

--5an0WxNm8apGRcC1xMtJUpHfVr8M8s5vH
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/22/2015 03:24 PM, cyg Simple wrote:
>> From: Eric Blake
>>
>> It looks like something is going wrong with lseek() mixed with text-mode
>> mounts.
>>
>=20
> I thought lseek was reserved for binary only channels due to the loss of =
character count because of the CRLF to LF translation.

[you may want to teach your mailer to wrap long lines]

lseek works on files opened in text mode - BUT it only works to the
underlying offset in the file.  You are correct that if you read() 500
bytes, and then try to seek relative to current offset backwards by 100
bytes, that you have to be careful of whether you meant 100 bytes of
text read (but possibly more than 100 bytes when you include \r), or 100
bytes of offset (but possibly less than 100 bytes read because \r was
stripped).

What I haven't yet determined is if the bug lies in bash, for using
lseek() with the wrong numbers on a text mode file, or in cygwin itself,
for not properly handling file repositioning of stdin after flush()
prior to fork(), when stdin is in text mode.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--5an0WxNm8apGRcC1xMtJUpHfVr8M8s5vH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVOGQaAAoJEKeha0olJ0Nqqr4H/iQFU07bKWCu5uZGbv5WT58+
rh0IZW00wkRagZass+WsLtqWC9dsxwI55K3jTn4jYpMfEptr0GgyIFGIPUvgkcv/
uMdLzsmZNGCnfLxxDdM4lYBOo17tYuHMLK+FFeTqyBGBpt8Ghs+sb1waYxK4Jxoc
82LH2tidkepOQ+vSSgiR6SG9PAgspwdl0gN5KLFjeBHgDsop+ijM74hj5KM2iMZl
rFqHyGiQZpD+VB/DzrMdbCgtJkYCTdJtZcHHdJH2u1AQrmZccSZ1VXxmkG3+WyC2
vGKzTcRC5DWBZN8fZY+M9llZzlJm+3KyZD2QR0bYbuiiFWKzydp6PUowDTqdUIQ=
=xRd7
-----END PGP SIGNATURE-----

--5an0WxNm8apGRcC1xMtJUpHfVr8M8s5vH--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019