Index: /issm/trunk/src/c/shared/String/isdistributed.cpp
===================================================================
--- /issm/trunk/src/c/shared/String/isdistributed.cpp	(revision 5330)
+++ /issm/trunk/src/c/shared/String/isdistributed.cpp	(revision 5331)
@@ -25,21 +25,18 @@
 	char* root=NULL;
 
-	/*intermediary: */
-	for(i=0;i<strlen(name);i++){
-		if (isdigit(name[i])){
-			distributed=1;
-			break;
-		}
-	}
+	/*Look at the end of the string, whether it's numeric or not: */
+	if (isdigit(name[strlen(name)-1]))distributed=1;
 
 	if(distributed){
+		
 		root=(char*)xmalloc((strlen(name)+1)*sizeof(char));
 		strcpy(root,name);
 	
-		for(i=0;i<strlen(name);i++){
+		/*Start from the end, until we find a letter, which we will, otherwise error out: */
+		for(i=strlen(name)-1;i>=0;i++){
 			if (isdigit(name[i])){
-				root[i]='\0'; //finish the string here.
-				break;
+				root[i]='\0'; //finish the string here and keep looking for a letter
 			}
+			else break;
 		}
 	}
