Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c65a525

Browse files
committed
* 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
1 parent 781db5d commit c65a525

5 files changed

Lines changed: 21 additions & 10 deletions

File tree

Modules/Makefile.pre.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ glmodule.c: $(srcdir)/cgen.py $(srcdir)/cstubs
9898

9999
almodule.o: almodule.c
100100
arraymodule.o: arraymodule.c
101-
audioopmodule.o: audioopmodule.c
101+
audioop.o: audioop.c
102102
cdmodule.o: cdmodule.c
103103
clmodule.o: clmodule.c
104104
dbmmodule.o: dbmmodule.c
105105
fcntlmodule.o: fcntlmodule.c
106106
flmodule.o: flmodule.c
107107
fmmodule.o: fmmodule.c
108108
glmodule.o: glmodule.c
109-
imageopmodule.o: imageopmodule.c
110-
imgfilemodule.o: imgfilemodule.c
109+
imageop.o: imageop.c
110+
imgfile.o: imgfile.c
111111
mathmodule.o: mathmodule.c
112112
md5c.o: md5c.c
113113
md5module.o: md5module.c
@@ -126,7 +126,7 @@ socketmodule.o: socketmodule.c
126126
stdwinmodule.o: stdwinmodule.c
127127
stropmodule.o: stropmodule.c
128128
structmodule.o: structmodule.c
129-
sunaudiodevmodule.o: sunaudiodevmodule.c
129+
sunaudiodev.o: sunaudiodev.c
130130
svmodule.o: svmodule.c
131131
threadmodule.o: threadmodule.c
132132
timemodule.o: timemodule.c

Modules/Setup.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ socket socketmodule.o # socket(2); not on ancient System V
9393
# Multimedia modules -- on by default.
9494
# These represent audio samples or images as strings
9595

96-
audioop audioopmodule.o # Operations on audio samples
97-
imageop imageopmodule.o # Operations on images
96+
audioop audioop.o # Operations on audio samples
97+
imageop imageop.o # Operations on images
9898
rgbimg rgbimgmodule.o # Read SGI RGB image files (but coded portably)
9999

100100

@@ -148,7 +148,7 @@ rotor rotormodule.o
148148
#cl clmodule.o -lcl # -lawareaudio
149149
#fm fmmodule.o -lfm_s -lgl_s
150150
#gl glmodule.o -lgl_s -lX11_s
151-
#imgfile imgfilemodule.o -limage -lgutil
151+
#imgfile imgfile.o -limage -lgutil
152152
#sgi sgimodule.o
153153
#sv svmodule.o yuvconvert.o -lsvideo -lXext -lX11_s
154154

@@ -165,7 +165,7 @@ rotor rotormodule.o
165165

166166
# SunOS specific modules -- off by default
167167

168-
# sunaudiodev sunaudiodevmodule.o
168+
# sunaudiodev sunaudiodev.o
169169

170170

171171
# Thread module -- works on SGI IRIX and on SunOS 5.x (SOLARIS) only.
@@ -196,7 +196,7 @@ rotor rotormodule.o
196196

197197

198198
# Jack Jansen's imgformat module
199-
# imgformat imgformatmodule.o
199+
# imgformat imgformat.o
200200

201201

202202
# Lance Ellinghouse's syslog module

Modules/regexpr.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,11 @@ regexp_registers_t regs;
12511251
goto error;
12521252
failure_stack_start = (struct failure_point *)
12531253
malloc(MAX_FAILURES * sizeof(*failure_stack_start));
1254+
if (failure_stack_start == NULL)
1255+
{
1256+
failure_stack_start = initial_failure_stack;
1257+
goto error;
1258+
}
12541259
failure_stack_end = failure_stack_start + MAX_FAILURES;
12551260
memcpy((char *)failure_stack_start, (char *)initial_failure_stack,
12561261
INITIAL_FAILURES * sizeof(*failure_stack_start));
@@ -1529,6 +1534,8 @@ char *s;
15291534
/* the buffer will be allocated automatically */
15301535
re_comp_buf.fastmap = malloc(256);
15311536
re_comp_buf.translate = NULL;
1537+
if (re_comp_buf.fastmap == NULL)
1538+
return "Out of memory";
15321539
}
15331540
return re_compile_pattern(s, strlen(s), &re_comp_buf);
15341541
}

Modules/socketmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ sock_accept(s, args)
380380
}
381381

382382

383+
#if 0
383384
/* s.allowbroadcast() method */
384385
/* XXX obsolete -- will disappear in next release */
385386

@@ -399,6 +400,7 @@ sock_allowbroadcast(s, args)
399400
INCREF(None);
400401
return None;
401402
}
403+
#endif
402404

403405

404406
/* s.setsockopt() method.
@@ -796,7 +798,9 @@ sock_shutdown(s, args)
796798

797799
static struct methodlist sock_methods[] = {
798800
{"accept", (method)sock_accept},
801+
#if 0
799802
{"allowbroadcast", (method)sock_allowbroadcast},
803+
#endif
800804
{"setsockopt", (method)sock_setsockopt},
801805
{"getsockopt", (method)sock_getsockopt},
802806
{"bind", (method)sock_bind},

Modules/stropmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ strop_rindex(self, args)
256256
}
257257

258258
if (n == 0)
259-
return newintobject((long)i);
259+
return newintobject((long)len);
260260

261261
for (j = len-n; j >= i; --j)
262262
if (s[j] == sub[0] &&

0 commit comments

Comments
 (0)