Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!gargoyle!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.bugs.4bsd Subject: vi eats control-Ds in sourced files Message-ID: <10817@mimsy.UUCP> Date: 27 Mar 88 04:44:58 GMT Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 54 Index: ucb/ex/ex_get.c 4.3BSD Fix Description: When vi (ex) reads .exrc files or other sourced files, it discards control-D. This makes it difficult to map something to a string that includes a control-D, or to remap ^D itself. Repeat-By: Create a .exrc file with the line map! ^D foo (that is, map control-D anything). Run vi; note `missing rhs' error. Fix: This seems to be what is required. In any case it accounts for the fact that newline-to-control-D mapping is done only when `intty' is set. RCS file: RCS/ex_get.c,v retrieving revision 1.1 diff -c2 -r1.1 ex_get.c *** /tmp/,RCSt1003257 Sat Mar 26 22:51:12 1988 --- ex_get.c Sat Mar 26 22:50:55 1988 *************** *** 31,35 **** do c = getcd(); ! while (!globp && c == CTRL(d)); return (c); } --- 31,35 ---- do c = getcd(); ! while (!globp && intty && c == CTRL(d)); return (c); } *************** *** 45,49 **** c &= TRIM; if (!inopen) ! if (!globp && c == CTRL(d)) setlastchar('\n'); else if (junk(c)) { --- 45,49 ---- c &= TRIM; if (!inopen) ! if (!globp && intty && c == CTRL(d)) setlastchar('\n'); else if (junk(c)) { -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris