Commit fe83f38c authored by Guido van Rossum's avatar Guido van Rossum

* Modules/{Setup.in,Makefile.pre.in}: renamed some modules to

	shorter names (dropped the "module" from the name): sunaudiodev,
	imgformat, audioop, imageop, imgfile

	* Modules/stropmodule.c (strop_rindex): make rindex('abc', '') do
	the right thing (i.e. return 3 instead of 0)

	* Modules/socketmodule.c: disabled allowbroadcast() socket method
parent d09b31bb
...@@ -98,7 +98,7 @@ glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs ...@@ -98,7 +98,7 @@ glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
almodule.o: almodule.c almodule.o: almodule.c
arraymodule.o: arraymodule.c arraymodule.o: arraymodule.c
audioopmodule.o: audioopmodule.c audioop.o: audioop.c
cdmodule.o: cdmodule.c cdmodule.o: cdmodule.c
clmodule.o: clmodule.c clmodule.o: clmodule.c
dbmmodule.o: dbmmodule.c dbmmodule.o: dbmmodule.c
...@@ -106,8 +106,8 @@ fcntlmodule.o: fcntlmodule.c ...@@ -106,8 +106,8 @@ fcntlmodule.o: fcntlmodule.c
flmodule.o: flmodule.c flmodule.o: flmodule.c
fmmodule.o: fmmodule.c fmmodule.o: fmmodule.c
glmodule.o: glmodule.c glmodule.o: glmodule.c
imageopmodule.o: imageopmodule.c imageop.o: imageop.c
imgfilemodule.o: imgfilemodule.c imgfile.o: imgfile.c
mathmodule.o: mathmodule.c mathmodule.o: mathmodule.c
md5c.o: md5c.c md5c.o: md5c.c
md5module.o: md5module.c md5module.o: md5module.c
...@@ -126,7 +126,7 @@ socketmodule.o: socketmodule.c ...@@ -126,7 +126,7 @@ socketmodule.o: socketmodule.c
stdwinmodule.o: stdwinmodule.c stdwinmodule.o: stdwinmodule.c
stropmodule.o: stropmodule.c stropmodule.o: stropmodule.c
structmodule.o: structmodule.c structmodule.o: structmodule.c
sunaudiodevmodule.o: sunaudiodevmodule.c sunaudiodev.o: sunaudiodev.c
svmodule.o: svmodule.c svmodule.o: svmodule.c
threadmodule.o: threadmodule.c threadmodule.o: threadmodule.c
timemodule.o: timemodule.c timemodule.o: timemodule.c
......
...@@ -93,8 +93,8 @@ socket socketmodule.o # socket(2); not on ancient System V ...@@ -93,8 +93,8 @@ socket socketmodule.o # socket(2); not on ancient System V
# Multimedia modules -- on by default. # Multimedia modules -- on by default.
# These represent audio samples or images as strings # These represent audio samples or images as strings
audioop audioopmodule.o # Operations on audio samples audioop audioop.o # Operations on audio samples
imageop imageopmodule.o # Operations on images imageop imageop.o # Operations on images
rgbimg rgbimgmodule.o # Read SGI RGB image files (but coded portably) rgbimg rgbimgmodule.o # Read SGI RGB image files (but coded portably)
...@@ -148,7 +148,7 @@ rotor rotormodule.o ...@@ -148,7 +148,7 @@ rotor rotormodule.o
#cl clmodule.o -lcl # -lawareaudio #cl clmodule.o -lcl # -lawareaudio
#fm fmmodule.o -lfm_s -lgl_s #fm fmmodule.o -lfm_s -lgl_s
#gl glmodule.o -lgl_s -lX11_s #gl glmodule.o -lgl_s -lX11_s
#imgfile imgfilemodule.o -limage -lgutil #imgfile imgfile.o -limage -lgutil
#sgi sgimodule.o #sgi sgimodule.o
#sv svmodule.o yuvconvert.o -lsvideo -lXext -lX11_s #sv svmodule.o yuvconvert.o -lsvideo -lXext -lX11_s
...@@ -165,7 +165,7 @@ rotor rotormodule.o ...@@ -165,7 +165,7 @@ rotor rotormodule.o
# SunOS specific modules -- off by default # SunOS specific modules -- off by default
# sunaudiodev sunaudiodevmodule.o # sunaudiodev sunaudiodev.o
# Thread module -- works on SGI IRIX and on SunOS 5.x (SOLARIS) only. # Thread module -- works on SGI IRIX and on SunOS 5.x (SOLARIS) only.
...@@ -196,7 +196,7 @@ rotor rotormodule.o ...@@ -196,7 +196,7 @@ rotor rotormodule.o
# Jack Jansen's imgformat module # Jack Jansen's imgformat module
# imgformat imgformatmodule.o # imgformat imgformat.o
# Lance Ellinghouse's syslog module # Lance Ellinghouse's syslog module
......
...@@ -1251,6 +1251,11 @@ regexp_registers_t regs; ...@@ -1251,6 +1251,11 @@ regexp_registers_t regs;
goto error; goto error;
failure_stack_start = (struct failure_point *) failure_stack_start = (struct failure_point *)
malloc(MAX_FAILURES * sizeof(*failure_stack_start)); malloc(MAX_FAILURES * sizeof(*failure_stack_start));
if (failure_stack_start == NULL)
{
failure_stack_start = initial_failure_stack;
goto error;
}
failure_stack_end = failure_stack_start + MAX_FAILURES; failure_stack_end = failure_stack_start + MAX_FAILURES;
memcpy((char *)failure_stack_start, (char *)initial_failure_stack, memcpy((char *)failure_stack_start, (char *)initial_failure_stack,
INITIAL_FAILURES * sizeof(*failure_stack_start)); INITIAL_FAILURES * sizeof(*failure_stack_start));
...@@ -1529,6 +1534,8 @@ char *s; ...@@ -1529,6 +1534,8 @@ char *s;
/* the buffer will be allocated automatically */ /* the buffer will be allocated automatically */
re_comp_buf.fastmap = malloc(256); re_comp_buf.fastmap = malloc(256);
re_comp_buf.translate = NULL; re_comp_buf.translate = NULL;
if (re_comp_buf.fastmap == NULL)
return "Out of memory";
} }
return re_compile_pattern(s, strlen(s), &re_comp_buf); return re_compile_pattern(s, strlen(s), &re_comp_buf);
} }
......
...@@ -380,6 +380,7 @@ sock_accept(s, args) ...@@ -380,6 +380,7 @@ sock_accept(s, args)
} }
#if 0
/* s.allowbroadcast() method */ /* s.allowbroadcast() method */
/* XXX obsolete -- will disappear in next release */ /* XXX obsolete -- will disappear in next release */
...@@ -399,6 +400,7 @@ sock_allowbroadcast(s, args) ...@@ -399,6 +400,7 @@ sock_allowbroadcast(s, args)
INCREF(None); INCREF(None);
return None; return None;
} }
#endif
/* s.setsockopt() method. /* s.setsockopt() method.
...@@ -796,7 +798,9 @@ sock_shutdown(s, args) ...@@ -796,7 +798,9 @@ sock_shutdown(s, args)
static struct methodlist sock_methods[] = { static struct methodlist sock_methods[] = {
{"accept", (method)sock_accept}, {"accept", (method)sock_accept},
#if 0
{"allowbroadcast", (method)sock_allowbroadcast}, {"allowbroadcast", (method)sock_allowbroadcast},
#endif
{"setsockopt", (method)sock_setsockopt}, {"setsockopt", (method)sock_setsockopt},
{"getsockopt", (method)sock_getsockopt}, {"getsockopt", (method)sock_getsockopt},
{"bind", (method)sock_bind}, {"bind", (method)sock_bind},
......
...@@ -256,7 +256,7 @@ strop_rindex(self, args) ...@@ -256,7 +256,7 @@ strop_rindex(self, args)
} }
if (n == 0) if (n == 0)
return newintobject((long)i); return newintobject((long)len);
for (j = len-n; j >= i; --j) for (j = len-n; j >= i; --j)
if (s[j] == sub[0] && if (s[j] == sub[0] &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment