summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2008-07-23 17:07:56 +0200
committerKarolin Seeger <kseeger@samba.org>2008-07-25 09:53:26 +0200
commit933fdd4017fb79539b23222c8f8b538e11133130 (patch)
tree851acc8fee847c864d4ca32adcd666ba08920b94 /source3/lib
parentf9223a7139e7cc43cb3337a5c66d0262b9e03d54 (diff)
downloadsamba-933fdd4017fb79539b23222c8f8b538e11133130.tar.gz
samba-933fdd4017fb79539b23222c8f8b538e11133130.tar.bz2
samba-933fdd4017fb79539b23222c8f8b538e11133130.zip
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> (This used to be commit 03d66554d1bbd9d6c72a3dd5203e5305343c76b8)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 7cb57adbb5..5f26cc80f8 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1230,7 +1230,7 @@ char *talloc_string_sub2(TALLOC_CTX *mem_ctx, const char *src,
char *string;
ssize_t ls,lp,li,ld, i;
- if (!insert || !pattern || !*pattern || !src || !*src) {
+ if (!insert || !pattern || !*pattern || !src) {
return NULL;
}