rem: var rv = promptService.prompt(window, dialogTitle, msg, "", 0, oldName, result); 
add: var rv = promptService.prompt(window, dialogTitle, msg, newName, null, {value:0}); 
context: function RenameProfile(){  renameButton = document.getElementById("renbutton");  if( renameButton.getAttribute("disabled") == "true" )    return;  var profileTree = document.getElementById( "profiles" );  var selected = profileTree.selectedItems[0];  if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) {    // migrate if the user wants to    var lString = gProfileManagerBundle.getString("migratebeforerename");    lString = lString.replace(/\s*<html:br\/>/g,"\n");    lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName"));    var title = gProfileManagerBundle.getString("migratetitle");    if (promptService.confirm(window, title, lString))      profile.migrateProfile( profilename, true );    else      return false;  }  else {    var oldName = selected.getAttribute("rowName");    var result = { };    var dialogTitle = gProfileManagerBundle.getString("renameprofiletitle");    var msg = gProfileManagerBundle.getString("renameProfilePrompt");    msg = msg.replace(/%oldProfileName%/gi, oldName);    while (1) {      var rv = promptService.prompt(window, dialogTitle, msg, "", 0, oldName, result);      if (rv) {        var newName = result.value;        if (!newName) return false;        var invalidChars = ["/", "\\", "*", ":"];        for( var i = 0; i < invalidChars.length; i++ )        {          if( newName.indexOf( invalidChars[i] ) != -1 ) {            var aString = gProfileManagerBundle.getString("invalidCharA");            var bString = gProfileManagerBundle.getString("invalidCharB");            bString = bString.replace(/\s*<html:br\/>/g,"\n");            var lString = aString + invalidChars[i] + bString;            alert( lString );            return false;          }        }                var migrate = selected.firstChild.firstChild.getAttribute("rowMigrate");        try {          profile.renameProfile(oldName, newName);          selected.firstChild.firstChild.setAttribute( "value", newName );          selected.setAttribute( "rowName", newName );          selected.setAttribute( "profile_name", newName );        }        catch(e) {          var lString = gProfileManagerBundle.getString("profileExists");          var profileExistsTitle = gProfileManagerBundle.getString("profileExistsTitle");          promptService.alert(window, profileExistsTitle, lString);          continue;        }      }      break;    }  }  // set the button state  DoEnabling();  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/7720f48f12efeb9bfbb61cadb3af1ff6ba63aa6b/profileManager.js/buggy/profile/resources/content/profileManager.js