From a812d8b090bc4edc23150bff257717b24f282e41 Mon Sep 17 00:00:00 2001 From: ru Date: Tue, 5 Dec 2000 18:49:44 +0000 Subject: Virgin import of FSF groff v1.16.1 --- contrib/groff/soelim/Makefile.sub | 2 +- contrib/groff/soelim/soelim.cc | 19 ++++++++++++++----- contrib/groff/soelim/soelim.man | 6 +++++- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'contrib/groff/soelim') diff --git a/contrib/groff/soelim/Makefile.sub b/contrib/groff/soelim/Makefile.sub index 7c873a6..77007e2 100644 --- a/contrib/groff/soelim/Makefile.sub +++ b/contrib/groff/soelim/Makefile.sub @@ -2,5 +2,5 @@ PROG=soelim MAN1=soelim.n XLIBS=$(LIBGROFF) OBJS=soelim.o -CCSRCS=soelim.cc +CCSRCS=$(srcdir)/soelim.cc NAMEPREFIX=$(g) diff --git a/contrib/groff/soelim/soelim.cc b/contrib/groff/soelim/soelim.cc index a6f63ae..257fc88 100644 --- a/contrib/groff/soelim/soelim.cc +++ b/contrib/groff/soelim/soelim.cc @@ -28,6 +28,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "errarg.h" #include "error.h" #include "stringclass.h" +#include "nonposix.h" static int include_list_length; static char **include_list; @@ -43,8 +44,16 @@ static void include_path_append(char *path) { ++include_list_length; - size_t nbytes = include_list_length * sizeof(include_list[0]); - include_list = (char **)realloc((void *)include_list, nbytes); + size_t nbytes = include_list_length * sizeof(char *); + if (include_list) + include_list = (char **)realloc((void *)include_list, nbytes); + else + include_list = (char **)malloc(nbytes); + if (include_list == NULL) + { + fprintf(stderr, "%s: out of memory\n", program_name); + exit(2); + } include_list[include_list_length - 1] = path; } @@ -64,8 +73,8 @@ int main(int argc, char **argv) switch (opt) { case 'v': { - extern const char *version_string; - fprintf(stderr, "GNU soelim version %s\n", version_string); + extern const char *Version_string; + fprintf(stderr, "GNU soelim version %s\n", Version_string); fflush(stderr); break; } @@ -149,7 +158,7 @@ int do_file(const char *filename) whole_filename = filename; whole_filename += '\0'; } - else if (filename[0] == '/') { + else if (IS_ABSOLUTE(filename)) { whole_filename = filename; whole_filename += '\0'; errno = 0; diff --git a/contrib/groff/soelim/soelim.man b/contrib/groff/soelim/soelim.man index 7026f3e..0d927f7 100644 --- a/contrib/groff/soelim/soelim.man +++ b/contrib/groff/soelim/soelim.man @@ -1,5 +1,5 @@ .ig \"-*- nroff -*- -Copyright (C) 1989-1999 Free Software Foundation, Inc. +Copyright (C) 1989-2000 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -30,6 +30,10 @@ the original English. [ .IR files \|.\|.\|.\| ] +.PP +It is possible to have whitespace between the +.B \-I +command line option and its parameter. .SH DESCRIPTION .B @g@soelim reads -- cgit v1.1