diff options
| author | Alban Gruin | 2021-09-20 10:08:15 +0200 | 
|---|---|---|
| committer | Alban Gruin | 2021-09-20 10:08:15 +0200 | 
| commit | 9522c817654c435f1929f4a37961780346406cf7 (patch) | |
| tree | 66c4c37d26eb61c2bb26e38e3cff7ce1e07b5083 /src | |
| parent | 04e2797550154f1567bbe2ede09d6961cd7da71b (diff) | |
ics: fix issues with EOLs
End of lines in iCalendar files should be CRLF, but some (most?) lines
generated by µCS were LF.  This changes that.
Signed-off-by: Alban Gruin <alban at pa1ch dot fr>
Diffstat (limited to 'src')
| -rw-r--r-- | src/ics.ml | 22 | 
1 files changed, 11 insertions, 11 deletions
| @@ -56,9 +56,9 @@ module Event = struct       "SUMMARY:" ^ event.summary;       "COMMENT:" ^ String.concat ", " event.groups;       "LOCATION:" ^ event.location; -     "END:VEVENT\n"] +     "END:VEVENT\r\n"]      |> List.map ics_split_line -    |> String.concat "\n" +    |> String.concat "\r\n"    let has_groups groups event =      List.fold_left (fun found group -> @@ -76,11 +76,11 @@ let filter_groups groups =  let gen_vtimezone tz =    if tz <> "" then -  ["BEGIN:VTIMEZONE"; -   "TZID:" ^ tz; -   "END:VTIMEZONE\n"] -  |> List.map ics_split_line -  |> String.concat "\n" +    ["BEGIN:VTIMEZONE"; +     "TZID:" ^ tz; +     "END:VTIMEZONE\r\n"] +    |> List.map ics_split_line +    |> String.concat "\r\n"    else      "" @@ -97,9 +97,9 @@ let to_string tz events =      | [] -> str      | event :: l ->         gen_events (id + 1) (str ^ Event.to_string date event id) l in -  "BEGIN:VCALENDAR\n\ -   VERSION:2.0\n\ -   PRODID:-//ucs//\n" +  "BEGIN:VCALENDAR\r\n\ +   VERSION:2.0\r\n\ +   PRODID:-//ucs//\r\n"    ^ vtimezone    ^ gen_events 0 "" events -  ^ "END:VCALENDAR\n" +  ^ "END:VCALENDAR\r\n" | 
