shithub: nc

Download patch

ref: 4f8dd50ba509dc1a908071bde962492ca360fd84
parent: b75e90e18afb5b98cc4dec00224e2a79d69ab356
author: phil9 <[email protected]>
date: Thu Dec 29 14:25:43 EST 2022

add helper to check if two models are pointing at the same directory

--- a/a.h
+++ b/a.h
@@ -121,6 +121,7 @@
 void		dirmodelcd(Dirmodel*, char*);
 void		dirmodelfilter(Dirmodel*, char*);
 long		dirmodelmarklist(Dirmodel*, Dir**);
+int			dirmodeleq(Dirmodel*, Dirmodel*);
 
 Dirpanel*	mkdirpanel(Dirmodel*);
 void		dirpanelsetrect(Dirpanel*, Rectangle);
--- a/dirmodel.c
+++ b/dirmodel.c
@@ -177,3 +177,9 @@
 	}
 	return n;
 }
+
+int
+dirmodeleq(Dirmodel *a, Dirmodel *b)
+{
+	return strcmp(a->path, b->path) == 0;
+}