From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 31 15:20:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BE9A1065675 for ; Mon, 31 Mar 2008 15:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 659298FC16 for ; Mon, 31 Mar 2008 15:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2VFK22s077261 for ; Mon, 31 Mar 2008 15:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2VFK25P077260; Mon, 31 Mar 2008 15:20:02 GMT (envelope-from gnats) Date: Mon, 31 Mar 2008 15:20:02 GMT Message-Id: <200803311520.m2VFK25P077260@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: bin/118782: shar(1) sometimes creates broken archives X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 15:20:02 -0000 The following reply was made to PR bin/118782; it has been noted by GNATS. From: Jaakko Heinonen To: bkoenig@alpha-tierchen.de Cc: bug-followup@FreeBSD.org Subject: Re: bin/118782: shar(1) sometimes creates broken archives Date: Mon, 31 Mar 2008 18:10:24 +0300 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Although removing the limit from sh(1) is probably not a bad idea It doesn't help people using older releases or other operating systems. (At least NetBSD has the same 79 character limitation.) Here's a patch for shar(1) which limits the EOF marker length to maximum of 79 characters. If the marker would be longer then we use simply "END-of-file" as marker. I don't think that this code would be too complex to add. -- Jaakko --zYM0uCDKw75PZbzx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="shar-limit-eofmarker.diff" PR: bin/118782 Index: shar.sh =================================================================== RCS file: /home/ncvs/src/usr.bin/shar/shar.sh,v retrieving revision 1.3 diff -u -r1.3 shar.sh --- shar.sh 29 Aug 1997 00:44:34 -0000 1.3 +++ shar.sh 26 Mar 2008 17:51:26 -0000 @@ -70,10 +70,14 @@ echo "echo c - $i" echo "mkdir -p $i > /dev/null 2>&1" else + eofmarker="END-of-$i" + if [ ${#eofmarker} -gt 79 ]; then + eofmarker="END-of-file" + fi echo "echo x - $i" - echo "sed 's/^X//' >$i << 'END-of-$i'" + echo "sed 's/^X//' >$i << '$eofmarker'" sed 's/^/X/' $i || exit - echo "END-of-$i" + echo "$eofmarker" fi done echo exit --zYM0uCDKw75PZbzx--