shithub: mc

Download patch

ref: fc4fca0fa6c64a0fbe6fbb5c8faf1e5640b784ea
parent: 4770743d640a13ae81110b4161f0eb6eff9c0be1
author: Ori Bernstein <[email protected]>
date: Thu Oct 19 08:22:46 EDT 2017

If we haven't installed the proto, use the one we have.

--- a/parse/use.c
+++ b/parse/use.c
@@ -856,8 +856,9 @@
 
 	dclname = declname(dcl);
 	for (i = 0; i < tr->nproto; i++) {
-		proto = tr->proto[i];
-		proto = getdcl(curstab(), proto->decl.name);
+		proto = getdcl(curstab(), tr->proto[i]->decl.name);
+		if (!proto)
+			proto = tr->proto[i];
 		protoname = declname(proto);
 		len = strlen(protoname);
 		p = strstr(dclname, protoname);