Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!nrl-cmf!ames!pasteur!ucbvax!hplabs!hpda!hpcupt1!hpirs!wk From: wk@hpirs.HP.COM (Wayne Krone) Newsgroups: comp.bugs.4bsd Subject: Re: vi eats control-Ds in sourced files Message-ID: <3900002@hpirs.HP.COM> Date: 1 Apr 88 22:45:23 GMT References: <10817@mimsy.UUCP> Organization: Hewlett Packard, Cupertino Lines: 30 Re, my earlier comment: > Is this really a problem that needs fixing? Quote the ctrl-D with a > ctrl-V and it works without the fix. The following line entered either > interactively or via a .exrc file will accomplish the desired result: > > map! ^V^D foo My apologies. I fixed HP's implementation some months ago and only remembered how it works, not that I had modified it, when I made the above posting. I have a different fix from Chris because I wanted to keep the .exrc input the same as the interactive input (i.e., to map ctrl-D from within vi you must precede the ctrl-D with ctrl-V so I reasoned input from the .exrc file should also have a ctrl-V preceding the ctrl-D). Is this line of reasoning incorrect? Alternate fix: In the routine mapcmd() in ex_cmdsub.c the following appears twice: if (c == CTRL(v)) { c = getchar(); The fix is to change "getchar" to be "getcd" in both places. Again, I apologize for my forgetfulness. Wayne Krone Hewlett-Packard