Implemented support for very long strings a la spss v13/v14
[pspp-builds.git] / src / language / expressions / operations.def
index 95ac1e0b53ab2c14fdf86c8d4412e840f7335283..717bc15ef39fd105175f28e5625f9873522f9855 100644 (file)
@@ -306,7 +306,7 @@ string function CONCAT (string a[n])
   struct fixed_string dst;
   size_t i;
 
-  dst = alloc_string (e, 255);
+  dst = alloc_string (e, MAX_STRING);
   dst.length = 0;
   for (i = 0; i < n; i++)
     {
@@ -314,8 +314,8 @@ string function CONCAT (string a[n])
       size_t copy_len;
 
       copy_len = src->length;
-      if (dst.length + copy_len > 255)
-        copy_len = 255 - dst.length;
+      if (dst.length + copy_len > MAX_STRING)
+        copy_len = MAX_STRING - dst.length;
       memcpy (&dst.string[dst.length], src->string, copy_len);
       dst.length += copy_len;
     }
@@ -440,7 +440,7 @@ string function UPCASE (string s)
 absorb_miss string function LPAD (string s, n)
      expression e;
 {
-  if (n < 0 || n > 255 || (int) n != n)
+  if (n < 0 || n > MAX_STRING || (int) n != n)
     return empty_string;
   else if (s.length >= n)
     return s;
@@ -456,7 +456,7 @@ absorb_miss string function LPAD (string s, n)
 absorb_miss string function LPAD (string s, n, string c)
      expression e;
 {
-  if (n < 0 || n > 255 || (int) n != n || c.length != 1)
+  if (n < 0 || n > MAX_STRING || (int) n != n || c.length != 1)
     return empty_string;
   else if (s.length >= n)
     return s;
@@ -472,7 +472,7 @@ absorb_miss string function LPAD (string s, n, string c)
 absorb_miss string function RPAD (string s, n)
      expression e;
 {
-  if (n < 0 || n > 255 || (int) n != n)
+  if (n < 0 || n > MAX_STRING || (int) n != n)
     return empty_string;
   else if (s.length >= n)
     return s;
@@ -488,7 +488,7 @@ absorb_miss string function RPAD (string s, n)
 absorb_miss string function RPAD (string s, n, string c)
      expression e;
 {
-  if (n < 0 || n > 255 || (int) n != n || c.length != 1)
+  if (n < 0 || n > MAX_STRING || (int) n != n || c.length != 1)
     return empty_string;
   else if (s.length >= n)
     return s;