1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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 03d66554d1)
This commit is contained in:
Karolin Seeger 2008-07-23 17:07:56 +02:00
parent f9223a7139
commit 933fdd4017

View File

@ -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;
}