/*-------------------------------------------------------------------------------------------------
This patch is taken from the community.
Details can be found at http://www.cups.org/str.php?L4609
---------------------------------------------------------------------------------------------------*/
===================================================================
@@ -1230,21 +1230,7 @@
*/
- {
-
-
-
- "<A HREF=\"%s\">%s</A>", url,
- }
- else
break;
}
===================================================================
@@ -659,39 +659,7 @@
while (*s)
{
if (*s == '<')
- {
- /*
- * Pass <A HREF="url"> and </A>, otherwise quote it...
- */
-
- {
- s += 9;
-
- while (*s && *s != '\"')
- {
- if (*s == '&')
- else
-
- s ++;
- }
-
- if (*s)
- s ++;
-
- }
- {
- s += 3;
- }
- else
- }
else if (*s == '>')
else if (*s == '\"')
===================================================================
@@ -498,8 +498,8 @@
*/
}
}
@@ -1638,7 +1638,10 @@
if (attr)
+ {
+ }
}
else if (attr)
{
@@ -1869,48 +1869,11 @@
*/
- {
- case IPP_TAG_STRING :
- case IPP_TAG_TEXTLANG :
- case IPP_TAG_NAMELANG :
- case IPP_TAG_TEXT :
- case IPP_TAG_NAME :
- case IPP_TAG_KEYWORD :
- case IPP_TAG_URI :
- case IPP_TAG_URISCHEME :
- case IPP_TAG_CHARSET :
- case IPP_TAG_LANGUAGE :
- case IPP_TAG_MIMETYPE :
- /*
- * Free old strings...
- */
-
- {
- {
- }
- }
-
- default :
- break;
- }
-
- /*
- * Use the default connection hostname instead...
- */
-
- }
-
+ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http.hostname);
+ }
+ else
}
else
{
@@ -1822,8 +1788,8 @@
}
@@ -1849,7 +1815,8 @@
*/
"job-sheets=\"%s,none\", "
@@ -1866,7 +1833,8 @@
* Can't put two different security markings on the same document!
*/
- cupsdSetString(&attr->values[1].string.text, attr->values[0].string.text);
+ _cupsStrFree(attr->values[1].string.text);
+ attr->values[1].string.text = _cupsStrAlloc(attr->values[0].string.text);
cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED "
"job-sheets=\"%s,%s\", "
@@ -1906,18 +1874,26 @@
if (attr->num_values > 1 &&
!strcmp(attr->values[0].string.text, attr->values[1].string.text))
{
- cupsdSetString(&(attr->values[0].string.text), Classification);
- cupsdSetString(&(attr->values[1].string.text), Classification);
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc(Classification);
+ _cupsStrFree(attr->values[1].string.text);
+ attr->values[1].string.text = _cupsStrAlloc(Classification);
}
else
{
if (attr->num_values == 1 ||
strcmp(attr->values[0].string.text, "none"))
- cupsdSetString(&(attr->values[0].string.text), Classification);
+ {
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc(Classification);
+ }
if (attr->num_values > 1 &&
strcmp(attr->values[1].string.text, "none"))
- cupsdSetString(&(attr->values[1].string.text), Classification);
+ {
+ _cupsStrFree(attr->values[1].string.text);
+ attr->values[1].string.text = _cupsStrAlloc(Classification);
+ }
}
if (attr->num_values > 1)
@@ -3845,7 +3821,8 @@
if (attr)
{
attr->value_tag = IPP_TAG_KEYWORD;
- cupsdSetString(&(attr->values[0].string.text), "no-hold");
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc("no-hold");
}
/*
@@ -8832,7 +8809,6 @@
if (format)
{
_cupsStrFree(format->values[0].string.text);
-
format->values[0].string.text = _cupsStrAlloc(mimetype);
}
else
@@ -9371,9 +9347,8 @@
if (attr)
{
+ attr->value_tag = IPP_TAG_KEYWORD;
_cupsStrFree(attr->values[0].string.text);
-
- attr->value_tag = IPP_TAG_KEYWORD;
attr->values[0].string.text = _cupsStrAlloc("no-hold");
cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, cupsdFindDest(job->dest), job,
@@ -10065,7 +10040,6 @@
IPP_TAG_MIMETYPE)) != NULL)
{
_cupsStrFree(jformat->values[0].string.text);
-
jformat->values[0].string.text = _cupsStrAlloc(mimetype);
}
else
===================================================================
@@ -397,7 +397,10 @@
if ((attr = ippFindAttribute(job->attrs, "job-actual-printer-uri",
IPP_TAG_URI)) != NULL)
- cupsdSetString(&attr->values[0].string.text, printer->uri);
+ {
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc(printer->uri);
+ }
else
ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI,
"job-actual-printer-uri", NULL, printer->uri);
@@ -1830,7 +1833,10 @@
if ((attr = ippFindAttribute(job->attrs, "job-printer-uri",
IPP_TAG_URI)) != NULL)
- cupsdSetString(&(attr->values[0].string.text), p->uri);
+ {
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc(p->uri);
+ }
cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, p, job,
"Job #%d moved from %s to %s.", job->id, olddest,
@@ -2026,7 +2032,10 @@
attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME);
if (attr)
- cupsdSetString(&(attr->values[0].string.text), when);
+ {
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc(when);
+ }
else
attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
"job-hold-until", NULL, when);
@@ -2272,7 +2281,8 @@
if (attr)
{
attr->value_tag = IPP_TAG_KEYWORD;
- cupsdSetString(&(attr->values[0].string.text), "no-hold");
+ _cupsStrFree(attr->values[0].string.text);
+ attr->values[0].string.text = _cupsStrAlloc("no-hold");
}
default :
@@ -3989,7 +3999,10 @@
job->status_level = CUPSD_LOG_INFO;
if (job->printer_message)
- cupsdSetString(&(job->printer_message->values[0].string.text), "");
+ {
+ _cupsStrFree(job->printer_message->values[0].string.text);
+ job->printer_message->values[0].string.text = _cupsStrAlloc("");
+ }
/*
* Create the backchannel pipes and make them non-blocking...
@@ -4547,10 +4560,15 @@
if (job->state_value != IPP_JOB_PROCESSING &&
job->status_level == CUPSD_LOG_INFO)
- cupsdSetString(&(job->printer_message->values[0].string.text), "");
+ {
+ _cupsStrFree(job->printer_message->values[0].string.text);
+ job->printer_message->values[0].string.text = _cupsStrAlloc("");
+ }
else if (job->printer->state_message[0] && do_message)
- cupsdSetString(&(job->printer_message->values[0].string.text),
- job->printer->state_message);
+ {
+ _cupsStrFree(job->printer_message->values[0].string.text);
+ job->printer_message->values[0].string.text = _cupsStrAlloc(job->printer->state_message);
+ }
/*
* ... and the printer-state-reasons value...