XAttrs.cpp
branchv_0
changeset 27 2a156cb51479
parent 24 98d033d3ef7c
child 29 dc3c102e1264
--- a/XAttrs.cpp	Tue Dec 26 12:40:20 2023 +0100
+++ b/XAttrs.cpp	Tue Dec 26 15:41:07 2023 +0100
@@ -138,13 +138,15 @@
 	if (reload || !impl->loaded) {
 		impl->attributes.clear();
 		std::vector<std::string> names = xattrList(impl->fileName);
-		// FIXME: remove nameSpace
+		const std::string prefix = impl->nameSpace + ".";
 		for (const std::string& name : names) {
-			Attribute a;
-			a.impl->xattrs = impl;
-			a.impl->name = name;
-			a.impl->value = xattrGet(impl->fileName, name, &a.impl->exists);
-			impl->attributes.push_back(a);
+			if (name.starts_with(prefix)) {
+				Attribute a;
+				a.impl->xattrs = impl;
+				a.impl->name = name.substr(prefix.size());
+				a.impl->value = xattrGet(impl->fileName, name, &a.impl->exists);
+				impl->attributes.push_back(a);
+			}
 		}
 		impl->loaded = true;
 	}