trim btrfs label name
Costa Tsaousis (ktsaou) committed
Dec 18, 2017 at 23:22 UTC
56f716fc59208faa5176b14fa42a0124f8c6a164
1 file changed
+7
-2
src/sys_fs_btrfs.c
+7
-2
@@ -300,8 +300,13 @@ static inline int find_all_btrfs_pools(const char *path) {
300
301
snprintfz(filename, FILENAME_MAX, "%s/%s/label", path, de->d_name);
302
read_file(filename, label, FILENAME_MAX);
303
- if (label[0])
304
- node->label = strdupz(label);
303
+
304
+ char *s = label;
305
+ if (s[0])
306
+ s = trim(label);
307
+
308
+ if(s && s[0])
309
+ node->label = strdupz(s);
310
else
311
node->label = strdupz(node->id);
312
}