]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/admin.c
Merge changes from CUPS 1.5svn-r8950.
[thirdparty/cups.git] / cgi-bin / admin.c
index cdb1a2a8981f3834d4e9416d4e6ca614318f9ed5..ccf10de5782d82f8709471819ee4898ba7a3c5b9 100644 (file)
@@ -948,7 +948,8 @@ do_am_printer(http_t *http,         /* I - HTTP connection */
          if (isalnum(*uriptr & 255) || *uriptr == '_' || *uriptr == '-' ||
              *uriptr == '.')
            *tptr++ = *uriptr;
-         else if ((*uriptr == ' ' || *uriptr == '/') && tptr[-1] != '_')
+         else if ((*uriptr == ' ' || *uriptr == '/') && tptr > template &&
+                  tptr[-1] != '_')
            *tptr++ = '_';
          else if (*uriptr == '?' || *uriptr == '(')
            break;