agendafs

A filesystem for your calendar.

git clone git://mccd.space/agendafs
commit 773aee66bd3661ee474f5f5802b7566d0f7f7944
parent 113f3b86326fe382691c1dbefeb054fa6b8d0623
Author: Marc Coquand <marc@coquand.email>
Date:   Mon, 28 Jul 2025 13:01:17 +0200

Make file extension optional

Diffstat:
Magendafs.8.scd | 4++--
Mfuse_node.c | 7++++++-
Mfuse_node_store.c | 2+-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/agendafs.8.scd b/agendafs.8.scd
@@ -22,8 +22,8 @@ are agendafs specific options:
 	Use the specified vdir storage path as mountpoint. Currently
 	only one calendar is supported. Required.
 *ext=*_fileextension_
-	When files are created outside of agendafs, a file extension
-	is set. Defaults to txt.
+	Automatically assign a file extension to files created outside
+	of Agendafs. Disabled by default.
 
 # XATTRIBUTES
 
diff --git a/fuse_node.c b/fuse_node.c
@@ -215,7 +215,12 @@ parse_ics_to_agenda_entry(memory_region *mreg, const char *vdir_filepath)
 			extension = get_default_file_extension();
 		}
 
-		rasprintf(mreg, &filename, "%s.%s", summary, extension);
+		if (strcmp(extension, "") == 0) {
+			filename = rstrdup(mreg, summary);
+		}
+		else {
+			rasprintf(mreg, &filename, "%s.%s", summary, extension);
+		}
 	}
 
 	struct agenda_entry *e =
diff --git a/fuse_node_store.c b/fuse_node_store.c
@@ -8,7 +8,7 @@
 #include <string.h>
 char VDIR[256];
 
-char FILE_EXTENSION[256] = "txt";
+char FILE_EXTENSION[256] = "";
 
 // A structure of the current root
 struct tree_node *fuse_root = NULL;