Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pixutl.UUCP Path: utzoo!linus!decvax!harpo!seismo!harvard!wjh12!pixel!pixutl!chris From: chris@pixutl.UUCP (chris) Newsgroups: net.bugs Subject: 3 minor 'vi' bugs. Message-ID: <43@pixutl.UUCP> Date: Tue, 3-Jul-84 11:02:12 EDT Article-I.D.: pixutl.43 Posted: Tue Jul 3 11:02:12 1984 Date-Received: Wed, 4-Jul-84 05:21:07 EDT Organization: Pixel Computer Inc., Wilmington, Mass. Lines: 53 [] Try this: vi a file, type '^F', then '100^B', then '^G'. If everything still looks normal, try a few more '100^B'. Now try that one: ':set ht=0'. Finally, try ':set sw=0', then open a new line and type '^D'. The first bug is in the CTRL(b) case of vmain(), line ~= 425 in ex_vmain.c. There are some parentheses missing in the address calculation which causes it to get higher rather than lower when you enter a 'n^B'. If the resulting address is greater than the number of lines in the file, you will get an empty screen with a cursor somewhere in the middle of it, or a core dump. /* original code */ addr = dot - vcline - 2 + (cnt-1)*basWLINES; /* modified code */ addr = dot - ((vcline - 2) + (cnt-1)*basWLINES); The second and third 'bugs' (some people may argue that setting these values at 0 doesn't make much sense anyway, but sooner or later, someone will try it) can be fixed easily by adding the same check for these 2 values as the one for 'TABSTOP'. In ex_set.c, around line 100, add these lines: if (value(HARDTABS) <= 0) value(HARDTABS) = TABS; if (value(SHIFTWIDTH) <= 0) value(SHIFTWIDTH) = TABS; after these lines: if (value(TABSTOP) <= 0) value(TABSTOP) = TABS; Any comments or other suggestions? Chris. -- Chris Bertin : (617) 657-8720 x2318 Pixel Computer Inc. : 260 Fordham Rd. : {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\ Wilmington, Ma 01887 : !wjh12!pixel!pixutl!chris