diff options
Diffstat (limited to 'cgi-bin/ipp-var.c')
-rw-r--r-- | cgi-bin/ipp-var.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c index 1c7bdb03..85c8195c 100644 --- a/cgi-bin/ipp-var.c +++ b/cgi-bin/ipp-var.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-var.c 10431 2012-04-23 19:19:19Z mike $" + * "$Id: ipp-var.c 10608 2012-09-15 19:42:21Z mike $" * * CGI <-> IPP variable routines for CUPS. * @@ -1432,7 +1432,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/"); - if ((which_jobs = cgiGetVariable("which_jobs")) != NULL) + if ((which_jobs = cgiGetVariable("which_jobs")) != NULL && *which_jobs) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs", NULL, which_jobs); @@ -1480,10 +1480,11 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ if (first < 0) first = 0; - if ((var = cgiGetVariable("ORDER")) != NULL) + if ((var = cgiGetVariable("ORDER")) != NULL && *var) ascending = !_cups_strcasecmp(var, "asc"); else - ascending = !which_jobs || !_cups_strcasecmp(which_jobs, "not-completed"); + ascending = !which_jobs || !*which_jobs || + !_cups_strcasecmp(which_jobs, "not-completed"); section = cgiGetVariable("SECTION"); @@ -1588,5 +1589,5 @@ cgiText(const char *message) /* I - Message */ /* - * End of "$Id: ipp-var.c 10431 2012-04-23 19:19:19Z mike $". + * End of "$Id: ipp-var.c 10608 2012-09-15 19:42:21Z mike $". */ |