talloc_string_sub2: Don't return NULL if src is empty.
authorKarolin Seeger <kseeger@samba.org>
Wed, 23 Jul 2008 15:07:56 +0000 (17:07 +0200)
committerKarolin Seeger <kseeger@samba.org>
Fri, 25 Jul 2008 07:56:06 +0000 (09:56 +0200)
commitc6ca0f7d462c51122ccb1068306410ccdbee7b00
tree15609f5989a6be9767217f595c033e5f5aa97136
parent7f749a10eff0bb469e6eb50b02cb60fd65c23f9e
talloc_string_sub2: Don't return NULL if src is empty.

This fixes BUG #5635.

Finished print jobs were not removed from the $PRINTER.tdb file if
"printing=cups".

In print_queue_update, talloc_string_sub2 is used to assemble the
"lprm command". In the case of using "printing=cups", the default
"lprm command" is an empty string. talloc_string_sub2 is called with
this empty string and returns NULL which leads to exiting
print_queue_update without doing the actual print queue update.

Signed-off by Michael Adam <obnox@samba.org>
(cherry picked from commit 03d66554d1bbd9d6c72a3dd5203e5305343c76b8)
source/lib/util_str.c