/*
- * "$Id: encode.c 6386 2007-03-23 19:03:01Z mike $"
+ * "$Id: encode.c 6649 2007-07-11 21:46:42Z mike $"
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
+ * Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
{ "page-top-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ "penwidth", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ "penwidth-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
+ { "port-monitor", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ "ppi", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
* Find the end of this value and mark it if needed...
*/
- if ((sep = strchr(val, ',')) != NULL)
+ for (sep = val; *sep; sep ++)
+ {
+ if (*sep == '\'')
+ {
+ /*
+ * Skip quoted option value...
+ */
+
+ sep ++;
+
+ while (*sep && *sep != '\'')
+ sep ++;
+
+ if (!*sep)
+ sep --;
+ }
+ else if (*sep == '\"')
+ {
+ /*
+ * Skip quoted option value...
+ */
+
+ sep ++;
+
+ while (*sep && *sep != '\"')
+ sep ++;
+
+ if (!*sep)
+ sep --;
+ }
+ else if (*sep == ',')
+ break;
+ else if (*sep == '\\' && sep[1])
+ sep ++;
+ }
+
+ if (*sep == ',')
*sep++ = '\0';
- else
- sep = val + strlen(val);
/*
* Copy the option value(s) over as needed by the type...
/*
- * End of "$Id: encode.c 6386 2007-03-23 19:03:01Z mike $".
+ * End of "$Id: encode.c 6649 2007-07-11 21:46:42Z mike $".
*/