shithub: unionfs

Download patch

ref: afe34cba9ac5b1721293ff06a5b36deb8d1a37b3
parent: 56f73b3e05d5a3866377f1c20dbf2ad35804772d
author: kvik <kvik@a-b.xyz>
date: Sun May 30 11:38:09 EDT 2021

Fix String shenanigans

--- a/unionfs.c
+++ b/unionfs.c
@@ -108,7 +108,7 @@
 	f->qid = (Qid){0, 0, QTDIR};
 	f->qid = qencode(f);
 	f->path = s_copy(f->name);
-	f->realpath = s_copy(f->name);
+	f->realpath = s_new();
 	
 	r->fid->aux = f;
 	r->fid->qid = f->qid;
@@ -119,8 +119,10 @@
 String*
 walk(String *s, char *n0, char *n1)
 {
-	s_putc(s, '/'); s_append(s, n0);
-	s_putc(s, '/'); s_append(s, n1);
+	s_append(s, "/");
+	s_append(s, n0);
+	s_append(s, "/");
+	s_append(s, n1);
 	cleanname(s->base);
 	s->ptr = s->base + strlen(s->base);
 	return s;