rem: input  = homeDir.path+ input.substring(1); 
add: input  = homeDir.unicodePath + input.substring(1); 
context: function onOK(){  var ret = nsIFilePicker.returnCancel;  var isDir = false;  var isFile = false;  var input = textInput.value;  if (input[0] == '~') // XXX XP?    input  = homeDir.path+ input.substring(1);  var file = sfile.clone().QueryInterface(nsILocalFile);  if (!file)    return false;  /* XXX we need an XP way to test for an absolute path! */  if (input[0] == '/')   /* an absolute path was entered */    file.initWithPath(input);  else {    try {      file.appendRelativePath(input);    } catch (e) {      dump("Can't append relative path '"+input+"':\n");      return false;    }  }  if (!file.exists() && (filePickerMode != nsIFilePicker.modeSave)) {    return false;  }  if (file.exists()) {    isDir = file.isDirectory();    isFile = file.isFile();  }  switch(filePickerMode) {  case nsIFilePicker.modeOpen:    if (isFile) {      retvals.directory = file.parent.path;      ret = nsIFilePicker.returnOK;    } else if (isDir) {      if (!sfile.equals(file)) {        gotoDirectory(file);      }      textInput.value = "";      doEnabling();      ret = nsIFilePicker.returnCancel;    }    break;  case nsIFilePicker.modeSave:    if (isFile) { // can only be true if file.exists()      // we need to pop up a dialog asking if you want to save      rv = window.confirm(file.path + " " + bundle.GetStringFromName("confirmFileReplacing"));      if (rv) {        ret = nsIFilePicker.returnReplace;        retvals.directory = file.parent.path;      } else {        ret = nsIFilePicker.returnCancel;      }    } else if (isDir) {      if (!sfile.equals(file)) {        gotoDirectory(file);      }      textInput.value = "";      doEnabling();      ret = nsIFilePicker.returnCancel;    } else {      var parent = file.parent;      if (parent.exists() && parent.isDirectory()) {        ret = nsIFilePicker.returnOK;        retvals.directory = parent.path;      } else {        // See bug 55026, do nothing for now, leaves typed text as clue.        // window.alert("Directory "+parent.path+" doesn't seem to exist, can't save "+file.path);        ret = nsIFilePicker.returnCancel;      }    }    break;  case nsIFilePicker.modeGetFolder:    if (isDir) {      retvals.directory = file.parent.path;    } else { // if nothing selected, the current directory will be fine      retvals.directory = sfile.path;    }    ret = nsIFilePicker.returnOK;    break;  }  retvals.file = file;  retvals.buttonStatus = ret;  if (ret == nsIFilePicker.returnCancel)    return false;  else    return true;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/44aeb3ecf349662dbf6f26130070985bd7ca6d24/filepicker.js/clean/xpfe/components/filepicker/res/content/filepicker.js