=== modified file 'NEWS' --- NEWS 2016-07-22 21:28:57 +0000 +++ NEWS 2016-07-23 02:10:36 +0000 @@ -3,6 +3,8 @@ CHANGES IN V1.10.1 + - beh: Fixed printing multiple copies with beh (Ubuntu bug + #1605514). - cups-browsed: Fixed several memory leaks, especially when using IPP requests. Thanks to Ivo Straka for finding them with Valgrind and supplying a patch to fix them (Bug #1365, === modified file 'backend/beh.c' --- backend/beh.c 2016-01-19 22:17:44 +0000 +++ backend/beh.c 2016-07-23 02:10:36 +0000 @@ -33,7 +33,8 @@ * Local functions... */ -static int call_backend(char *uri, char **argv, char *tempfile); +static int call_backend(char *uri, int argc, char **argv, + char *tempfile); static void sigterm_handler(int sig); @@ -165,7 +166,8 @@ * Do it! */ - while ((retval = call_backend(ptr, argv, filename)) != CUPS_BACKEND_OK && + while ((retval = call_backend(ptr, argc, argv, filename)) != + CUPS_BACKEND_OK && !job_canceled) { if (att > 0) { att --; @@ -205,9 +207,11 @@ */ static int -call_backend(char *uri, +call_backend(char *uri, /* I - URI of final destination */ + int argc, /* I - Number of command line + arguments */ char **argv, /* I - Command-line arguments */ - char *filename) { + char *filename) { /* I - File name of input data */ const char *cups_serverbin; /* Location of programs */ char scheme[1024], /* Scheme from URI */ *ptr, /* Pointer into scheme */ @@ -232,7 +236,12 @@ } else snprintf(cmdline, sizeof(cmdline), "%s/backend/%s '%s' '%s' '%s' '%s' '%s' %s", - cups_serverbin, scheme, argv[1], argv[2], argv[3], argv[4], + cups_serverbin, scheme, argv[1], argv[2], argv[3], + /* Apply number of copies only if beh was called with a + file name and not with the print data in stdin, as + backends should handle copies only if they are called + with a file name */ + (argc == 6 ? "1" : argv[4]), argv[5], filename); /*