rem:  match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/);  if (match && match.length>1) gLastHostname = match[3];  gHistoryStatus.label = url; } else { gHistoryStatus.label = ""; 
add: if (!gIOService) gIOService = Components.classes['@mozilla.org/network/io-service;1'] .getService(Components.interfaces.nsIIOService); try { gLastHostname = gIOService.newURI(url, null, null).host;  match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; } catch (e) {} 
context: function historyOnSelect(){    // every time selection changes, save the last hostname    gLastHostname = "";    gLastDomain = "";    var match;    var currentIndex = gHistoryTree.currentIndex;    var rowIsContainer = gHistoryGrouping != "none" && currentIndex >= 0 && isContainer(gHistoryTree, currentIndex);    var url = rowIsContainer ? gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL") : null;    if (url) {        // matches scheme://(hostname)...        match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/);        if (match && match.length>1)            gLastHostname = match[3];              gHistoryStatus.label = url;    }    else {        gHistoryStatus.label = "";    }    if (gLastHostname) {        // matches the last foo.bar in foo.bar or baz.foo.bar        match = gLastHostname.match(/([^.]+\.[^.]+$)/);        if (match)            gLastDomain = match[1];    }    document.commandDispatcher.updateCommands("select");}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/dda7e397aff7dd3a565f5ab53e09b65d36d96002/history.js/buggy/suite/common/history/history.js