summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2013-10-30 15:08:29 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2013-10-30 15:08:29 +0000
commite5d9b5e1919f0db4f6a9e42f30c78d1b8e371135 (patch)
treec5d6cf2856ff689340459dca796fefc6adf2f153
parent00c457308883414d741755d83da36cac55eff348 (diff)
downloadcups-e5d9b5e1919f0db4f6a9e42f30c78d1b8e371135.tar.gz
Mirror changes from trunk.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11370 a1ca3aef-8c08-0410-bb20-df032aa958be
-rw-r--r--Makefile27
-rw-r--r--backend/ipp.c2
-rw-r--r--test/ipptool.c117
3 files changed, 38 insertions, 108 deletions
diff --git a/Makefile b/Makefile
index 9b252c648..0e287e473 100644
--- a/Makefile
+++ b/Makefile
@@ -128,8 +128,11 @@ depend:
#
-# Run the clang.llvm.org static code analysis tool on the C sources.
-# (at least checker-231 is required for scan-build to work this way)
+# Run the Clang static code analysis tool on the sources, available here:
+#
+# http://clang-analyzer.llvm.org
+#
+# At least checker-231 is required.
#
.PHONY: clang clang-changes
@@ -141,6 +144,26 @@ clang-changes:
#
+# Run the STACK tool on the sources, available here:
+#
+# http://css.csail.mit.edu/stack/
+#
+# Do the following to pass options to configure:
+#
+# make CONFIGFLAGS="--foo --bar" stack
+#
+
+.PHONY: stack
+stack:
+ stack-build ./configure $(CONFIGFLAGS)
+ stack-build $(MAKE) $(MFLAGS) clean all
+ poptck
+ $(MAKE) $(MFLAGS) distclean
+ $(RM) */*.ll
+ $(RM) */*.ll.out
+
+
+#
# Generate a ctags file...
#
diff --git a/backend/ipp.c b/backend/ipp.c
index d41e1f6db..8c297c5df 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -3009,7 +3009,7 @@ quote_string(const char *s, /* I - String */
{
if (*s == '\\' || *s == '\"' || *s == '\'')
{
- if (q < (qend - 3))
+ if (q < (qend - 4))
{
*qptr++ = '\\';
*qptr++ = '\\';
diff --git a/test/ipptool.c b/test/ipptool.c
index cec93f929..56bb8cc65 100644
--- a/test/ipptool.c
+++ b/test/ipptool.c
@@ -1,48 +1,18 @@
/*
* "$Id$"
*
- * ipptool command for CUPS.
+ * ipptool command for CUPS.
*
- * Copyright 2007-2013 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products.
+ * Copyright 2007-2013 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products.
*
- * These coded instructions, statements, and computer programs are the
- * 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/".
+ * These coded instructions, statements, and computer programs are the
+ * 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.
- *
- * Contents:
- *
- * main() - Parse options and do tests.
- * add_stringf() - Add a formatted string to an array.
- * compare_vars() - Compare two variables.
- * do_tests() - Do tests as specified in the test file.
- * expand_variables() - Expand variables in a string.
- * expect_matches() - Return true if the tag matches the specification.
- * get_collection() - Get a collection value from the current test file.
- * get_filename() - Get a filename based on the current test file.
- * get_token() - Get a token from a file.
- * get_variable() - Get the value of a variable.
- * iso_date() - Return an ISO 8601 date/time string for the given IPP
- * dateTime value.
- * password_cb() - Password callback for authenticated tests.
- * print_attr() - Print an attribute on the screen.
- * print_col() - Print a collection attribute on the screen.
- * print_csv() - Print a line of CSV text.
- * print_fatal_error() - Print a fatal error message.
- * print_line() - Print a line of formatted or CSV text.
- * print_xml_header() - Print a standard XML plist header.
- * print_xml_string() - Print an XML string with escaping.
- * print_xml_trailer() - Print the XML trailer with success/fail value.
- * set_variable() - Set a variable value.
- * sigterm_handler() - Handle SIGINT and SIGTERM.
- * timeout_cb() - Handle HTTP timeouts.
- * usage() - Show program usage.
- * validate_attr() - Determine whether an attribute is valid.
- * with_value() - Test a WITH-VALUE predicate.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -1292,39 +1262,8 @@ do_tests(_cups_vars_t *vars, /* I - Variables */
if (col)
{
- ipp_attribute_t *tempcol; /* Pointer to new buffer */
-
-
- /*
- * Reallocate memory...
- */
-
- if ((tempcol = realloc(lastcol, sizeof(ipp_attribute_t) +
- (lastcol->num_values + 1) *
- sizeof(_ipp_value_t))) == NULL)
- {
- print_fatal_error("Unable to allocate memory on line %d.", linenum);
- pass = 0;
- goto test_exit;
- }
-
- if (tempcol != lastcol)
- {
- /*
- * Reset pointers in the list...
- */
-
- if (request->prev)
- request->prev->next = tempcol;
- else
- request->attrs = tempcol;
-
- lastcol = request->current = request->last = tempcol;
- }
-
- lastcol->values[lastcol->num_values].collection = col;
- lastcol->num_values ++;
- }
+ ippSetCollection(request, &lastcol, ippGetCount(lastcol), col);
+ }
else
{
pass = 0;
@@ -3540,39 +3479,7 @@ get_collection(_cups_vars_t *vars, /* I - Variables */
/* Collection value */
if (subcol)
- {
- ipp_attribute_t *tempcol; /* Pointer to new buffer */
-
-
- /*
- * Reallocate memory...
- */
-
- if ((tempcol = realloc(lastcol, sizeof(ipp_attribute_t) +
- (lastcol->num_values + 1) *
- sizeof(_ipp_value_t))) == NULL)
- {
- print_fatal_error("Unable to allocate memory on line %d.", *linenum);
- goto col_error;
- }
-
- if (tempcol != lastcol)
- {
- /*
- * Reset pointers in the list...
- */
-
- if (col->prev)
- col->prev->next = tempcol;
- else
- col->attrs = tempcol;
-
- lastcol = col->current = col->last = tempcol;
- }
-
- lastcol->values[lastcol->num_values].collection = subcol;
- lastcol->num_values ++;
- }
+ ippSetCollection(col, &lastcol, ippGetCount(lastcol), subcol);
else
goto col_error;
}