shithub: vcardfs

Download patch

ref: ff810eacaefe6dc6544b8f98862961eec8cb490b
parent: 9ee4eb9c230281c0b6dee6854279099e983e60c8
author: sirjofri <sirjofri@sirjofri.de>
date: Tue Oct 22 07:15:42 EDT 2024

remove group file

--- a/vcardfs.c
+++ b/vcardfs.c
@@ -807,6 +807,25 @@
 }
 
 static void
+rmgroup(Req *r, File *f)
+{
+	Vfile *vf = f->aux;
+	Vfile *cf = vf->cardfile;
+	Vline *l = vf->line;
+	
+	if (cf->serialized)
+		free(cf->serialized);
+	cf->serialized = nil;
+	
+	if (l->group)
+		free(l->group);
+	l->group = nil;
+	condrenameline(f->parent);
+	vf->line = nil;
+	respond(r, nil);
+}
+
+static void
 fsremove(Req *r)
 {
 	Vfile *vf;
@@ -820,7 +839,8 @@
 		rmline(r, r->fid->file);
 		return;
 	case Qgroup:
-		break;
+		rmgroup(r, r->fid->file);
+		return;
 	case Qparamdata:
 		rmparam(r, vf);
 		return;
@@ -828,7 +848,6 @@
 		respond(r, "remove prohibited");
 		return;
 	}
-	respond(r, nil);
 }
 
 Srv fs = {