shithub: grapple

Download patch

ref: 45e029037e686ea7c844f45443f03cc91cfa870a
parent: 3cf63f0f168a405f958a3dfd50358a981c7b3585
author: phil9 <[email protected]>
date: Sun Nov 21 15:22:23 EST 2021

always look for address in input lines

	address part of the regex (ie :[0-9]+) was optional leading
	to not finding a proper plumbable path in lines where the filename:addr
	pattern was not at the begginning.
	There might be a better way to match files but this will do for the time
	being.

--- a/grapple.c
+++ b/grapple.c
@@ -318,10 +318,10 @@
 	plumbfd = plumbopen("send", OWRITE|OCEXEC);
 	if(plumbfd < 0)
 		sysfatal("plumbopen: %r");
-	re = regcomp("([.a-zA-Z0-9_/+\\-]+(:[0-9]+)?)");
+	re = regcomp("([.a-zA-Z0-9_/+\\-]+:[0-9]+)");
 	getwd(pwd, sizeof pwd);
 	loadlines();
-	if(initdraw(nil, nil, "fm") < 0)
+	if(initdraw(nil, nil, "grapple") < 0)
 		sysfatal("initdraw: %r");
 	display->locking = 0;
 	if((mctl = initmouse(nil, screen)) == nil)