GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
CUPS.org User: opher
The function mimeAddTypeRule() in scheduler/type.c parses some rules wrong. This happens for example to:
----------- foo.sh start --------------
----------- foo.bash start ------------
(1) lp -d printer foo.sh
(2) lp -d printer foo.bash
Both result in the scheduler auto-typing as text/plain.
This happens because of a wrong if' at line 189. At the point when we reach the (first)+' in:
application/x-shell sh printable(0,1024) + string(0,#!)
logic == MIME_MAGIC_OR
current != NULL
current->prev != NULL
current->prev->prev == NULL
if' at line 189. At the point when we reach the (first)
and so the `if' expression evaluates to FALSE and we end up executing this block (line 215):
current->parent->op = MIME_MAGIC_AND;
which ends up evaluating the rule as: sh + printable(0,1024) + ...
The fix is to drop the current->prev->prev != NULL' evaluation from theif'. Please also note that in the "truth" block current->prev->prev is never referenced.
current->prev->prev != NULL' evaluation from the
CUPS.org User: mike
Fixed in Subversion repository.
--- type.c Base (BASE)
+++ type.c Locally Modified (Based On LOCAL)
@@ -187,8 +187,7 @@
else if (*rule == '+' && current != NULL)
if (logic != MIME_MAGIC_AND &&
current != NULL && current->prev != NULL &&
current->prev->prev != NULL)
current != NULL && current->prev != NULL)
--- CHANGES-1.3.txt (revision 8239)
+++ CHANGES-1.3.txt (working copy)
@@ -5,6 +5,8 @@
- Documentation fixes (STR #2994, STR #2995, STR #3008, STR #3056,