commit 62118e0fdbbbd26675432303619ce462f5fff423
Author: Arkadiusz Miƛkiewicz <[email protected]>
Date:   Wed Aug 8 11:02:27 2012 +0200

    - fix build

 postgresql-pg_ctl-fix.patch | 48 ++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 27 deletions(-)
---
diff --git a/postgresql-pg_ctl-fix.patch b/postgresql-pg_ctl-fix.patch
index 1c8e6ba..d8efe1a 100644
--- a/postgresql-pg_ctl-fix.patch
+++ b/postgresql-pg_ctl-fix.patch
@@ -21,49 +21,43 @@
        {
                char      **optlines;
  
-@@ -413,18 +415,32 @@
+@@ -432,8 +432,7 @@
  
                                while (isspace((unsigned char) *p))
                                        p++;
 -                              if (strncmp(p, "port", 4) != 0)
 -                                      continue;
--                              p += 4;
--                              while (isspace((unsigned char) *p))
--                                      p++;
--                              if (*p != '=')
--                                      continue;
--                              p++;
--                              while (isspace((unsigned char) *p))
-+                              if (strncmp(p, "port", strlen("port")) == 0)
-+                              {
-+                                      p += strlen("port");
-+                                      while (isspace((unsigned char) *p))
-+                                              p++;
-+                                      if (*p != '=')
-+                                              continue;
++                              if (!strncmp(p, "port", 4) != 0) {
+                               p += 4;
+                               while (isspace((unsigned char) *p))
                                        p++;
--                              StrNCpy(portstr, p, Min(strcspn(p, "#" 
WHITESPACE) + 1,
-+                                      while (isspace((unsigned char) *p))
-+                                              p++;
-+                                      StrNCpy(portstr, p, Min(strcspn(p, "#" 
WHITESPACE) + 1,
-                                                                               
sizeof(portstr)));
-+                              }
-+                              if (strncmp(p, "unix_socket_directory", 
strlen("unix_socket_directory")) == 0)
-+                              {
-+                                      p += strlen("unix_socket_directory");
+@@ -452,6 +451,26 @@
+                               /* and save the argument value */
+                               StrNCpy(portstr, p, Min((q - p) + 1, 
sizeof(portstr)));
+                               /* keep looking, maybe there is another */
++                              } else if(!strncmp(p, "unix_socket_directory", 
21)) {
++                                      p += 21;
 +                                      while (isspace((unsigned char) *p))
 +                                              p++;
 +                                      if (*p != '=')
 +                                              continue;
 +                                      p++;
++                                      /* advance past any whitespace/quoting 
*/
 +                                      while (isspace((unsigned char) *p) || 
*p == '\'' || *p == '"')
 +                                              p++;
-+                                      StrNCpy(sockstr, p, Min(strcspn(p, 
"#\"'" WHITESPACE) + 1,
-+                                                                              
sizeof(sockstr)));
++                                      /* find end of value (not including any 
ending quote/comment!) */
++                                      q = p;
++                                      while (*q &&
++                                                      !(isspace((unsigned 
char) *q) ||
++                                                              *q == '\'' || 
*q == '"' || *q == '#'))
++                                              q++;
++                                      /* and save the argument value */
++                                      StrNCpy(sockstr, p, Min((q - p) + 1, 
sizeof(portstr)));
++                                      /* keep looking, maybe there is another 
*/
 +                              }
-                               /* keep looking, maybe there is another */
                        }
                }
+       }
 @@ -440,7 +456,7 @@
  
        for (i = 0; i < wait_seconds; i++)
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to