From nobody@FreeBSD.org  Wed May 23 19:50:07 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 0764537B422
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 May 2001 19:50:05 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f4O2o4088056;
	Wed, 23 May 2001 19:50:04 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200105240250.f4O2o4088056@freefall.freebsd.org>
Date: Wed, 23 May 2001 19:50:04 -0700 (PDT)
From: davidx@viasoft.com.cn
To: freebsd-gnats-submit@FreeBSD.org
Subject: change truncate to support low case size suffix
X-Send-Pr-Version: www-1.0

>Number:         27604
>Category:       bin
>Synopsis:       change truncate to support low case size suffix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 23 20:00:02 PDT 2001
>Closed-Date:    Thu Jul 22 13:40:18 GMT 2004
>Last-Modified:  Thu Jul 22 13:40:18 GMT 2004
>Originator:     David Xu
>Release:        FreeBSD 4.3-stable
>Organization:
Viasoft
>Environment:
FreeBSD davidbsd.viasoft.com.cn 4.3-STABLE FreeBSD 4.3-STABLE #31: Mon May 21 09:0
7:09 CST 2001     root@davidbsd.viasoft.com.cn:/usr/src/sys/compile/xu  i386
>Description:
I found a style issue between dd and truncate, 
dd accepts size suffix 'b', 'k', 'm', 'g', all are low case,
but truncate only supports upper case, 'B', 'K', 'M', etc.
it seems truncate is new and should be compatible with dd.

>How-To-Repeat:
$truncate -s1m temp
invalid size argument 1m


>Fix:
--- truncate.c.orig     Thu May 24 10:36:34 2001
+++ truncate.c  Thu May 24 10:37:56 2001
@@ -177,12 +177,15 @@

        switch (*ls) {
        case 'G':
+       case 'g':
                oflow = length * 1024;
                ASSIGN_CHK_OFLOW(oflow, length);
        case 'M':
+       case 'm':
                oflow = length * 1024;
                ASSIGN_CHK_OFLOW(oflow, length);
        case 'K':
+       case 'k':
                if (ls[1] != '\0')
                        return -1;
                oflow = length * 1024;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Thu Jul 22 13:39:58 GMT 2004 
State-Changed-Why:  
Thanks, patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27604 
>Unformatted:
