rem: if (oldScriptsDir.exists()) { 
add: if (oldScriptsDir.exists() && oldConfigFile.exists()) { 
context: function GM_pointFourMigrate() {  GM_log("> GM_pointFourMigrate");  try {    // the following code was copied directly from the old getContentDir() and    // getScriptsDir() functions    var profDir = Components.classes["@mozilla.org/file/directory_service;1"]                            .getService(Components.interfaces.nsIProperties)                            .get("ProfD", Components.interfaces.nsILocalFile);    var contentDir = getContentDir();    var newScriptsDir = getScriptDir();    var newConfigFile = getScriptFile("config.xml");    var oldScriptsDir = contentDir.clone();    oldScriptsDir.append("scripts");    var defaultConfigFile = getContentDir();    defaultConfigFile.append("default-config.xml");    GM_log("old scripts dir exists: " + oldScriptsDir.exists());    GM_log("new scripts dir exists: " + newScriptsDir.exists());    if (oldScriptsDir.exists()) {      if (!newScriptsDir.exists()) {        oldScriptsDir.moveTo(newScriptsDir.parent, newScriptsDir.leafName);      }    } else {      if (!newScriptsDir.exists()) {        newScriptsDir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE,                             0755);      }          GM_log("new config file exists: " + newConfigFile.exists());      if (!newConfigFile.exists()) {        defaultConfigFile.copyTo(newConfigFile.parent, newConfigFile.leafName);        defaultConfigFile.permissions = 0644;      }    }  } catch (e) {    alert("Could not complete Greasemonkey 0.4 migration. Error:\n\n" + e);    throw e;  } finally {    GM_log("< GM_pointFourMigrate");  }}
meta: 9744	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9744/42e8076b2290fd1a3dc9fe7a153cb42535e50332/versioning.js/buggy/src/content/versioning.js