LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cups-1.1.21-umlaut_printer.patch of Package cups (Project DISCONTINUED:openSUSE:11.1)

--- cups-1.1.21/scheduler/client.c.orig	2004-09-14 17:00:56.102330657 +0200
+++ cups-1.1.21/scheduler/client.c	2004-09-14 18:32:04.648731933 +0200
@@ -1262,10 +1330,36 @@
 	      * names are not case sensitive but filenames can be...
 	      */
 
-              con->uri[strlen(con->uri) - 4] = '\0';	/* Drop ".ppd" */
+	      int i;
+	      char tmp_uri[HTTP_MAX_URI];
+	      char *uri, *len;
+
+	      memset(tmp_uri, 0, HTTP_MAX_URI);
+	      uri = con->uri;
+	      len = uri + strlen(uri) - 4;
+	      i = 0;
 
-              if ((p = FindPrinter(con->uri + 10)) != NULL)
-		snprintf(con->uri, sizeof(con->uri), "/ppd/%s.ppd", p->name);
+	      while(uri < len)
+	      {
+	         if (uri[0] == '%' && isxdigit(uri[1]) && isxdigit(uri[2]))
+		 {
+		    tmp_uri[i] = (isdigit(uri[1])?uri[1]-'0':(toupper(uri[1])-'A'+10))*16
+                                 + (isdigit(uri[2])?uri[2]-'0':(toupper(uri[2])-'A'+10));
+		    uri += 3;
+		 }
+		 else
+		 {
+		    tmp_uri[i] = uri[0];
+		    uri++;
+		 }
+		 i++;
+	      }
+	      tmp_uri[i] = '\0';
+
+              // con->uri[strlen(con->uri) - 4] = '\0';	/* Drop ".ppd" */
+
+              if ((p = FindPrinter(tmp_uri + 10)) != NULL)
+		snprintf(con->uri, sizeof(con->uri), "/ppd/%s.ppd", p->name);
 	      else
 	      {
 		if (!SendError(con, HTTP_NOT_FOUND))