From nobody@FreeBSD.org  Tue May 22 12:06:02 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E7D5316A400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 May 2007 12:06:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id D841513C455
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 May 2007 12:06:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4MC62o8085578
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 May 2007 12:06:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4MC116T084578;
	Tue, 22 May 2007 12:01:01 GMT
	(envelope-from nobody)
Message-Id: <200705221201.l4MC116T084578@www.freebsd.org>
Date: Tue, 22 May 2007 12:01:01 GMT
From: Raymond Pasco<ray@cultofray.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lesspipe.sh breaks on filenames containing spaces
X-Send-Pr-Version: www-3.0

>Number:         112860
>Category:       bin
>Synopsis:       [patch] lesspipe.sh breaks on filenames containing spaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    le
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 22 12:10:07 GMT 2007
>Closed-Date:    Sun May 27 10:15:53 GMT 2007
>Last-Modified:  Sun May 27 10:20:04 GMT 2007
>Originator:     Raymond Pasco
>Release:        6.2-RC2
>Organization:
>Environment:
FreeBSD nina.caedescontego.net 6.2-RC2 FreeBSD 6.2-RC2 #0: Sun Dec 24 23:17:34 UTC 2006     root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
lesspipe.sh (src/usr.bin/less/lesspipe.sh) breaks on filenames containing spaces. This is because it uses a naked $1 as the argument for decompress, gunzip, and bunzip2, where it should use "$1" instead.
>How-To-Repeat:
use lesspipe.sh or less(1) with the LESSOPEN environment variable set to use lesspipe.sh on a compressed file with spaces in its name
>Fix:
attached patch

Patch attached with submission follows:

diff -r -u src.orig/usr.bin/less/lesspipe.sh src/usr.bin/less/lesspipe.sh
--- src.orig/usr.bin/less/lesspipe.sh	Tue May 22 07:56:40 2007
+++ src/usr.bin/less/lesspipe.sh	Tue May 22 07:56:59 2007
@@ -5,12 +5,12 @@
 
 case "$1" in
 	*.Z)
-		exec uncompress -c $1	2>/dev/null
+		exec uncompress -c "$1"	2>/dev/null
 		;;
 	*.gz)
-		exec gzip -d -c $1	2>/dev/null
+		exec gzip -d -c "$1"	2>/dev/null
 		;;
 	*.bz2)
-		exec bzip2 -d -c $1	2>/dev/null
+		exec bzip2 -d -c "$1"	2>/dev/null
 		;;
 esac

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->le 
Responsible-Changed-By: le 
Responsible-Changed-When: Thu May 24 18:26:47 UTC 2007 
Responsible-Changed-Why:  
Take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112860 
State-Changed-From-To: open->patched 
State-Changed-By: le 
State-Changed-When: Thu May 24 18:28:15 UTC 2007 
State-Changed-Why:  
Thank you, your patch was committed to -CURRENT. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112860 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/112860: commit references a PR
Date: Thu, 24 May 2007 18:28:15 +0000 (UTC)

 le          2007-05-24 18:28:08 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/less         lesspipe.sh 
   Log:
   Fix handling of filenames containing whitespace.
   
   PR:      bin/112860
   MFC in:  3 days
   
   Revision  Changes    Path
   1.4       +3 -3      src/usr.bin/less/lesspipe.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: le 
State-Changed-When: Sun May 27 10:15:32 UTC 2007 
State-Changed-Why:  
MFC done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112860 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/112860: commit references a PR
Date: Sun, 27 May 2007 10:15:24 +0000 (UTC)

 le          2007-05-27 10:15:18 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     usr.bin/less         lesspipe.sh 
   Log:
   MFC:
   
      Fix handling of filenames containing whitespace.
   
      PR:      bin/112860
   
   Revision  Changes    Path
   1.2.2.2   +3 -3      src/usr.bin/less/lesspipe.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
