Xref: utzoo unix-pc.sources:280 comp.sources.bugs:1630 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!spdcc!gnosys!gst From: gst@gnosys.UUCP (Gary S. Trujillo) Newsgroups: unix-pc.sources,comp.sources.bugs Subject: System V patches for "BSD indent(1) Message-ID: <136@gnosys.UUCP> Date: 24 Mar 89 19:37:58 GMT Organization: gst's 3B1 - Somerville, Massachusetts Lines: 108 In the spirit of trying to start paying back for all the good stuff I have received from the net, here are some patches for the recently- posted "indent" program, whose header is as follows: |From: rsalz@uunet.uu.net (Rich Salz) |Newsgroups: comp.sources.unix |Subject: v18i049: Indent, C reformatting program, Part01/03 |Message-ID: <1596@casaba.bbn.com> |Date: 21 Mar 89 21:25:41 GMT |Lines: 1477 |Approved: rsalz@uunet.UU.NET | |Submitted-by: Ozan Yigit |Posting-number: Volume 18, Issue 49 |Archive-name: indent/part01 | |[ Oz has done lots of work on cleaning up all the copyright questions, | and fixing one or two bugs. Kudo's to him. He might appreciate | fixes, and he might not. :-) --r$ ] I highly recommend this utility, as it enables one to make many of the religious questions about coding style rather moot. (However, I tend to save code when it comes from the net in what I may consider to be its original ugly form, just in case patches ever get posted. Anyway, the following patches should make the code compile just fine in a System V environment. ---------------------------------(cut here)------------------------------------ *** MakefileORIG Fri Mar 24 12:33:48 1989 --- Makefile Fri Mar 24 13:35:25 1989 *************** *** 16,22 # # @(#)Makefile 5.9 (Berkeley) 9/15/88 # ! CFLAGS= -O LIBC= /lib/libc.a SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c OBJS= indent.o io.o lexi.o parse.o pr_comment.o args.o --- 16,22 ----- # # @(#)Makefile 5.9 (Berkeley) 9/15/88 # ! CFLAGS= -O -DMAXPATHLEN=256 LIBC= /lib/libc.a SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c OBJS= indent.o io.o lexi.o parse.o pr_comment.o args.o *** indent.cORIG Fri Mar 24 12:36:28 1989 --- indent.c Fri Mar 24 14:14:33 1989 *************** *** 1018,1023 *sc_end++ = ' '; --line_no; } bcopy(s_lab + com_start, sc_end, com_end - com_start); sc_end += com_end - com_start; if (sc_end >= &save_com[sc_size]) --- 1018,1024 ----- *sc_end++ = ' '; --line_no; } + #ifdef BSD /* gst 3/24/89 */ bcopy(s_lab + com_start, sc_end, com_end - com_start); #else memcpy(sc_end, s_lab + com_start, com_end - com_start); *************** *** 1019,1024 --line_no; } bcopy(s_lab + com_start, sc_end, com_end - com_start); sc_end += com_end - com_start; if (sc_end >= &save_com[sc_size]) abort(); --- 1020,1028 ----- } #ifdef BSD /* gst 3/89 */ bcopy(s_lab + com_start, sc_end, com_end - com_start); + #else + memcpy(sc_end, s_lab + com_start, com_end - com_start); + #endif sc_end += com_end - com_start; if (sc_end >= &save_com[sc_size]) abort(); *** indent_glbs.h- Fri Mar 24 12:33:59 1989 --- indent_globs.h Fri Mar 24 13:57:32 1989 *************** *** 21,26 */ #include #define BACKSLASH '\\' #define bufsize 200 /* size of internal buffers */ --- 21,27 ----- */ #include + #include /* gst: 3/24/89 */ #define BACKSLASH '\\' #define bufsize 200 /* size of internal buffers */ *** io.cORIG Fri Mar 24 14:50:53 1989 --- io.c Fri Mar 24 14:00:56 1989 *************** *** 542,547 return s; } parsefont(f, s0) register struct fstate *f; --- 542,550 ----- return s; } + #ifndef BSD /* gst 3/89 */ + #define bzero(where, howmany) memset(where, (char)0, howmany) + #endif parsefont(f, s0) register struct fstate *f; -- Gary S. Trujillo {linus,bbn,m2c}!spdcc!gnosys!gst Somerville, Massachusetts {icus,ima,stech,wjh12}!gnosys!gst