home *** CD-ROM | disk | FTP | other *** search
- From decwrl!purdue!mailrus!csd4.milw.wisc.edu!leah!itsgw!steinmetz!uunet!allbery Sun Jan 22 15:42:27 PST 1989
- Article 777 of comp.sources.misc:
- Path: granite!decwrl!purdue!mailrus!csd4.milw.wisc.edu!leah!itsgw!steinmetz!uunet!allbery
- From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
- Newsgroups: comp.sources.misc
- Subject: v06i002: dvi2tty bugfix
- Message-ID: <46898@uunet.UU.NET>
- Date: 21 Jan 89 20:22:28 GMT
- Sender: allbery@uunet.UU.NET
- Reply-To: seindal@sleipner.diku.dk.UUCP (Rene' Seindal)
- Lines: 81
- Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 6, Issue 2
- Submitted-by: seindal@sleipner.diku.dk.UUCP (Rene' Seindal)
- Archive-name: dvi2tty.patch1
-
- The following patch is necessary for dvi2tty to work on machines that trap
- NULL pointers. The posted version didn't test the return value of
- ``getenv("DVI2TTY")''.
-
- Rene' Seindal (seindal@diku.dk).
-
- ------------------------------------------------------------------------
- *** /tmp/,RCSt1a03240 Thu Jan 5 13:08:24 1989
- --- /tmp/,RCSt2a03240 Thu Jan 5 13:08:25 1989
- ***************
- *** 263,294 ****
- else
- path = DEFPAGER; /* pathname of pager program */
-
- ! envp = getenv("DVI2TTY");
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- ! while (*envp) { /* environment var args */
- ! if (strchr(optset, optch = *envp++) != NULL) {
- ! /*
- ! * we always pass one option, and arrange for optarg ourselfves,
- ! * so setoption does not mesh up Argv
- ! */
- ! if (strchr(optwarg, optch) != NULL) {
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- ! if (*envp == '\0')
- ! usage(noarg);
- ! str = envp; /* str points to optarg */
- ! while ((*envp != ' ') && (*envp != '\0'))
- ! *envp++; /* set envp just after optarg */
- ! if (*envp != '\0')
- ! *envp++ = '\0'; /* end optarg string */
- ! }
- ! setoption(optch, optset, optwarg, str);
- ! }
- ! else
- ! usage(bdopt);
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- }
-
- while (--Argc > 0) { /* command line args */
- --- 263,295 ----
- else
- path = DEFPAGER; /* pathname of pager program */
-
- ! if ((envp = getenv("DVI2TTY")) != 0) {
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- ! while (*envp) { /* environment var args */
- ! if (strchr(optset, optch = *envp++) != NULL) {
- ! /*
- ! * we always pass one option, and arrange for optarg
- ! * ourselfves, so setoption does not mesh up Argv
- ! */
- ! if (strchr(optwarg, optch) != NULL) {
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- ! if (*envp == '\0')
- ! usage(noarg);
- ! str = envp; /* str points to optarg */
- ! while ((*envp != ' ') && (*envp != '\0'))
- ! *envp++; /* set envp just after optarg */
- ! if (*envp != '\0')
- ! *envp++ = '\0'; /* end optarg string */
- ! }
- ! setoption(optch, optset, optwarg, str);
- ! }
- ! else
- ! usage(bdopt);
- ! while ((*envp == ' ') && (*envp != '\0'))
- ! envp++;
- ! }
- }
-
- while (--Argc > 0) { /* command line args */
-
-
-