Commit Graph

82 Commits

Author SHA1 Message Date
rin 4696254e45 Respect coding style of upstream; revert r1.4 and put back parentheses.
No binary changes. Pointed out by mrg.
2017-01-22 05:11:22 +00:00
rin 8b69e36164 Bump for } command fix in v_paragraph.c r1.5. 2017-01-21 22:27:43 +00:00
rin b1d8d816a1 Fix a strange corner case in } command.
When } command is executed in the last paragraph including EOF, the original vi
(traditional/SVR4) moves the cursor to the *last* character in the last line.
However, nvi moves it to the *first* character in the last line.
2017-01-21 22:22:28 +00:00
rin af424159bb KNF; remove parentheses from return's 2017-01-21 22:06:46 +00:00
abhinav 59739e51e1 Fix the date (setting the date to the same as the date on which this version was imported).
Looks like the '%Q%' was supposed to be translated to an actual date through
some tool but neither the README nor the Makefile say anything. So just
setting the date manually.

ok wiz@
2016-12-27 06:50:03 +00:00
rin 3cc4108dd3 improve logic related to sh_prompt:
- sscr_insert(): sh_prompt should be compared with t, not p
- replace strnstr(3) with memcmp(3)
now, nvi is free from strnstr(3); it can be safely pulled-up into netbsd-7
2016-12-19 17:51:40 +00:00
dholland 9b9748abd1 PR 51446 Brad Harder: fix synopsis for :tagprev 2016-08-27 03:34:28 +00:00
dholland 720d49add0 Restore the first line of the copyright header, which accidentally got
zapped in -r1.2.
2016-08-27 03:30:48 +00:00
christos 9601406bf3 add default: to appease gcc. 2016-03-17 00:19:36 +00:00
christos 79f68c0e48 remove CONST; it is unused from Brad Harder 2016-01-07 14:07:01 +00:00
christos 28e12a3821 Fix > 1024 char lines in script. (Rin Okuyama) 2015-11-29 17:09:33 +00:00
christos da825a2b9f PR/50484: Rin Okuyama: fix the script command of vi(1) 2015-11-28 13:20:02 +00:00
christos d4ec6dff41 PR/50092: Rin Okuyama: Fix memory leaks in vi when resizing. 2015-11-25 20:25:20 +00:00
christos ec8137f3d4 PR/50360: Thomas Klausner: MKREPRO fix 2015-11-25 01:08:34 +00:00
christos 7d4d979d64 add QUEUEDEBUG commented out 2015-01-23 03:04:06 +00:00
christos ff90272441 exrc expects 1 argument. 2014-11-27 20:00:09 +00:00
christos afdd00276d Fix the index building which got completely broken after the last update. 2014-09-10 21:44:22 +00:00
aymeric f90e2756f0 missed setting TAG_IS_LINKED in a special case in my previous commit.
Bug reported by Brad Harder, thanks!
2014-08-26 15:19:38 +00:00
aymeric 94f28557e3 In tagq_free(), fix the test checking whether a TAGQ should be removed from
its tailq. This required introducing a new flag in the TAGQ structure to
avoid reverting to poking under the hood of the queue.h API.

The concrete bug it solves is that using tags would make vi crash reliably
on exit.
2014-08-22 21:28:20 +00:00
dholland dcc711d503 Reorg docs, part 2:
Rename the following reference documents to match their programs:
   shell -> sh
   viref -> vi

and rename the following to match their topic better:
   ipctut -> sockets
   ipc -> sockets-advanced

Also, the old "timed" and "timedop" docs are now ref5/timed and
ref8/timed respectively, as the first of these documented the
protocol.
2014-07-05 19:23:00 +00:00
dholland b7b7574d3b Reorg docs, part 1:
Move all the reference manuals to subdirs of /usr/share/doc/reference.
We have subdirs ref1-ref9, corresponding to man page sections 1-9.

Everything that's the reference manual for a program (sections 1, 6,
8), C interface (sections 2, 3), driver or file system (section 4),
format or configuration (section 5), or kernel internal interface
(section 9) belongs in here.

Section 7 is a little less clear: some things that might go in section
7 if they were a man page aren't really reference manuals. So I'm only
putting things in reference section 7 that are (to me) clearly
reference material, rather than e.g. tutorials, guides, FAQs, etc.
This obviously leaves some room for debate, especially without first
editing the docs with this distinction in mind, but if people hate
what I've done things can always be moved again.

