diff --git a/man/rem2ps.1.in b/man/rem2ps.1.in index fef18c9b..c61cf65e 100644 --- a/man/rem2ps.1.in +++ b/man/rem2ps.1.in @@ -519,8 +519,8 @@ of a comma-separated list of tags. .B info \fR{ \fIhash\fR } If any INFO clauses are present, the \fBinfo\fR key will be present. Its value will be a hash of info key-value pairs. Each key is the header -from an INFO string, \fIconverted to all upper-case\fR. The value is the -valu from the INFO string. +from an INFO string, \fIconverted to all lower-case\fR. The value is the +value from the INFO string. .RS .PP For example, the following REM command: @@ -533,8 +533,8 @@ will produce the following \fBinfo\fR hash: .PP .nf "info" : { - "LOCATION" : "Boardroom", - "SUMMARY" : "None" + "location" : "Boardroom", + "summary" : "None" }, .fi .RE diff --git a/src/calendar.c b/src/calendar.c index ecbd3518..5521b481 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -409,7 +409,7 @@ void PrintJSONString(char const *s) } } -void PrintJSONStringUC(char const *s) +void PrintJSONStringLC(char const *s) { while (*s) { switch(*s) { @@ -420,7 +420,7 @@ void PrintJSONStringUC(char const *s) case '\t': printf("\\t"); break; case '"': printf("\\\""); break; case '\\': printf("\\\\"); break; - default: printf("%c", toupper(*s)); + default: printf("%c", tolower(*s)); } s++; } @@ -2392,7 +2392,7 @@ WriteJSONInfoChain(TrigInfo *ti) value++; } printf("\""); - PrintJSONStringUC(ti->info); + PrintJSONStringLC(ti->info); printf("\":\""); PrintJSONString(value); printf("\""); diff --git a/tests/test.cmp b/tests/test.cmp index c3fc0704..df739222 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -23205,12 +23205,12 @@ Enabling test mode: This is meant for the acceptance test. Do not use --test in production. In test mode, the system time is fixed at 2025-01-06@19:00 NOTE JSONQUEUE -[{"priority":2,"eventstart":"2025-01-06T23:59","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"2025-01-06T23:58","info":{"INFO2":"Nope","INFO3":"heh"},"time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"2025-01-06T23:57","info":{"INFO":"yuppers"},"time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"2025-01-06T23:56","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}] +[{"priority":2,"eventstart":"2025-01-06T23:59","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"2025-01-06T23:58","info":{"info2":"Nope","info3":"heh"},"time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"2025-01-06T23:57","info":{"info":"yuppers"},"time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"2025-01-06T23:56","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}] NOTE ENDJSONQUEUE Enabling test mode: This is meant for the acceptance test. Do not use --test in production. In test mode, the system time is fixed at 2025-01-06@19:00 -{"response":"queue","queue":[{"priority":2,"eventstart":"2025-01-06T23:59","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"2025-01-06T23:58","info":{"INFO2":"Nope","INFO3":"heh"},"time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"2025-01-06T23:57","info":{"INFO":"yuppers"},"time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"2025-01-06T23:56","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}],"command":"QUEUE"} +{"response":"queue","queue":[{"priority":2,"eventstart":"2025-01-06T23:59","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"2025-01-06T23:58","info":{"info2":"Nope","info3":"heh"},"time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"2025-01-06T23:57","info":{"info":"yuppers"},"time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"2025-01-06T23:56","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"qid":"42424242","rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}],"command":"QUEUE"} BANNER % REM 29 MSG One -(2): Trig = Thursday, 29 February, 2024 @@ -24657,10 +24657,10 @@ February 2024 29 4 0 Sunday Monday Tuesday Wednesday Thursday Friday Saturday January 31 March 31 -{"date":"2024-02-07","filename":"-","lineno":1,"info":{"LOCATION":"here","SUMMARY":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} -{"date":"2024-02-14","filename":"-","lineno":1,"info":{"LOCATION":"here","SUMMARY":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} -{"date":"2024-02-21","filename":"-","lineno":1,"info":{"LOCATION":"here","SUMMARY":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} -{"date":"2024-02-28","filename":"-","lineno":1,"info":{"LOCATION":"here","SUMMARY":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} +{"date":"2024-02-07","filename":"-","lineno":1,"info":{"location":"here","summary":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} +{"date":"2024-02-14","filename":"-","lineno":1,"info":{"location":"here","summary":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} +{"date":"2024-02-21","filename":"-","lineno":1,"info":{"location":"here","summary":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} +{"date":"2024-02-28","filename":"-","lineno":1,"info":{"location":"here","summary":"Nope"},"wd":["Wednesday"],"priority":5000,"body":"Meeting"} # rem2ps2 end -stdin-(1): Invalid INFO string: Must be of the form "Header: Value" -stdin-(2): Invalid INFO string: Must be of the form "Header: Value"