shithub: pdffs

Download patch

ref: b22596ba7641a3f996b53ced14906e212a84220e
parent: 18644a4682e18842c7b0f8d6f28c2a2356ba142f
author: Noam Preil <noam@pixelhero.dev>
date: Wed Nov 30 11:10:26 EST 2022

parse: ignore escaped newlines in strings

--- a/string.c
+++ b/string.c
@@ -99,7 +99,12 @@
 				c = strtol(oct, nil, 8);
 			}else if(c <= nelem(esc) && esc[c] != 0){
 				c = esc[c];
-			}else if(c < 0){
+			}else if(c == '\r'){
+				c = Sgetc(stream);
+				if(c != '\n')
+					Sungetc(stream);
+				continue;
+			}else if(c == '\n' || c < 0){
 				continue;
 			}
 			break;