ref: 2707beb7b46cf29fb1ebafad33edf8d48041ed50
parent: 46bac13b16df5cbd92ea1da12cfef168201f0dad
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 5 15:45:59 EDT 2023
ndb/query: avoid trailing spaces when printing ndb line structure
--- a/sys/src/cmd/ndb/query.c
+++ b/sys/src/cmd/ndb/query.c
@@ -52,12 +52,15 @@
}
}
} else {
+ char *sep = "";
+
for(; nt != nil; nt = nt->entry){
if(match(nt->attr, rattr, nrattr)){
- Bprint(&bout, "%s=%$ ", nt->attr, nt->val);
- if(nt->entry != nt->line)
- Bprint(&bout, "\n\t");
+ Bprint(&bout, "%s%s=%$", sep, nt->attr, nt->val);
+ sep = " ";
}
+ if(nt->entry != nt->line)
+ sep = "\n\t";
}
Bprint(&bout, "\n");
}