# HG changeset patch # User Claus Gittinger # Date 1237282408 -3600 # Node ID f916f680f75f018a66419d1c17c201aa30c91516 # Parent 4c6bedf19f55fee6fc2b0f1b064a7d785557b7fa comment diff -r 4c6bedf19f55 -r f916f680f75f DropObject.st --- a/DropObject.st Sun Mar 15 05:12:03 2009 +0100 +++ b/DropObject.st Tue Mar 17 10:33:28 2009 +0100 @@ -432,17 +432,19 @@ ! isPrintable - "return false if file contains nonprintable characters" + "return true if file contains only printable characters (in the first 300 bytes)" - |stream buff size| + |nChars stream buff size| + + nChars := 300. isPrintable isNil ifTrue:[ isPrintable := false. (info isNil or:[ self isDirectory ]) ifFalse:[ stream := theObject readStreamOrNil. stream notNil ifTrue:[ - buff := String new:300. - size := stream nextBytes:300 into:buff. + buff := String new:nChars. + size := stream nextBytes:nChars into:buff. stream close. 1 to:size do:[:i | (buff at:i) isPrintable ifFalse:[ @@ -522,5 +524,5 @@ !DropObject class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.18 2009-01-14 20:55:24 cg Exp $' + ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.19 2009-03-17 09:33:28 cg Exp $' ! !