Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cupsaddsmb add errors in .ppd files #1750

Closed
michaelrsweet opened this issue Jun 6, 2006 · 5 comments
Closed

Cupsaddsmb add errors in .ppd files #1750

michaelrsweet opened this issue Jun 6, 2006 · 5 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

@michaelrsweet michaelrsweet commented Jun 6, 2006

Version: 1.2-current
CUPS.org User: nicovic

When cupsaddsmb edit the .ppd files for adding "cups ticket support and options", it removes all the endline of the original .ppd file.

This produce an error when you want to show printer's properties on the Windows client.

@michaelrsweet
Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Jun 6, 2006

CUPS.org User: mike

Please attach a sample PPD file before and after processing by cupsaddsmb.

@michaelrsweet
Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Jun 6, 2006

CUPS.org User: nicovic

I've juste posted 2 files:
before.ppd is the .ppd file generated in /etc/cups/ppd
after.ppd is the .ppd file generated by cupsaddsmb

@michaelrsweet
Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Jun 6, 2006

CUPS.org User: mike

Try the attached patch and let me know if the problem persists...

@michaelrsweet
Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Jun 7, 2006

CUPS.org User: nicovic

Ok, it's working nice with this patch !

Thank you !

@michaelrsweet
Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Jun 7, 2006

"str1750.patch":

Index: adminutil.c

--- adminutil.c (revision 5631)
+++ adminutil.c (working copy)
@@ -222,18 +222,18 @@
*/

   cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
  •                        "*%%%s", line + 1);
    
  •                        "_%%%s\n", line + 1);
    

    continue;
    }
    else if (!strncmp(line, "_JCLOpenUI", 10))
    {
    jcloption = 1;

  •  cupsFilePuts(dstfp, line);
    
  •  cupsFilePrintf(dstfp, "%s\n", line);
    

    }
    else if (!strncmp(line, "*JCLCloseUI", 11))
    {
    jcloption = 0;

  •  cupsFilePuts(dstfp, line);
    
  •  cupsFilePrintf(dstfp, "%s\n", line);
    

    }
    else if (jcloption &&
    strncmp(line, "*End", 4) &&
    @@ -312,12 +312,13 @@
    }

    snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),

  •           "%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice);
    
  •           "%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
    
  •  cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s", line);
    
  •  cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
    
  •                 line);
    

    }
    else

  •  cupsFilePuts(dstfp, line);
    
  •  cupsFilePrintf(dstfp, "%s\n", line);
    

    }

    cupsFileClose(srcfp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant