Mistake in most recent commit to cint/src/v6_new.cxx?

Looks like the – and the ++ should be reversed in the
cases for ‘<’ and ‘>’, doesn’t this code decrement an
unsigned int below zero to indicate template argument
nesting?

– Paul Russo

$ cvs diff -kk -u -r 1.22 -r 1.23 cint/src/v6_new.cxx
Index: cint/src/v6_new.cxx
===================================================================
RCS file: /user/cvs/root/cint/src/v6_new.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- cint/src/v6_new.cxx 18 Jul 2005 11:59:48 -0000      1.22
+++ cint/src/v6_new.cxx 1 Aug 2005 20:35:49 -0000       1.23
@@ -113,10 +113,24 @@
     }
   }
   if(initializer) *initializer = 0;
-  basictype = G__strrstr(type,"::");
+
+  basictype = type; 
+  {
+    unsigned int len = strlen(type);
+    unsigned int nest = 0;
+    for(unsigned int ind=len-1; ind>0; --ind) {
+      switch(type[ind]) {
+        case '<': --nest; break;
+        case '>': ++nest; break;
+        case ':': if (nest==0 && type[ind-1]==':') {
+          basictype = &(type[ind+1]);
+          ind = 1;
+          break;
+        }
+      }
+    }
+  }
   if(initializer) *initializer = '(';
-  if(!basictype) basictype = type;
-  else basictype += 2;
   typenum = G__defined_typename(type);
   if(-1!=typenum) tagnum = G__newtype.tagnum[typenum];
   else tagnum = -1;

Sorry, I just noticed that the scan is going backwards,
so the ‘>’ will be encountered first, and everything is ok.