shithub: pdffs

Download patch

ref: 8996ad534b7910c447deca0e3922917b0f1dc5cf
parent: b4a79ae0689d180927fd1869b5b1725459408265
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Aug 11 11:06:48 EDT 2023

fix printing of objects by id

--- a/main.c
+++ b/main.c
@@ -137,11 +137,17 @@
 			v = nil;
 			break;
 		}else if(argv[i][0] == '@' && isdigit(argv[i][1])){
+			memset(&o, 0, sizeof(o));
 			o.ref = 1;
 			o.pdf = pdf;
 			o.type = Oindir;
 			o.indir.id = atoi(argv[i]+1);
-			pdfeval(&o);
+			if((v = pdfeval(&o)) == nil){
+				v = &null;
+				break;
+			}
+			print("%O\n", v);
+			v = nil;
 		}else{
 			v = dictget(v, argv[i]);
 		}