]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ipp-support.c
Merge changes from CUPS 1.6svn-r10127.
[thirdparty/cups.git] / cups / ipp-support.c
index 030eece1e4e86fe1c141d7c5885442c878d977ff..ec4c2c9980523e383f443c15d46b668af13bf2b8 100644 (file)
@@ -1036,6 +1036,7 @@ ipp_col_string(ipp_t  *col,               /* I - Collection attribute */
 {
   char                 *bufptr,        /* Position in buffer */
                        *bufend,        /* End of buffer */
+                       prefix = '{',   /* Prefix character */
                        temp[256];      /* Temporary string */
   ipp_attribute_t      *attr;          /* Current member attribute */
 
@@ -1043,15 +1044,16 @@ ipp_col_string(ipp_t  *col,             /* I - Collection attribute */
   bufptr = buffer;
   bufend = buffer + bufsize - 1;
 
-  if (buffer && bufptr < bufend)
-    *bufptr = '{';
-  bufptr ++;
-
   for (attr = col->attrs; attr; attr = attr->next)
   {
     if (!attr->name)
       continue;
 
+    if (buffer && bufptr < bufend)
+      *bufptr = prefix;
+    bufptr ++;
+    prefix = ' ';
+
     if (buffer && bufptr < bufend)
       bufptr += snprintf(bufptr, bufend - bufptr + 1, "%s=", attr->name);
     else
@@ -1063,6 +1065,13 @@ ipp_col_string(ipp_t  *col,              /* I - Collection attribute */
       bufptr += ippAttributeString(attr, temp, sizeof(temp));
   }
 
+  if (prefix == '{')
+  {
+    if (buffer && bufptr < bufend)
+      *bufptr = prefix;
+    bufptr ++;
+  }
+
   if (buffer && bufptr < bufend)
     *bufptr = '}';
   bufptr ++;