rem:  while ((i < totalLines) && (tmpEventFields == null)) { tmpEventFields = multiLineEventEndRegExp(lines[i]); if (tmpEventFields == null) eventFields[23] = eventFields[23] + "\n" + lines[i]; i++; 
add:   var regExpStr = "^"; for( var i = 1; i < header.length; i++ ) { if( i != 1 ) regExpStr += ","; if( i == args.descriptionIndex ) regExpStr += "(.*?(?:[\\s\\S]*?).*?)"; else regExpStr += "(.*?)"; 
context: function parseOutlookCSVData( outlookCsvStr ){  var lines = outlookCsvStr.split("\n");  var totalLines = lines.length-1;    var oneLineEventRegExp =        /^"(.*)","(.*)","(.*)","(.*)","(.*)","(True|False)","(True|False)","([^"]*)","([^"]*)",("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("(.*)"|),("(.*)"|),("(.*)"|),"(Normal|Low|High)","(True|False)",("(.*)"|),"(\d)"/;  var multiLineEventStartRegExp = /^"(.*)","(.*)","(.*)","(.*)","(.*)","(True|False)","(True|False)","([^"]*)","([^"]*)",("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("([^"]*)"|),("(.*))/;  var multiLineEventEndRegExp =   /^([^"]*)",("(.*)"|),("(.*)"|),"(Normal|Low|High)","(True|False)",("(.*)"|),"(\d)"/;    //arrays for storing values from regexps  var eventFields;  var tmpEventFields;  var formater = new DateFormater();   var sDate;  var eDate;  var alarmDate;    var calendarEvent;  var eventArray = new Array();  var dupArray = new Array();  for (var lineIndex = 1; lineIndex < totalLines; lineIndex++) {     eventFields = oneLineEventRegExp(lines[lineIndex]);    if (eventFields == null) {          // this is not singleline event      eventFields = multiLineEventStartRegExp(lines[lineIndex]);      if (eventFields != null) {        // this is a multiline event        tmpEventFields = null;        var i = lineIndex+1;        // read lines until end-of-event is found:        while ((i < totalLines) && (tmpEventFields == null)) {          tmpEventFields = multiLineEventEndRegExp(lines[i]);          if (tmpEventFields == null)            eventFields[23] = eventFields[23] + "\n" + lines[i]; //add line to Description-field          i++;        }        if (tmpEventFields != null) {          //found the end of this multiline event          eventFields[23] = eventFields[23] + "\n" + tmpEventFields[1];          eventFields = eventFields.concat(tmpEventFields.slice(2));                  } else  {          //end-of-data before end-of-event (event is invalid)          eventFields = null;         }      }     }    // At this point eventFields is either null or contains following fields    //  1:subject, 2:start date, 3:start time, 4:end date, 5:end time,     //  6: all day?, 7:alarm?, 8:alarm date, 9:alarm time, 11:organizer,     //  13: req. attendees, 15:optional attendees, 17:Resources,     //  19:Billing info, 21:Categories, 23:Notes, 25:location, 27:Mileage,     //  28:Priority, 29:Private? 31:Privacy, 32:Show time as      if(eventFields != null) {      //parseShortDate magically decides the format (locale) of dates/times      sDate = formater.parseShortDate(eventFields[2] + " " + eventFields[3]);      eDate = formater.parseShortDate(eventFields[4] + " " + eventFields[5]);      if ((sDate != null) && (eDate != null)) {        alarmDate = formater.parseShortDate(eventFields[8] + " " + eventFields[9]);        calendarEvent = createEvent();        calendarEvent.id = createUniqueID();        calendarEvent.title = eventFields[1];        calendarEvent.description = eventFields[23];        calendarEvent.location = eventFields[25];        calendarEvent.start.setTime(sDate);        calendarEvent.end.setTime(eDate);        calendarEvent.allDay = (eventFields[6] == "True");        calendarEvent.privateEvent = (eventFields[29] == "True");        calendarEvent.categories = eventFields[21];        calendarEvent.alarm = (eventFields[7] == "True");        calendarEvent.alarmLength = Math.round((sDate - alarmDate)/kDate_MillisecondsInMinute);        calendarEvent.alarmUnits = "minutes";        calendarEvent.setParameter("ICAL_RELATED_PARAMETER", "ICAL_RELATED_START");        if (entryExists(sDate, calendarEvent.title))          dupArray[ dupArray.length ] = calendarEvent;        else          eventArray[ eventArray.length ] = calendarEvent;      }    }  }  return { calendarEventArray: eventArray, calendarDuplicateArray: dupArray };}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d22209de4b1da7216929b6e7a331f09513ab6a6c/importExport.js/buggy/calendar/resources/content/importExport.js