This makes the initcap function compatible with Oracle 9i, it has been
authorBruce Momjian
Sun, 27 Jul 2003 03:16:20 +0000 (03:16 +0000)
committerBruce Momjian
Sun, 27 Jul 2003 03:16:20 +0000 (03:16 +0000)
tested on both redhat 8 and FreebSD.
--
Mike Nolan

src/backend/utils/adt/oracle_compat.c

index 54730ded79608d53e34c0b44707132655d4e171c..5cfc215d71309f495bfc2b6de428ddc64af25e2f 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/oracle_compat.c,v 1.44 2003/05/23 22:33:20 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/oracle_compat.c,v 1.45 2003/07/27 03:16:20 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -132,7 +132,8 @@ initcap(PG_FUNCTION_ARGS)
 
    while (m-- > 0)
    {
-       if (isspace((unsigned char) ptr[-1]))
+       /* Oracle capitalizes after all non-alphanumeric */
+       if (!isalnum((unsigned char) ptr[-1]))
            *ptr = toupper((unsigned char) *ptr);
        else
            *ptr = tolower((unsigned char) *ptr);