]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some Windows issues:
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 1 Jun 2021 15:43:25 +0000 (11:43 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 1 Jun 2021 15:43:25 +0000 (11:43 -0400)
- cupsDirRead wasn't working - missing wildcard for FindFirst/FindNext.
- httpAddrListen/httpAddrConnect2 were missing the socket initialization code.

CHANGES.md
cups/dir.c
cups/http-addr.c
cups/http-addrlist.c

index 5d99e6a3ca53fbe276c107d1081eac2758fd74c8..3b22c19910e02783bf56b9a63b9ae0eec81fd897 100644 (file)
@@ -52,6 +52,7 @@ CUPS v2.4rc1 (Pending)
 - USB quirk updates (Apple #5766, Apple #5838, Apple #5843, Apple #5867)
 - Web interface updates (Issue #142)
 - The `ippeveprinter` tool now automatically uses an available port.
+- Fixed some Windows issues.
 - Deprecated cups-config (Issue #97)
 - Deprecated Kerberos (`AuthType Negotiate`) authentication (Issue #98)
 - Removed support for the (long deprecated and unused) `FontPath`,
index 184aa7c1962108b610887896255c96752aba1093..f6ac911bacb321f01a033e2357cc9af4f75612e0 100644 (file)
@@ -3,10 +3,11 @@
  *
  * This set of APIs abstracts enumeration of directory entries.
  *
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2021 by Apple Inc.
+ * Copyright © 1997-2005 by Easy Software Products, all rights reserved.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -122,7 +123,7 @@ cupsDirOpen(const char *directory)  /* I - Directory name */
 
   dp->dir = INVALID_HANDLE_VALUE;
 
-  strlcpy(dp->directory, directory, sizeof(dp->directory));
+  snprintf(dp->directory, sizeof(dp->directory), "%s\\*",  directory);
 
  /*
   * Return the new directory structure...
@@ -168,6 +169,16 @@ cupsDirRead(cups_dir_t *dp)                /* I - Directory pointer */
   else if (!FindNextFileA(dp->dir, &entry))
     return (NULL);
 
+ /*
+  * Loop until we have something other than "." or ".."...
+  */
+
+  while (!strcmp(entry.cFileName, ".") || !strcmp(entry.cFileName, ".."))
+  {
+    if (!FindNextFileA(dp->dir, &entry))
+      return (NULL);
+  }
+
  /*
   * Copy the name over and convert the file information...
   */
index 8e81c6f7db043ee3c9f7951893492b2d2eab2106..114a6449a2e4ed2003803e89d559fcef2e7dbd5b 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * HTTP address routines for CUPS.
  *
- * Copyright 2007-2019 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2021 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
  * information.
@@ -169,6 +169,12 @@ httpAddrListen(http_addr_t *addr,  /* I - Address to bind to */
   if (!addr || port < 0)
     return (-1);
 
+ /*
+  * Make sure the network stack is initialized...
+  */
+
+  httpInitialize();
+
  /*
   * Create the socket and set options...
   */
index 975016b60e6656f78dc25ce167a2beb97ac86df3..56380cb9259a3176efd65e7563324b5206607b78 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * HTTP address list routines for CUPS.
  *
- * Copyright 2007-2018 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2021 by Apple Inc.
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
  * information.
@@ -100,6 +100,8 @@ httpAddrConnect2(
   if (cancel && *cancel)
     return (NULL);
 
+  httpInitialize();
+
   if (msec <= 0)
     msec = INT_MAX;