FreeBSD Bugzilla – Attachment 6745 Details for
Bug 15091
add -I option to gnu groff and gnu soelim
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.16 KB, created by
Karl Dietz
on 1999-11-25 21:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Karl Dietz
Created:
1999-11-25 21:50:00 UTC
Size:
5.16 KB
patch
obsolete
>Index: src/contrib/groff/groff/groff.cc >=================================================================== >RCS file: /home/ncvs/src/contrib/groff/groff/groff.cc,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 groff.cc >--- groff.cc 1996/09/07 16:18:01 1.1.1.1 >+++ groff.cc 1999/11/02 18:57:49 >@@ -113,7 +113,7 @@ > command_prefix = PROG_PREFIX; > commands[TROFF_INDEX].set_name(command_prefix, "troff"); > while ((opt = getopt(argc, argv, >- "itpeRsSzavVhblCENXZF:m:T:f:w:W:M:d:r:n:o:P:L:")) >+ "abCd:eEf:F:hiI:lL:m:M:n:No:pP:r:RsStT:vVw:W:XzZ")) > != EOF) { > char buf[3]; > buf[0] = '-'; >@@ -122,6 +122,10 @@ > switch (opt) { > case 'i': > iflag = 1; >+ break; >+ case 'I': >+ commands[SOELIM_INDEX].set_name(command_prefix, "soelim"); >+ commands[SOELIM_INDEX].append_arg(buf, optarg); > break; > case 't': > commands[TBL_INDEX].set_name(command_prefix, "tbl"); >Index: src/contrib/groff/groff/groff.man >=================================================================== >RCS file: /home/ncvs/src/contrib/groff/groff/groff.man,v >retrieving revision 1.2.4.1 >diff -u -r1.2.4.1 groff.man >--- groff.man 1999/03/18 00:03:56 1.2.4.1 >+++ groff.man 1999/11/02 18:58:06 >@@ -48,6 +48,9 @@ > .BI \-F dir > ] > [ >+.BI \-I dir >+] >+[ > .BI \-T dev > ] > [ >@@ -150,6 +153,13 @@ > .TP > .B \-s > Preprocess with @g@soelim. >+.TP >+.BI \-I dir >+This option is as described in >+.BR @g@soelim (@MAN1EXT@) . >+This option implies the >+.B \-s >+option. > .TP > .B \-R > Preprocess with @g@refer. >Index: src/contrib/groff/soelim/soelim.cc >=================================================================== >RCS file: /home/ncvs/src/contrib/groff/soelim/soelim.cc,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 soelim.cc >--- soelim.cc 1996/09/07 16:18:11 1.1.1.1 >+++ soelim.cc 1999/11/02 18:58:14 >@@ -29,23 +29,38 @@ > #include "error.h" > #include "stringclass.h" > >+static int include_list_length; >+static char **include_list; >+ > int compatible_flag = 0; > > extern int interpret_lf_args(const char *); > > int do_file(const char *filename); > >+ >+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); >+ include_list[include_list_length - 1] = path; >+} >+ >+ > void usage() > { >- fprintf(stderr, "usage: %s [ -vC ] [ files ]\n", program_name); >+ fprintf(stderr, "usage: %s [ -vCI: ] [ files ]\n", program_name); > exit(1); > } > > int main(int argc, char **argv) > { > program_name = argv[0]; >+ include_path_append("."); > int opt; >- while ((opt = getopt(argc, argv, "vC")) != EOF) >+ while ((opt = getopt(argc, argv, "CI:v")) != EOF) > switch (opt) { > case 'v': > { >@@ -57,6 +72,9 @@ > case 'C': > compatible_flag = 1; > break; >+ case 'I': >+ include_path_append(optarg); >+ break; > case '?': > usage(); > break; >@@ -125,17 +143,49 @@ > int do_file(const char *filename) > { > FILE *fp; >- if (strcmp(filename, "-") == 0) >+ string whole_filename; >+ if (strcmp(filename, "-") == 0) { > fp = stdin; >- else { >+ whole_filename = filename; >+ whole_filename += '\0'; >+ } >+ else if (filename[0] == '/') { >+ whole_filename = filename; >+ whole_filename += '\0'; > errno = 0; > fp = fopen(filename, "r"); > if (fp == 0) { > error("can't open `%1': %2", filename, strerror(errno)); > return 0; > } >+ } >+ else { >+ size_t j; >+ for (j = 0; j < include_list_length; ++j) >+ { >+ char *path = include_list[j]; >+ if (0 == strcmp(path, ".")) >+ whole_filename = filename; >+ else >+ whole_filename = string(path) + "/" + filename; >+ whole_filename += '\0'; >+ errno = 0; >+ fp = fopen(whole_filename.contents(), "r"); >+ if (fp != 0) >+ break; >+ if (errno != ENOENT) { >+ error("can't open `%1': %2", whole_filename.contents(), strerror(errno)); >+ return 0; >+ } >+ } >+ if (j >= include_list_length) >+ { >+ errno = ENOENT; >+ error("can't open `%1': %2", filename, strerror(errno)); >+ return 0; >+ } > } >- current_filename = filename; >+ current_filename = whole_filename.contents(); > current_lineno = 1; > set_location(); > enum { START, MIDDLE, HAD_DOT, HAD_s, HAD_so, HAD_l, HAD_lf } state = START; >Index: src/contrib/groff/soelim/soelim.man >=================================================================== >RCS file: /home/ncvs/src/contrib/groff/soelim/soelim.man,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 soelim.man >--- soelim.man 1996/09/07 16:18:11 1.1.1.1 >+++ soelim.man 1999/11/02 18:58:20 >@@ -25,6 +25,9 @@ > .B \-Cv > ] > [ >+.BI \-I dir >+] >+[ > .IR files \|.\|.\|.\| > ] > .SH DESCRIPTION >@@ -52,6 +55,16 @@ > Recognize > .B .so > even when followed by a character other than space or newline. >+.TP >+.BI \-I dir >+This option may be used to specify a directory to search for >+files (both those on the command line and those named in >+.B \&.so >+lines). >+The current directory is always searched first. >+This option may be specified more than once, >+the directories will be searched in the order specified. >+No directory search is performed for files specified using an absolute path. > .TP > .B \-v > Print the version number.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15091
: 6745