# HG changeset patch # User Guido Berhoerster # Date 1486297831 -3600 # Node ID b5c4267a7182b7584707713c61c14a708b54b5e3 # Parent 1cc98a5677d9e444e85faebc3e909c004e186615 Fix check for successful deletion of a empty group A return value of NULL means that there is no empty group of that name. Improve the error message. diff -r 1cc98a5677d9 -r b5c4267a7182 cmd.c --- a/cmd.c Sat Feb 04 22:06:15 2017 +0100 +++ b/cmd.c Sun Feb 05 13:30:31 2017 +0100 @@ -440,7 +440,7 @@ } if (pwfile_remove_group(ctx, argv[1]) != 0) { - fprintf(stderr, "group \"%s\" does not exist\n", argv[1]); + fprintf(stderr, "there is no empty group \"%s\"\n", argv[1]); return (CMD_ERR); } diff -r 1cc98a5677d9 -r b5c4267a7182 pwfile.c --- a/pwfile.c Sat Feb 04 22:06:15 2017 +0100 +++ b/pwfile.c Sun Feb 05 13:30:31 2017 +0100 @@ -692,7 +692,7 @@ struct pws3_field *empty_group_field; empty_group_field = pws3_file_remove_empty_group(ctx->file, group); - if (empty_group_field != NULL) { + if (empty_group_field == NULL) { return (-1); } pws3_field_destroy(empty_group_field);