Save As breaks when the image name ends with ..image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Save As breaks when the image name ends with ..image

Stéphane Ducasse
in 11131

if you do saveAs foo..image
then saveAs -> you get an error.

Stef

http://code.google.com/p/pharo/issues/list?cursor=1734
Fixed

splitNameVersionExtensionFor: fileName
        " answer an array with the root name, version # and extension.
        See comment in nextSequentialNameFor: for more details"

        | baseName version extension i j |

        baseName := self class baseNameFor: fileName.
        extension := self class extensionFor: fileName.
        i := j := baseName findLast: [:c | c isDigit not].
        i = 0
                ifTrue: [version := 0]
                ifFalse:
                        [(baseName at: i) = $.
                                ifTrue:
                                        [version := [(baseName copyFrom: i+1 to: baseName size) asNumber]
                                                                        on: Error do: [:ex| 0].
                                        j := j - 1]
                                ifFalse: [version := 0].
                        baseName := baseName copyFrom: 1 to: j].
        ^ Array with: baseName with: version with: extension






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project