Remove comma from list printing: use same syntax as language.

This commit is contained in:
antirez 2023-01-30 11:35:42 +01:00
parent 3fdd4d87ef
commit ea3886d0cb

View file

@ -434,7 +434,7 @@ void printobj(obj *obj, int flags) {
if (repr) printf("%c",obj->type == OBJ_TYPE_LIST ? '[' : '('); if (repr) printf("%c",obj->type == OBJ_TYPE_LIST ? '[' : '(');
for (size_t j = 0; j < obj->l.len; j++) { for (size_t j = 0; j < obj->l.len; j++) {
printobj(obj->l.ele[j],flags); printobj(obj->l.ele[j],flags);
if (j != obj->l.len-1) printf(", "); if (j != obj->l.len-1) printf(" ");
} }
if (color) printf("%s",escape); /* Restore upper level color. */ if (color) printf("%s",escape); /* Restore upper level color. */
if (repr) printf("%c",obj->type == OBJ_TYPE_LIST ? ']' : ')'); if (repr) printf("%c",obj->type == OBJ_TYPE_LIST ? ']' : ')');