rem: if (firstSlash >= 0) url = "http: url.substring(firstSlash + 1, url.length); else url = "http: 
add: var existingSuffix = url.indexOf(suffix.substring(0, suffix.length - 1));         if (firstSlash >= 0) { if (existingSuffix == -1 || existingSuffix > firstSlash) url = url.substring(0, firstSlash) + suffix + url.substring(firstSlash + 1); } else url = url + (existingSuffix == -1 ? suffix : "/");  url = "http: 
context: function canonizeUrl(aTriggeringEvent, aPostDataRef) {  if (!gURLBar || !gURLBar.value)    return;  var url = gURLBar.value;  // Only add the suffix when the URL bar value isn't already "URL-like".  // Since this function is called from handleURLBarCommand, which receives  // both mouse (from the go button) and keyboard events, we also make sure not  // to do the fixup unless we get a keyboard event, to match user expectations.  if (!/^(www|http)|\/\s*$/i.test(url) &&      (aTriggeringEvent instanceof KeyEvent)) {#ifdef XP_MACOSX    var accel = aTriggeringEvent.metaKey;#else    var accel = aTriggeringEvent.ctrlKey;#endif    var shift = aTriggeringEvent.shiftKey;    var suffix = "";    switch (true) {      case (accel && shift):        suffix = ".org/";        break;      case (shift):        suffix = ".net/";        break;      case (accel):        try {          suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix");          if (suffix.charAt(suffix.length - 1) != "/")            suffix += "/";        } catch(e) {          suffix = ".com/";        }        break;    }    if (suffix) {      // trim leading/trailing spaces (bug 233205)      url = url.replace(/^\s+/, "").replace(/\s+$/, "");      // Tack www. and suffix on.  If user has appended directories, insert      // suffix before them (bug 279035).  Be careful not to get two slashes.      var firstSlash = url.indexOf("/");      if (firstSlash >= 0)        url = "http://www." + url.substring(0, firstSlash) + suffix +              url.substring(firstSlash + 1, url.length);      else        url = "http://www." + url + suffix;    }  }  gURLBar.value = getShortcutOrURI(url, aPostDataRef);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/fe09b5851f274b5f0efc6c83d14193a5285c2136/browser.js/buggy/browser/base/content/browser.js