rem: "FROM moz_downloads "; for (var i = 0; i < terms.length; i++) { if (terms[i] == "") continue; sql += i == 0 ? "WHERE " : "OR ";   sql += "name LIKE '%" + terms[i] + "%' "; } sql += "AND state != ?1 " + "AND state != ?2 " + "ORDER BY endTime ASC"; 
add: "FROM moz_downloads WHERE name LIKE ?1 ESCAPE '/' " + "AND state != ?2 AND state != ?3 ORDER BY endTime ASC"; 
context: function buildDownloadListWithSearch(aTerms){  gSearching = true;  gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("searchlabel");  // remove and trailing or leading whitespace first  aTerms = aTerms.replace(/^\s+|\s+$/, "");  if (aTerms.length == 0) {    gSearching = false;    gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("completedlabel");    buildDefaultView();    return;  }  var terms = aTerms.split(" ");  if (terms.length == 0)    return;  var sql = "SELECT id, target, name, source, state, startTime " +            "FROM moz_downloads ";  for (var i = 0; i < terms.length; i++) {    if (terms[i] == "") continue;    sql += i == 0 ? "WHERE " : "OR ";    // We cannot actually bind parameter because it will not pick up the    // parameter if we give it '%?1%', and we can't add spaces :(    sql += "name LIKE '%" + terms[i] + "%' ";  }  sql += "AND state != ?1 " +         "AND state != ?2 " +         "ORDER BY endTime ASC";  var db = gDownloadManager.DBConnection;  var stmt = db.createStatement(sql);  try {    stmt.bindInt32Parameter(0, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING);    stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);    buildDownloadList(stmt, gDownloadsOtherTitle);  } finally {    stmt.reset();  }}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/78faa1b4d63b5b427e20202ffea8fde45ef86bd7/downloads.js/buggy/toolkit/mozapps/downloads/content/downloads.js