dont crash with bad revision strings (again)
authorClaus Gittinger <cg@exept.de>
Wed, 13 Dec 1995 17:19:49 +0100
changeset 744 db7b733455b9
parent 743 8d31a7568e44
child 745 d16f199a1551
dont crash with bad revision strings (again)
Class.st
--- a/Class.st	Wed Dec 13 11:27:04 1995 +0100
+++ b/Class.st	Wed Dec 13 17:19:49 1995 +0100
@@ -263,54 +263,56 @@
     info := IdentityDictionary new.
     words := aString asCollectionOfWords.
 
-    "/
-    "/ supported formats:
-    "/
-    "/ $-Header: pathName rev date time user state $
-    "/ $-Revision: rev $
-    "/ $-Id: fileName rev date time user state $
-    "/
-
-    ((words at:1) = '$Header:') ifTrue:[
-	nm := words at:2.
-	info at:#repositoryPathName put:nm.
-	(nm endsWith:',v') ifTrue:[
-	    nm := nm copyWithoutLast:2
-	].
-	info at:#fileName put:nm asFilename baseName.
-	(words at:3) = '$' ifFalse:[
-	    info at:#revision put:(words at:3).
-	    info at:#date put:(words at:4).
-	    info at:#time put:(words at:5).
-	    info at:#user put:(words at:6).
-	    info at:#state put:(words at:7).
-	].
-	^ info
-    ].
-    ((words at:1) = '$Revision:') ifTrue:[
-	info at:#revision put:(words at:2).
-	^ info
-    ].
-    ((words at:1) = '$Id:') ifTrue:[
-	info at:#fileName put:(words at:2).
-	info at:#revision put:(words at:3).
-	info at:#date put:(words at:4).
-	info at:#time put:(words at:5).
-	info at:#user put:(words at:6).
-	info at:#state put:(words at:7).
-	^ info
+    words notEmpty ifTrue:[
+        "/
+        "/ supported formats:
+        "/
+        "/ $-Header: pathName rev date time user state $
+        "/ $-Revision: rev $
+        "/ $-Id: fileName rev date time user state $
+        "/
+
+        ((words at:1) = '$Header:') ifTrue:[
+            nm := words at:2.
+            info at:#repositoryPathName put:nm.
+            (nm endsWith:',v') ifTrue:[
+                nm := nm copyWithoutLast:2
+            ].
+            info at:#fileName put:nm asFilename baseName.
+            (words at:3) = '$' ifFalse:[
+                info at:#revision put:(words at:3).
+                info at:#date put:(words at:4).
+                info at:#time put:(words at:5).
+                info at:#user put:(words at:6).
+                info at:#state put:(words at:7).
+            ].
+            ^ info
+        ].
+        ((words at:1) = '$Revision:') ifTrue:[
+            info at:#revision put:(words at:2).
+            ^ info
+        ].
+        ((words at:1) = '$Id:') ifTrue:[
+            info at:#fileName put:(words at:2).
+            info at:#revision put:(words at:3).
+            info at:#date put:(words at:4).
+            info at:#time put:(words at:5).
+            info at:#user put:(words at:6).
+            info at:#state put:(words at:7).
+            ^ info
+        ].
     ].
 
     "/
     "/ mhmh - maybe its some other source code system
     "/
     (mgr := Smalltalk at:SourceCodeManager) notNil ifTrue:[
-	^ mgr revisionInfoFromString:aString
+        ^ mgr revisionInfoFromString:aString
     ].
     ^ nil
 
     "Created: 15.11.1995 / 14:58:35 / cg"
-    "Modified: 7.12.1995 / 13:21:40 / cg"
+    "Modified: 13.12.1995 / 17:11:28 / cg"
 ! !
 
 !Class methodsFor:'ST/V subclass creation'!
@@ -3383,6 +3385,6 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.109 1995-12-13 10:23:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.110 1995-12-13 16:19:49 cg Exp $'
 ! !
 Class initialize!