]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/ipp.c
Load cups into easysw/current.
[thirdparty/cups.git] / backend / ipp.c
index 468f69dd2f39161b05e960ca2c075f5225d43597..9db806cb6882d9b56bf8619c4b3a8ee222e2f5e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c 4926 2006-01-13 03:12:13Z mike $"
+ * "$Id: ipp.c 5023 2006-01-29 14:39:44Z mike $"
  *
  *   IPP backend for the Common UNIX Printing System (CUPS).
  *
@@ -209,20 +209,13 @@ main(int  argc,                           /* I - Number of command-line arguments (6 or 7) */
   * Extract the hostname and printer name from the URI...
   */
 
-  if (getenv("DEVICE_URI") != NULL)
-    /* authentication information is only available in the env var */
-    httpSeparateURI(getenv("DEVICE_URI"), method, sizeof(method),
-                    username, sizeof(username),
-                    hostname, sizeof(hostname), &port,
-                   resource, sizeof(resource));
-  else if (strchr(argv[0], ':') != NULL)
-    httpSeparateURI(argv[0], method, sizeof(method), username, sizeof(username),
-                    hostname, sizeof(hostname), &port,
-                   resource, sizeof(resource));
-  else
+  if (httpSeparateURI(HTTP_URI_CODING_ALL, cupsBackendDeviceURI(argv),
+                      method, sizeof(method), username, sizeof(username),
+                     hostname, sizeof(hostname), &port,
+                     resource, sizeof(resource)) < HTTP_URI_OK)
   {
-    fputs("ERROR: Missing device URI on command-line and no DEVICE_URI environment variable!\n",
-          stderr);
+    fputs("ERROR: Missing device URI on command-line and no DEVICE_URI "
+          "environment variable!\n", stderr);
     return (CUPS_BACKEND_STOP);
   }
 
@@ -1375,5 +1368,5 @@ sigterm_handler(int sig)          /* I - Signal */
 
 
 /*
- * End of "$Id: ipp.c 4926 2006-01-13 03:12:13Z mike $".
+ * End of "$Id: ipp.c 5023 2006-01-29 14:39:44Z mike $".
  */