diff options
Diffstat (limited to 'usr/src/lib/print/libpapi-dynamic/common/nss.c')
-rw-r--r-- | usr/src/lib/print/libpapi-dynamic/common/nss.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr/src/lib/print/libpapi-dynamic/common/nss.c b/usr/src/lib/print/libpapi-dynamic/common/nss.c index ab26d41d89..02d74b17e7 100644 --- a/usr/src/lib/print/libpapi-dynamic/common/nss.c +++ b/usr/src/lib/print/libpapi-dynamic/common/nss.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ @@ -116,10 +116,14 @@ solaris_lpsched_shortcircuit_hack(papi_attribute_t ***list) return; } - if ((printer = strrchr(uri->path, '/')) == NULL) - printer = uri->path; - else - printer++; + if (uri->path == NULL) { + printer = ""; + } else { + if ((printer = strrchr(uri->path, '/')) == NULL) + printer = uri->path; + else + printer++; + } /* is there an lpsched queue (printer/class) */ snprintf(buf, sizeof (buf), "/etc/lp/interfaces/%s", printer); |