src/hg/lib/customTrack.c 1.175
1.175 2009/02/13 01:34:07 galt
fix for customTrack when numbers appear in the middle of the track name
Index: src/hg/lib/customTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/customTrack.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -b -B -U 4 -r1.174 -r1.175
--- src/hg/lib/customTrack.c 3 Sep 2008 19:19:21 -0000 1.174
+++ src/hg/lib/customTrack.c 13 Feb 2009 01:34:07 -0000 1.175
@@ -289,13 +289,24 @@
for (ct = ctList; ct != NULL; ct = ct->next)
{
if (isDefaultTrack(ct))
{
- char *p = skipToNumeric(ct->tdb->shortLabel);
+ char *p = ct->tdb->shortLabel;
+ seqNum = 0;
+ while (seqNum == 0)
+ {
+ p = skipToNumeric(p);
if (*p)
- seqNum = sqlSigned(skipToNumeric(ct->tdb->shortLabel));
+ {
+ char *q = skipNumeric(p);
+ if (*q)
+ p = q;
+ else
+ seqNum = sqlSigned(p);
+ }
else
seqNum = 1;
+ }
maxFound = max(seqNum, maxFound);
}
}
ct_nextDefaultTrackNum = maxFound + 1;