rem: if (path[0] == '~') 
add: try { file = sfile.clone().QueryInterface(nsILocalFile); } catch(e) { dump("Couldn't clone\n"+e); return false; }  var tilde_file = file.clone(); tilde_file.append("~"); if (path[0] == '~' && !(path == "~" && tilde_file.exists()) && (path.length == 1 || path[1] == "/")) 
context: function processPathEntry(path, fileArray){  var filePath;  var file;  if (path[0] == '~')     filePath = homeDir.path + path.substring(1);  else    filePath = path;  // Unescape quotes  filePath = filePath.replace(/\\\"/g, "\"");    try{    file = sfile.clone().QueryInterface(nsILocalFile);  } catch(e) {    dump("Couldn't clone\n"+e);    return false;  }  if (filePath[0] == '/')   /* an absolute path was entered */    file.initWithPath(filePath);  else if ((filePath.indexOf("/../") > 0) ||           (filePath.substr(-3) == "/..") ||           (filePath.substr(0,3) == "../") ||           (filePath == "..")) {    /* appendRelativePath doesn't allow .. */    try{      file.initWithPath(file.path + "/" + filePath);    } catch (e) {      dump("Couldn't init path\n"+e);      return false;    }  }  else {    try {      file.appendRelativePath(filePath);    } catch (e) {      dump("Couldn't append path\n"+e);      return false;    }  }  fileArray[fileArray.length] = file;  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/649f02d0edbc3e2a6ae52d15a2890b3a08c87ca3/filepicker.js/buggy/toolkit/components/filepicker/content/filepicker.js