OpenBSD CVS

CVS log for src/usr.bin/mg/file.c


[BACK] Up to [local] / src / usr.bin / mg

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.104 / (download) - annotate - [select for diffs], Tue Apr 23 13:34:50 2024 UTC (3 weeks, 5 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

correct indentation; no functional change
ok tb@

Revision 1.103 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:11 2023 UTC (14 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.102: +1 -8 lines
Diff to previous 1.102 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.102 / (download) - annotate - [select for diffs], Sat Jun 22 15:03:43 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.101: +4 -3 lines
Diff to previous 1.101 (colored)

Offering to add a new line at the end of the buffer didn't consider if
the user pressed C-g. Now it does.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Jun 22 10:21:57 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
Changes since 1.100: +12 -5 lines
Diff to previous 1.100 (colored)

This diff moves the check for a newline at the end of a buffer (when
saving it) earlier. This means data doesn't 'disappear' from the file
on disk while the user answers 'yes' or 'no'.

Revision 1.100 / (download) - annotate - [select for diffs], Sat Jan 2 10:39:19 2016 UTC (8 years, 4 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.99: +13 -5 lines
Diff to previous 1.99 (colored)

Add dired-find-alternate-file.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Oct 29 19:46:47 2015 UTC (8 years, 6 months ago) by lum
Branch: MAIN
Changes since 1.98: +1 -3 lines
Diff to previous 1.98 (colored)

Fix opening dired from the command line. Incorrect cursor placement
and make the error more useful when there is a problem opening a
directory. Reported by and ok jasper@

Revision 1.98 / (download) - annotate - [select for diffs], Tue Sep 29 08:53:53 2015 UTC (8 years, 7 months ago) by lum
Branch: MAIN
Changes since 1.97: +27 -5 lines
Diff to previous 1.97 (colored)

Check to see if the file to be opened is a directory as soon as is
feasible. Currently, mg does this check much later on which means some
functions (e.g showbuffer()) are called multiple times. This fixes the
location of the cursor when opening a directory using filevisit,
findvisitalt and poptofile. ok jasper@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Mar 25 12:25:36 2015 UTC (9 years, 1 month ago) by bcallah
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.96: +2 -5 lines
Diff to previous 1.96 (colored)

We really don't need ttydef.h -- it is like sysdef.h -- once useful because
supported a lot of systems and nothing was standardized. But now it only
4 defines. Move those defines into def.h since ttydef.h is only sourced in
def.h

While here, MAKEBACKUP has the same #ifdef dance that LINENOMODE had. Set
it directly to TRUE and remove the #ifdef block.

ok florian@

Revision 1.96 / (download) - annotate - [select for diffs], Thu Mar 19 21:22:15 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
Changes since 1.95: +10 -4 lines
Diff to previous 1.95 (colored)

Clean up the includes in mg.
This does the following:
Moves all POSIX headers from sysdef.h into the individual .c files so that
each file now only includes what it needs. All headers are properly sorted.
Moves the remainder of sysdef.h to other files (mostly def.h) and deletes
sysdef.h now that it's no longer contains anything.
Tweak a comment that references sysdef.h so that it no longer does that.
ok florian@

Revision 1.95 / (download) - annotate - [select for diffs], Wed Apr 9 20:50:03 2014 UTC (10 years, 1 month ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.94: +16 -14 lines
Diff to previous 1.94 (colored)

Revert 1.93, it breaks permission checks.
"go for it" deraadt@

Revision 1.94 / (download) - annotate - [select for diffs], Thu Apr 3 20:17:12 2014 UTC (10 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.93: +4 -4 lines
Diff to previous 1.93 (colored)

When finding a file in a non-existant directory:

C-x C-f ~/no/dir/here/fn

offer to make the directory by pressing 'y', instead of suggesting the
make-directory command. ok jasper@

Revision 1.93 / (download) - annotate - [select for diffs], Mon Mar 31 21:29:59 2014 UTC (10 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.92: +14 -16 lines
Diff to previous 1.92 (colored)

Tidy up. No functional change.

Revision 1.92 / (download) - annotate - [select for diffs], Thu Mar 20 07:47:29 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.91: +10 -2 lines
Diff to previous 1.91 (colored)

Add some missing dobeeps.
ok florian@

Revision 1.91 / (download) - annotate - [select for diffs], Fri Mar 14 10:02:52 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
Changes since 1.90: +6 -1 lines
Diff to previous 1.90 (colored)

Check if buffer is to be saved as a directory.
ok florian@

Revision 1.90 / (download) - annotate - [select for diffs], Mon Dec 23 14:58:16 2013 UTC (10 years, 4 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.89: +1 -28 lines
Diff to previous 1.89 (colored)

Move findbuffer() to buffer.c.
ok florian@

Revision 1.89 / (download) - annotate - [select for diffs], Tue Oct 22 09:54:16 2013 UTC (10 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.88: +3 -4 lines
Diff to previous 1.88 (colored)

Fix previous; ENOCOFFEE.
Move xdirname call into the right if block, pointed out by Ulrich
Mueller.

Revision 1.88 / (download) - annotate - [select for diffs], Tue Oct 22 07:41:23 2013 UTC (10 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.87: +10 -10 lines
Diff to previous 1.87 (colored)

Our man page states that it's not portable to rely on dirname(3) not
modifying the contents of the passed string. Replace dirname(3) with
mg's xdirname portability helper function (a slightly different fix
than Gentoo's).

Report and initial analysis by Marien Zwart in Gentoo bug #487758 via
Han Boetes (hboetes _AT_ gmail).
Gentoo bugfix by Ulrich Mueller (ulm _AT_ gentoo).
testing on glibc / input Ulrich Mueller; testing on glibc Han Boetes.
Thanks!

OK jasper@

Revision 1.87 / (download) - annotate - [select for diffs], Mon Mar 25 11:38:22 2013 UTC (11 years, 1 month ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.86: +5 -1 lines
Diff to previous 1.86 (colored)

Record when the buffer was saved in the undo history. The buffer
will be marked unchanged at the correct point when stepping
through the undo history.
OK jasper@

Revision 1.86 / (download) - annotate - [select for diffs], Sun Feb 10 15:38:18 2013 UTC (11 years, 3 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

Grammar nits.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Nov 27 19:46:46 2012 UTC (11 years, 5 months ago) by jasper
Branch: MAIN
Changes since 1.84: +4 -3 lines
Diff to previous 1.84 (colored)

- add 'make-directory' (not bound to any shortcut).

feedback from florian@ lum@
ok florian@

Revision 1.84 / (download) - annotate - [select for diffs], Thu Aug 30 21:36:48 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

oops. need to reset errno. Otherwise we can't save a new file in a
directory where permissions are ok.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Aug 30 06:09:12 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.82: +16 -1 lines
Diff to previous 1.82 (colored)

This diff allows the user to decide what to do with buffers that
experience write errors during C-x C-c (exiting mg). Emacs stops the
exiting process when it encounters problem buffers and lets the user
decide what to do, currently mg continues exiting and the contents of
these buffers are lost. This diff bring mg more into line with emacs.

Review and observations from Sunil Nimmagadda.

Revision 1.82 / (download) - annotate - [select for diffs], Tue Aug 28 11:37:49 2012 UTC (11 years, 8 months ago) by lum
Branch: MAIN
Changes since 1.81: +24 -6 lines
Diff to previous 1.81 (colored)

Make mg behave more like emacs with regards to opening a new buffer:

1. If parent directory is read-only, make buffer read-only.
2. If parent doesn't exist; give user a message and create buffer
   as readable.

Reviewed by Sunil Nimmagadda.
ok jasper@

Revision 1.81 / (download) - annotate - [select for diffs], Mon Jun 18 09:19:21 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.80: +5 -7 lines
Diff to previous 1.80 (colored)

Removing this 'if' statement allows dired buffers to not have their
forward and backward line pointers pointing to the same line, causing
mg to spin when asked to split the window. This happens if a directory
is opened via the command line sequentially first, and other windows
need to opened afterwards (for other files).

Since the information within this 'if' statement is updated later for
files and directories I can see no problem with removing this. No
regressions viewable either.

Problem reported by and diff tested by jasper@

Revision 1.80 / (download) - annotate - [select for diffs], Fri May 25 04:56:58 2012 UTC (11 years, 11 months ago) by lum
Branch: MAIN
Changes since 1.79: +16 -12 lines
Diff to previous 1.79 (colored)

Remove static FILE pointer used for handling files in fileio.c. Pass
by reference instead. This allows the mg startup file to open other
files without unexpected things happening.

Discussed with Sunil Nimmagadda.

Revision 1.79 / (download) - annotate - [select for diffs], Thu May 10 16:07:46 2012 UTC (12 years ago) by lum
Branch: MAIN
Changes since 1.78: +5 -2 lines
Diff to previous 1.78 (colored)

Allow throwaway buffers to be saved via C-c s. This diff
does not change the behaviour with regards to mg not asking
to save throwaway buffers when exiting.

Reviewed by Sunil Nimmagadda.

Revision 1.78 / (download) - annotate - [select for diffs], Tue May 8 15:26:31 2012 UTC (12 years ago) by lum
Branch: MAIN
Changes since 1.77: +4 -2 lines
Diff to previous 1.77 (colored)

Fix a bug in writeout() where the stats of the wrong file
were given to a buffer being written.

Reviewed by Sunil Nimmagadda.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Apr 11 14:16:57 2012 UTC (12 years, 1 month ago) by lum
Branch: MAIN
Changes since 1.76: +14 -2 lines
Diff to previous 1.76 (colored)

When writing a file via 'C-x C-w', ask user if they want to overwrite an
existing file. This mimics emacs behaviour.

Reviewed by Sunil Nimmagadda.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Aug 31 08:58:29 2011 UTC (12 years, 8 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.75: +6 -4 lines
Diff to previous 1.75 (colored)

On a file write fail:

1. return an error value
2. show an error message

From Loganaden Velvindron with suggestion from millert@

Revision 1.75 / (download) - annotate - [select for diffs], Sun Jan 23 00:45:03 2011 UTC (13 years, 3 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.74: +37 -22 lines
Diff to previous 1.74 (colored)

Wrap basename,dirname with xbasename, xdirname funtions,
which have fewer special cases, and use the strlcpy/strlcat
src/dst/buffer len semantic. More portable to boot.
Discussion and feedback from Henri Kemppainen

Revision 1.74 / (download) - annotate - [select for diffs], Fri Jan 21 19:10:13 2011 UTC (13 years, 4 months ago) by kjell
Branch: MAIN
Changes since 1.73: +3 -3 lines
Diff to previous 1.73 (colored)

It volates style(9), but in mg, #include"def.h" goes first. 'twas the way it was built. no binary change here. confirmed by lum@, tested by Henri Kemppainen

Revision 1.73 / (download) - annotate - [select for diffs], Tue Jan 18 16:29:37 2011 UTC (13 years, 4 months ago) by kjell
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

augbname immediately does a basename. No need to do it in the
caller, too. ok lum@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jun 26 16:18:44 2010 UTC (13 years, 10 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.71: +7 -5 lines
Diff to previous 1.71 (colored)

From the Loganaden Velvindron:
 Make dired more sane (and emacslike):
 *  Position cursor at first filename after ..
 *  Don't reposition cursor on reopening
 *  Check for permission before attempting to open directory

I took forever to get this in. Thanks, Logan for being patient!

Revision 1.71 / (download) - annotate - [select for diffs], Thu Jun 4 23:39:37 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Add the notion of an "ephemeral" popup, so we can flag a window
for destruction at a later date. (in the process, add a window flag field)

This fixes an issue noted by maja: namely, the *completion*
window that pops up when you try to complete a filename on
buffer load would destroy any second window that you happened
to have open.

ok maja@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Jun 4 02:23:37 2009 UTC (14 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored)

Rename w_flag to w_rflag. This is not a general purpose
flag: it is for redisplay options only. I need an additional all-purpose
flag, so renaming removes the desire to wrongly overload the existing one.

Turdshine. No functional chage.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Sep 15 16:13:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.68: +6 -6 lines
Diff to previous 1.68 (colored)

Expose the undo commands as proper mg functions.
This should have no functional change on undo, but it does facilitate
testing undo behavior.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Sep 15 16:11:35 2008 UTC (15 years, 8 months ago) by kjell
Branch: MAIN
Changes since 1.67: +11 -2 lines
Diff to previous 1.67 (colored)

Enable dirty buffer detection in mg.
Emulate the emacs behavior: after suspend/resume, buffer switch,
or at save time, warn (prompt) the user if the file has been modified
on disk in the interim.
This has already saved my butt numerous times.
ok phessler

Revision 1.67 / (download) - annotate - [select for diffs], Wed Jun 18 17:13:53 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Don't free the buffer name until after you call adjustname.
Fixes a segfault that occurs when you write a file to an alternate name.
Introduced by yours truly in 20060406. how did it last this long?

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jun 13 18:45:41 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.65: +28 -4 lines
Diff to previous 1.65 (colored)

Fix debian bug #432656
'Prints root directory as "//" instead of "/" for root files.'
Issue was with dirname, which strips the trailing slash, except
when given "/". Wrap it in a cover function to fix. Also helps
with portability to data-munging dirname glibc.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Mar 21 08:01:20 2008 UTC (16 years, 2 months ago) by pyr
Branch: MAIN
Changes since 1.64: +4 -2 lines
Diff to previous 1.64 (colored)

Reset startrow when opening multiple files. Spotted by matthieu@
ok, kjell@, matthieu@

Revision 1.64 / (download) - annotate - [select for diffs], Sun Dec 24 01:20:53 2006 UTC (17 years, 4 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.63: +25 -17 lines
Diff to previous 1.63 (colored)

Fix a bug where inserting a file resulted in an incorrect
line-number count for a buffer (M-X insert-file, M-> to reproduce).
While here, fix a number of bugs with incorrect line numbers
after swap point-and-mark

Originally reported via debian's bug tracking system. Fix tested by
Han Boetes and Deanna Phillips.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Nov 17 08:45:31 2006 UTC (17 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.62: +4 -2 lines
Diff to previous 1.62 (colored)

Fix a needless inversion of flag names; i.e. change them from the
negative to the positive. undo_boundary_enable(TRUE) makes a LOT more
sense than undo_no_boundary(FALSE).
While here, whack a global, and fix a bug noted by otto:
undoing a file insertion sometimes left stray characters around.
ok beck@, otto@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Jul 25 08:27:09 2006 UTC (17 years, 9 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Add bfirstlp(), blastlp() macros, returning the first and last lines
of a buffer respectively. Removes an ugly construction than necessitated
"go to first line"-type comments throughout the code.
No binary change

Revision 1.61 / (download) - annotate - [select for diffs], Tue Jul 25 08:22:32 2006 UTC (17 years, 9 months ago) by kjell
Branch: MAIN
Changes since 1.60: +5 -5 lines
Diff to previous 1.60 (colored)

Rename the header line of a buffer to b_headp, from the remarkably
unintuitive b_linep. No binary change.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Jul 8 17:56:10 2006 UTC (17 years, 10 months ago) by kjell
Branch: MAIN
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored)

Introduce a 'MODIFIED' boundary type for undo records.
This allows undo to clear the modified flag when undo-ing all the way
from a loaded buffer.
Originally whipped up at c2k6 after proddings from beck.
jason@ ok.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jun 1 09:00:50 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.58: +10 -7 lines
Diff to previous 1.58 (colored)

Display line number in the mg statusbar.  Yes, it seems like a fugly
way to do it, but all the clever and pretty ways utterly failed.
Basic use seems fine. We'll turdshine the special cases later.

If it bothers you, use M-x line-number-mode, or put same in your ~/.mg
file to disable.

ok cloder, jason

Revision 1.58 / (download) - annotate - [select for diffs], Thu Jun 1 05:34:52 2006 UTC (17 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.57: +6 -6 lines
Diff to previous 1.57 (colored)

make // /~ path rewriting optional in adjustname() and use it everywhere
except for the command line specified files.  ok kjell,cloder

Revision 1.57 / (download) - annotate - [select for diffs], Thu Jun 1 05:07:39 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.56: +12 -11 lines
Diff to previous 1.56 (colored)

Initialize current window, and clear the readonly flag earlier in file
read process.  This allows code in the autoexec path (i.e. ~/.mg) to
operate on the buffer, making ~/.mg files much more useful.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Jun 1 01:41:49 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.55: +3 -1 lines
Diff to previous 1.55 (colored)

find-file-other-window and find-buffer-other-window should split
the window if you ask for whatever file you are currently visiting.
pointed out, ok beck@

Revision 1.55 / (download) - annotate - [select for diffs], Sun May 28 23:30:16 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored)

Make Window Flags more mnemonic (and less dumb); i.e.
WFHARD -> WFFULL (Redraw full window)
WFFORCE -> WFFRAME (Reframe window).
No binary change

Revision 1.54 / (download) - annotate - [select for diffs], Tue May 2 17:10:25 2006 UTC (18 years ago) by kjell
Branch: MAIN
Changes since 1.53: +30 -29 lines
Diff to previous 1.53 (colored)

Make buffers store their own working directory. This makes things like
grep, compile, lint work as expected (act on current buffer's cwd).
Display this path when opening or replacing a file, rather than
relying on the user to guess, or remember.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Apr 6 05:28:17 2006 UTC (18 years, 1 month ago) by kjell
Branch: MAIN
Changes since 1.52: +13 -18 lines
Diff to previous 1.52 (colored)

Fix a bug whereby a written buffer (^X^W) would not have the correct
trailing buffer number appended (e.g. "file<2>") in case an existing
buffer shared its basename().

Revision 1.52 / (download) - annotate - [select for diffs], Mon Apr 3 05:03:34 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.51: +5 -4 lines
Diff to previous 1.51 (colored)

few more int that can become a size_t

Revision 1.51 / (download) - annotate - [select for diffs], Mon Apr 3 00:40:56 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

lint love; ok kjell

Revision 1.50 / (download) - annotate - [select for diffs], Tue Dec 20 06:17:36 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.49: +2 -3 lines
Diff to previous 1.49 (colored)

Clean up the ugly casted frees. In one case, this meant eliminating a nasty
struct/union/casting nightmare when building the list of names for filename
completion. In particular, be consistent about strduping and freeing
the list data.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Dec 20 05:04:28 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.48: +5 -3 lines
Diff to previous 1.48 (colored)

Do some delinting of strl-type functions. Also, remove a superfluous
word in the undo-list.

Revision 1.48 / (download) - annotate - [select for diffs], Tue Dec 13 06:01:27 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

More name-clash delinting

Revision 1.47 / (download) - annotate - [select for diffs], Sun Nov 20 04:16:34 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.46: +7 -25 lines
Diff to previous 1.46 (colored)

Kill the NO_BACKUP #ifdef

Revision 1.46 / (download) - annotate - [select for diffs], Sun Nov 20 03:24:17 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.45: +1 -5 lines
Diff to previous 1.45 (colored)

toast NO_DIRED #ifdef; ok kjell

Revision 1.45 / (download) - annotate - [select for diffs], Fri Nov 18 20:56:52 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +16 -16 lines
Diff to previous 1.44 (colored)

greedy use of typedef struct was making code harder to read; ok kjell cloder

Revision 1.44 / (download) - annotate - [select for diffs], Sun Nov 13 07:24:48 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.43: +9 -4 lines
Diff to previous 1.43 (colored)

Copy buffer before handing it to basename().
Inspired by a patch from Han Boetes.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 14 19:46:46 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

add missing /* ARGSUSED */ to quiet lint.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Oct 13 20:28:49 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

spacing

Revision 1.41 / (download) - annotate - [select for diffs], Thu Oct 13 20:23:01 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.40: +14 -4 lines
Diff to previous 1.40 (colored)

Make dired buffer read-only by default.
Noticed by Han Boetes

Revision 1.40 / (download) - annotate - [select for diffs], Thu Oct 13 19:46:45 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.39: +17 -1 lines
Diff to previous 1.39 (colored)

Use dired mode automatically if file specified for loading is
a directory. Modified version of patch from Han Boetes.
ok cloder@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Oct 13 05:34:11 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.38: +14 -15 lines
Diff to previous 1.38 (colored)

KNF and minor cleanup. Remove an impossible condition check.
Also, remove annoying "now readonly" message, as this information
is already reflected in the statusbar

Revision 1.38 / (download) - annotate - [select for diffs], Tue Aug 9 00:53:48 2005 UTC (18 years, 9 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

Clean up eread handling in mg. (basically, fallout from the 'enter often
means abort' behaviour added during the hackathon). Eliminates
redundant ereply function, fixes miscellaneous cores when aborting,
and move a number of assumed pathnames into the prompt text, since
they are used there anyway. All changes consistent with emacs behavior

ok beck@ many, many moons ago.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jun 14 18:14:40 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.36: +3 -1 lines
Diff to previous 1.36 (colored)

Add explicit public domain notices to all public domain files.
ok millert@, deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jun 3 08:23:12 2005 UTC (18 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.35: +43 -3 lines
Diff to previous 1.35 (colored)

Clean up find-alternate-file (C-x C-v) so abort returns to original
file, like its emacs ancestor.

ok cloder@

Revision 1.35 / (download) - annotate - [select for diffs], Mon May 30 13:13:50 2005 UTC (18 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.34: +9 -1 lines
Diff to previous 1.34 (colored)

add find-alternate-file command and binding for ^X^V; ok cloder
(you're welcome kjell)

Revision 1.34 / (download) - annotate - [select for diffs], Fri May 27 08:52:30 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.33: +12 -3 lines
Diff to previous 1.33 (colored)

In find file, behave like emacs: the default starting directory for
completion is the directory of the current buffer's file, if any,
rather than the working directory from where you launched mg.
Prodding by reyk, ok reyk and fgont

Revision 1.33 / (download) - annotate - [select for diffs], Thu Apr 21 19:16:21 2005 UTC (19 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

correct strlcpy abuse, and always check for NULL return from find_buffer
ok cloder@, feedback from many

Revision 1.32 / (download) - annotate - [select for diffs], Sun Apr 3 02:09:28 2005 UTC (19 years, 1 month ago) by db
Branch: MAIN
Changes since 1.31: +37 -36 lines
Diff to previous 1.31 (colored)

This is a no binary change which does:

- spelling, punctuation fixes
- variable declaration lineup
- use parentheses for return and sizeof
- K&R function declarations -> ANSI
- other minor code beautification

ok henning@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Mar 10 18:27:47 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.30: +6 -6 lines
Diff to previous 1.30 (colored)

fix more BACKUP/NOBACKUP/NO_BACKUP confusion, again no binary change.
spotted by jmc@

Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 9 16:20:48 2005 UTC (19 years, 2 months ago) by jfb
Branch: MAIN
Changes since 1.29: +19 -6 lines
Diff to previous 1.29 (colored)

fix mg's behaviour with regards to files on which we do not have
write access.  diff originally from vincent@ and forgotten for
a while.

ok rohee@, "toss it in, i'll bitch if it doesn't work" henning@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jul 22 01:25:25 2004 UTC (19 years, 10 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.28: +27 -23 lines
Diff to previous 1.28 (colored)

stage 1 of the infinite minibuffer work - add support for on the fly
buffer reallocation in veread().  This commit only changes the API.
All the buffers have exactly the same bounds as before for now.

tested by a couple of my very helpful testers!

Revision 1.28 / (download) - annotate - [select for diffs], Sun Nov 9 00:19:02 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

fix the undo record size for insert-file so we do not get an extra byte

Revision 1.27 / (download) - annotate - [select for diffs], Sat Nov 8 19:17:29 2003 UTC (20 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

typos from Jonathon Gray;

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 13 02:29:29 2003 UTC (20 years, 7 months ago) by vincent
Branch: MAIN
Changes since 1.25: +10 -2 lines
Diff to previous 1.25 (colored)

remember the new filename on ^X^W

ok deraadt

Revision 1.25 / (download) - annotate - [select for diffs], Sat Aug 16 00:24:51 2003 UTC (20 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

spacing

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jan 6 17:04:09 2003 UTC (21 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.23: +4 -1 lines
Diff to previous 1.23 (colored)

support +number; rewritten from buggy code by mjc@bitz.ca, vincent ok

Revision 1.23 / (download) - annotate - [select for diffs], Sun Sep 15 22:18:40 2002 UTC (21 years, 8 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.22: +10 -2 lines
Diff to previous 1.22 (colored)

don't add undo records when we open a file, only when we insert it.

ok deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jul 25 16:37:54 2002 UTC (21 years, 9 months ago) by vincent
Branch: MAIN
Changes since 1.21: +12 -4 lines
Diff to previous 1.21 (colored)

 replace the ugly and buggy adjustname function by a simple one using
simple APIs. makes mg not crash with 65k filenames...

 ok art@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jul 3 03:47:59 2002 UTC (21 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.20: +3 -1 lines
Diff to previous 1.20 (colored)

 a few missing tests for malloc()'s return value.

 ok art@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 1 14:33:44 2002 UTC (21 years, 10 months ago) by vincent
Branch: MAIN
Changes since 1.19: +11 -20 lines
Diff to previous 1.19 (colored)

KNF + ansi; from zyrnix (only the easy part of his diffs)

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jun 19 22:02:08 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.18: +11 -10 lines
Diff to previous 1.18 (colored)

add an undo insert record on insert-file.  this makes insert-file undoable.

ok deraadt@

Revision 1.18 / (download) - annotate - [select for diffs], Wed May 29 12:41:42 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.17: +12 -2 lines
Diff to previous 1.17 (colored)

 add an "auto-execute" feature, that allows binding function calls to
certain patterns. for example, `auto-execute "*.c" auto-indent-mode'.

 ok art@

Revision 1.17 / (download) - annotate - [select for diffs], Wed May 29 12:32:51 2002 UTC (21 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.16: +12 -1 lines
Diff to previous 1.16 (colored)

 add a function to visit a file read-only mapped to C-x C-v

 ok art@

Revision 1.16 / (download) - annotate - [select for diffs], Sat Mar 16 04:17:36 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.15: +9 -1 lines
Diff to previous 1.15 (colored)

 add readonly buffer support
 plus some KNF

 ok art@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Mar 11 13:02:56 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.14: +4 -7 lines
Diff to previous 1.14 (colored)

  * Move to ANSI function definitions.
  * Add a whole lot of consts where I thought it made sense

   no ok, but no objections either...

Revision 1.14 / (download) - annotate - [select for diffs], Tue Feb 19 12:58:42 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.13: +7 -11 lines
Diff to previous 1.13 (colored)


 Make multiple buffers with the same basename work correctly.. (like GNU
 emacs) and unbreak a stupid loop at the same time.

 ok art@

Revision 1.13 / (download) - annotate - [select for diffs], Thu Feb 14 14:24:21 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

some KNF

Revision 1.12 / (download) - annotate - [select for diffs], Wed Feb 13 22:50:40 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (colored)

 Oups, don't print fname<1> when there's only one buffer for this file.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Feb 13 22:36:58 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

 Make mg malloc the l_text element instead of reallocating whole LINE
 structures all the time.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Feb 13 03:03:49 2002 UTC (22 years, 3 months ago) by vincent
Branch: MAIN
Changes since 1.9: +7 -7 lines
Diff to previous 1.9 (colored)

 * Replace unsafe strcpy and strcat calls to safe strlcpy and strlcat.
 * Be a little bit more verbose about some errors
 * Fix some memory leaks in fileio.c

ok deraadt@, art@

Revision 1.9 / (download) - annotate - [select for diffs], Thu May 24 03:05:22 2001 UTC (23 years ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.8: +27 -27 lines
Diff to previous 1.8 (colored)

spaces

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 23 22:36:14 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.7: +5 -5 lines
Diff to previous 1.7 (colored)

Get rid of unnecessary casts of NULL.

Revision 1.7 / (download) - annotate - [select for diffs], Wed May 23 22:20:35 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.6: +10 -10 lines
Diff to previous 1.6 (colored)

remove VOID. We're way beyond the point where this could build with an
ancient compiler.

Revision 1.6 / (download) - annotate - [select for diffs], Fri May 4 22:00:35 2001 UTC (23 years ago) by art
Branch: MAIN
Changes since 1.5: +6 -65 lines
Diff to previous 1.5 (colored)

Cleanups in filename and buffer name handling.
Mostly just using libc instead of rolling our own.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 29 01:58:07 2001 UTC (23 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.4: +2 -0 lines
Diff to previous 1.4 (colored)

$OpenBSD$

Revision 1.4 / (download) - annotate - [select for diffs], Fri Sep 1 14:59:08 2000 UTC (23 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.3: +173 -153 lines
Diff to previous 1.3 (colored)

More -Wall anmd KNF, from op2@tomahawk.SQUiSH.org

Revision 1.3 / (download) - annotate - [select for diffs], Thu Apr 13 06:12:14 2000 UTC (24 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.2: +224 -177 lines
Diff to previous 1.2 (colored)

The start of KNF + -Wall.  The code has been run through indent but
needs hand fixup.  I stopped at keymap.c...

Revision 1.2 / (download) - annotate - [select for diffs], Sat Feb 26 22:53:16 2000 UTC (24 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

change WINDOW -> MGWIN to avoid curses type conflict
convert to terminfo in tty*.c
add support for some keypad function keys (arrows, pgup, pgdown)

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 25 19:08:47 2000 UTC (24 years, 2 months ago) by deraadt
Branch: MAIN

initial import of mg2a

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.