Note also that while roff macro man pages traditionally go in section
7, I have put all the roff documentation (macros, tools, etc.) in one
place in reference/ref1/roff. This will make it easier to find and
also easier to edit it into some kind of coherent form.
2014-07-05 19:22:41 +00:00
dholland c3ab26950f Rework /usr/share/doc.
Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
   - explicit use of soelim
   - refer
   - tbl
   - pic
   - eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.
2014-07-05 19:22:02 +00:00
dholland 94efa53a98 PR toolchain/48833: Ilia Zykov: nvi build fails if under /common
When autogenerating headers from source (yuck) use a more selective
pattern to avoid selecting anything if part of the current absolute
path happens to match part of the nvi source tree.
2014-05-23 19:59:17 +00:00
joerg 59f647b48e One __RCSID is enough. Don't define it when building catalog as tool. 2014-01-28 20:43:55 +00:00
christos 638199ebfd little manual fixing 2014-01-26 21:47:00 +00:00
christos 2689d3025f add netbsd rcsids (does not handle the regex files well) 2014-01-26 21:46:49 +00:00
christos 2f698edb5c Fix RCSID's 2014-01-26 21:43:44 +00:00
christos 5053829301 remove register 2014-01-07 21:48:12 +00:00
christos d7bd454c19 handle unaligned accesses 2014-01-07 21:46:47 +00:00
joerg 44aca6ca00 Check format strings for ex_printf. 2014-01-07 02:14:02 +00:00
christos 3286a3a6f9 PR/48502: M. Levinson: vi(1) no longer moves the cursor when yanking text
using a mark (remove dangling else)
2014-01-06 14:21:37 +00:00
mlelstv 99a38adeb5 screen_end can be called multiple times for the same screen.
Work around segfault in TAILQ_REMOVE by abusing the tqe_prev pointer
as a flag that identifies an already removed node.

This should really be solved by calling screen_end only once or by
keeping state explicitely in the screen structure.
2014-01-06 07:56:47 +00:00
christos 1e0c3a0bf7 PR/48502: M. Levinson: vi(1) no longer moves the cursor when yanking text
using a mark (remove dangling else)
2014-01-05 17:30:16 +00:00
christos 6495e57c27 don't use err, it conflicts with err(3) 2013-12-25 17:18:39 +00:00
christos a1f28fb37d Handle more cases where a screen has not been fully initialized (inserted
into the scrq) by calling screen_fini() instead of screen_end() where
appropriate. Pointed out by chuq.
2013-12-01 21:48:33 +00:00
christos b4e9b749e1 Revert all previous TAILQ_NEXT() = NULL, changes, checks against
NULL vip's and removal of screens from queues. Instead introduce
a new screen_end1() function that can be used to clean screens that
are not associated with queues yet. Pointed out by chuq@
2013-12-01 02:34:54 +00:00
christos d95058d03d fix indentantion 2013-12-01 02:21:58 +00:00
christos 0481af84d9 Fix recovery mode, there were multiple issues:
1. the btree filename was not set so that we always used a transient
   in-memory db for the data
2. we did not call sync after creation with R_RECNOSYNC so that the header
   of the btree was never written
3. we did not call the right flavor of sync before copying the tree to the
   preserved files
2013-11-30 14:54:29 +00:00
christos 0c38cb8432 Don't rebuild the header files all the time if they did not change 2013-11-30 14:52:40 +00:00
christos 81e29e1a78 Bring back the compatibility db3->db1 code from the old vi.
This is selected with -DUSE_DB1 in the Makefile. By default
use use the db1 specific code from the current nvi which is
enabled using -DUSE_BUNDLED_DB. Unfortunately recovery seems
to be broken for both.
2013-11-29 22:56:19 +00:00
christos c24e3e9954 make the debugging code work again. 2013-11-29 21:57:31 +00:00
christos 9e92fc9e98 fix tracing. 2013-11-29 16:37:35 +00:00
christos fabe6cc1b9 fix compilation of log debugging 2013-11-29 16:36:11 +00:00
christos 770857d9f8 remove unused variable 2013-11-29 15:24:08 +00:00
christos 80e7303ab0 Make sure that the next pointers are NULL when we insert screens in the list.
This avoids the problem when screens are re-used that have stale pointers in
them. This was not an issue with circleq's because all the pointers used to
be updated.
2013-11-28 23:19:43 +00:00
christos 145d30531d fix bug in coversion 2013-11-28 03:15:20 +00:00
christos ed21ba284d use more list macros 2013-11-28 03:15:02 +00:00
christos f6f8c67078 fix syntax error 2013-11-28 03:14:28 +00:00
christos 4265642a08 CID 272343: Fix resource leak 2013-11-27 21:17:36 +00:00
christos 74b5281623 CID 1062355: Fix resource leak 2013-11-27 21:16:10 +00:00