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 14:23:30 +0000 (16:23 +0200)
commitc61578fc7c9dce8f22695532ee26179ba35b6a8f
treefff2cc6b17b9288c0fa196b24dccd3b1283b8a66
parent62cce59822e3ae85d380e36b9c4c3f25f7a5f13a
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)
(cherry picked from commit c6ca0f7d462c51122ccb1068306410ccdbee7b00)
source/lib/util_str.c