summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c4
-rw-r--r--Objects/longobject.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index b84819e..1c0598b 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -86,7 +86,7 @@ newfileobject(name, mode)
f = (fileobject *) newopenfileobject((FILE *)NULL, name, mode, fclose);
if (f == NULL)
return NULL;
-#ifdef THINK_C
+#ifdef USE_FOPENRF
if (*mode == '*') {
FILE *fopenRF();
f->f_fp = fopenRF(name, mode+1);
@@ -670,7 +670,7 @@ writestring(s, f)
err_clear();
}
else {
- if (writeobject(v, f, PRINT_RAW) != NULL)
+ if (writeobject(v, f, PRINT_RAW) != 0)
err_clear();
DECREF(v);
}
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 84fc552..85d1c66 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -606,8 +606,11 @@ long_compare(a, b)
;
if (i < 0)
sign = 0;
- else
+ else {
sign = (int)a->ob_digit[i] - (int)b->ob_digit[i];
+ if (a->ob_size < 0)
+ sign = -sign;
+ }
}
return sign < 0 ? -1 : sign > 0 ? 1 : 0;
}