f4bcee8da14105fc27107d492822c87c6cfa96b9
braney
  Thu May 24 08:09:30 2012 -0700
fix bug looking at unitialized variable #8028
diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c
index dbcae4c..c7d8fc7 100644
--- src/hg/lib/trackDbCustom.c
+++ src/hg/lib/trackDbCustom.c
@@ -708,33 +708,36 @@
     cType = cfgPeak;
 else if(startsWithWord("genePred",type)
      && !startsWith("encodeGencodeRaceFrags", tdb->track))  // SPECIAL CASE should be handled in trackDb!
     cType = cfgGenePred;
 else if(sameWord("bedLogR",type)
      || sameWord("peptideMapping", type))
     cType = cfgBedScore;
 else if(startsWith("bed ", type) || startsWith("bigBed", type))
     {
     if (trackDbSetting(tdb, "bedFilter") != NULL)
            cType = cfgBedFilt;
     else
         {
        char *words[3];
         int wordCount = chopLine(cloneString( type), words);
-        if ((atoi(words[1]) >= 5 || trackDbSetting(tdb, "scoreMin") != NULL)
-        && ( wordCount >= 3                                                      // Historically needed 'bed n .'
-            || (!tdbIsTrackUiTopLevel(tdb) && trackDbSettingClosestToHome(tdb, "wgEncode")))) // but encode didn't follow bed n .
+	if ((((wordCount > 1) && (atoi(words[1]) >= 5)) || 
+	    trackDbSetting(tdb, "scoreMin") != NULL)
+		&& 
+	   // Historically needed 'bed n .' but encode didn't follow bed n .
+	   ( (wordCount >= 3) || 
+		(!tdbIsTrackUiTopLevel(tdb) && trackDbSettingClosestToHome(tdb, "wgEncode")))) 
             {
             cType = cfgBedScore;
 
             if (!bedScoreHasCfgUi(tdb))
                 cType = cfgNone;
 
             // FIXME: UGLY SPECIAL CASE should be handled in trackDb!
             else if (startsWith("encodeGencodeIntron", tdb->track))
                 cType = cfgNone;
             }
         }
     }
 else if(startsWith("chain",type))
     cType = cfgChain;
 else if (startsWith("bamWig", type))