/*
* Edmund Mergl <E.Mergl@bawue.de>
*
- * $Id: oracle_compat.c,v 1.5 1997/03/16 20:40:39 scrappy Exp $
+ * $Id: oracle_compat.c,v 1.6 1997/05/07 02:46:45 scrappy Exp $
*
*/
char *ptr, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0) {
+ if ((string == (text *)NULL) || ((m = VARSIZE(string) - VARHDRSZ) <= 0))
return string;
- }
ret = (text *)palloc(VARSIZE(string));
VARSIZE(ret) = VARSIZE(string);
char *ptr, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0) {
+ if ((string == (text *)NULL) || ((m = VARSIZE(string) - VARHDRSZ) <= 0))
return string;
- }
ret = (text *)palloc(VARSIZE(string));
VARSIZE(ret) = VARSIZE(string);
char *ptr, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0) {
+ if ((string == (text *)NULL) || ((m = VARSIZE(string) - VARHDRSZ) <= 0))
return string;
- }
ret = (text *)palloc(VARSIZE(string));
VARSIZE(ret) = VARSIZE(string);
char *ptr1, *ptr2, *ptr_ret;
int m, n;
- m = len - VARSIZE(string1) + VARHDRSZ;
-
- if (m <= 0 || (VARSIZE(string2) - VARHDRSZ) <= 0) {
+ if ((string1 == (text *)NULL) ||
+ (len <= (VARSIZE(string1) - VARHDRSZ)) ||
+ ((m = len - VARSIZE(string1) + VARHDRSZ) <= 0) ||
+ (string2 == (text *)NULL) ||
+ ((VARSIZE(string2) - VARHDRSZ) <= 0))
return string1;
- }
ret = (text *)palloc(VARHDRSZ + len);
VARSIZE(ret) = VARHDRSZ + len;
char *ptr1, *ptr2, *ptr_ret;
int m, n;
- m = len - VARSIZE(string1) + VARHDRSZ;
-
- if (m <= 0 || (VARSIZE(string2) - VARHDRSZ) <= 0) {
+ if ((string1 == (text *)NULL) ||
+ (len <= (VARSIZE(string1) - VARHDRSZ)) ||
+ ((m = len - VARSIZE(string1) + VARHDRSZ) <= 0) ||
+ (string2 == (text *)NULL) ||
+ ((VARSIZE(string2) - VARHDRSZ) <= 0))
return string1;
- }
ret = (text *)palloc(VARHDRSZ + len);
VARSIZE(ret) = VARHDRSZ + len;
char *ptr, *ptr2, *end2, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0 || VARSIZE(set) - VARHDRSZ <= 0) {
+ if ((string == (text *)NULL) ||
+ ((m = VARSIZE(string) - VARHDRSZ) <= 0) ||
+ (set == (text *)NULL) ||
+ ((VARSIZE(set) - VARHDRSZ) <= 0))
return string;
- }
ptr = VARDATA(string);
ptr2 = VARDATA(set);
char *ptr, *ptr2, *end2, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0 || VARSIZE(set) - VARHDRSZ <= 0) {
+ if ((string == (text *)NULL) ||
+ ((m = VARSIZE(string) - VARHDRSZ) <= 0) ||
+ (set == (text *)NULL) ||
+ ((VARSIZE(set) - VARHDRSZ) <= 0))
return string;
- }
ptr = VARDATA(string) + VARSIZE(string) - VARHDRSZ - 1;
ptr2 = VARDATA(set);
char *ptr, *ptr_ret;
int len;
- len = VARSIZE(string) - VARHDRSZ - m;
-
- if (m <= 0 || n <= 0 || len <= 0) {
+ if ((string == (text *)NULL) ||
+ (m <= 0) || (n <= 0) ||
+ ((len = VARSIZE(string) - VARHDRSZ - m) <= 0))
return string;
- }
len = len + 1 < n ? len + 1 : n;
char *ptr, *ptr_ret;
int m;
- m = VARSIZE(string) - VARHDRSZ;
-
- if (m <= 0) {
+ if ((string == (text *)NULL) ||
+ ((m = VARSIZE(string) - VARHDRSZ) <= 0))
return string;
- }
ret = (text *)palloc(VARSIZE(string));
VARSIZE(ret) = VARSIZE(string);
/* EOF */
+
+
+
+
+
+
+
+