summaryrefslogtreecommitdiffstats
path: root/usr.bin/mg/file.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up the ugly casted frees. In one case, this meant eliminating a nastykjell2005-12-201-3/+2
| | | | | | struct/union/casting nightmare when building the list of names for filename completion. In particular, be consistent about strduping and freeing the list data.
* Do some delinting of strl-type functions. Also, remove a superfluouskjell2005-12-201-3/+5
| | | | word in the undo-list.
* More name-clash delintingkjell2005-12-131-2/+2
|
* Kill the NO_BACKUP #ifdefkjell2005-11-201-25/+7
|
* toast NO_DIRED #ifdef; ok kjellderaadt2005-11-201-5/+1
|
* greedy use of typedef struct was making code harder to read; ok kjell cloderderaadt2005-11-181-16/+16
|
* Copy buffer before handing it to basename().kjell2005-11-131-4/+9
| | | | Inspired by a patch from Han Boetes.
* add missing /* ARGSUSED */ to quiet lint.kjell2005-10-141-1/+2
|
* spacingderaadt2005-10-131-2/+2
|
* Make dired buffer read-only by default.kjell2005-10-131-4/+14
| | | | Noticed by Han Boetes
* Use dired mode automatically if file specified for loading iskjell2005-10-131-1/+17
| | | | | a directory. Modified version of patch from Han Boetes. ok cloder@
* KNF and minor cleanup. Remove an impossible condition check.kjell2005-10-131-15/+14
| | | | | Also, remove annoying "now readonly" message, as this information is already reflected in the statusbar
* Clean up eread handling in mg. (basically, fallout from the 'enter oftenkjell2005-08-091-2/+3
| | | | | | | | | 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.
* Add explicit public domain notices to all public domain files.kjell2005-06-141-1/+3
| | | | ok millert@, deraadt@
* Clean up find-alternate-file (C-x C-v) so abort returns to originalkjell2005-06-031-3/+43
| | | | | | file, like its emacs ancestor. ok cloder@
* add find-alternate-file command and binding for ^X^V; ok cloderjason2005-05-301-1/+9
| | | | (you're welcome kjell)
* In find file, behave like emacs: the default starting directory forcloder2005-05-271-3/+12
| | | | | | 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
* correct strlcpy abuse, and always check for NULL return from find_bufferbeck2005-04-211-1/+3
| | | | ok cloder@, feedback from many
* This is a no binary change which does:db2005-04-031-36/+37
| | | | | | | | | | - spelling, punctuation fixes - variable declaration lineup - use parentheses for return and sizeof - K&R function declarations -> ANSI - other minor code beautification ok henning@
* fix more BACKUP/NOBACKUP/NO_BACKUP confusion, again no binary change.henning2005-03-101-6/+6
| | | | spotted by jmc@
* fix mg's behaviour with regards to files on which we do not havejfb2005-03-091-6/+19
| | | | | | | 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@
* stage 1 of the infinite minibuffer work - add support for on the flyvincent2004-07-221-23/+27
| | | | | | | 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!
* fix the undo record size for insert-file so we do not get an extra bytevincent2003-11-091-2/+2
|
* typos from Jonathon Gray;jmc2003-11-081-2/+2
|
* remember the new filename on ^X^Wvincent2003-10-131-2/+10
| | | | ok deraadt
* spacingderaadt2003-08-161-2/+2
|
* support +number; rewritten from buggy code by mjc@bitz.ca, vincent okderaadt2003-01-061-1/+4
|
* don't add undo records when we open a file, only when we insert it.vincent2002-09-151-2/+10
| | | | ok deraadt@
* replace the ugly and buggy adjustname function by a simple one usingvincent2002-07-251-4/+12
| | | | | | simple APIs. makes mg not crash with 65k filenames... ok art@
* a few missing tests for malloc()'s return value.vincent2002-07-031-1/+3
| | | | ok art@
* KNF + ansi; from zyrnix (only the easy part of his diffs)vincent2002-07-011-20/+11
|
* add an undo insert record on insert-file. this makes insert-file undoable.vincent2002-06-191-10/+11
| | | | ok deraadt@
* add an "auto-execute" feature, that allows binding function calls tovincent2002-05-291-2/+12
| | | | | | certain patterns. for example, `auto-execute "*.c" auto-indent-mode'. ok art@
* add a function to visit a file read-only mapped to C-x C-vvincent2002-05-291-1/+12
| | | | ok art@
* add readonly buffer supportvincent2002-03-161-1/+9
| | | | | | plus some KNF ok art@
* * Move to ANSI function definitions.vincent2002-03-111-7/+4
| | | | | | * Add a whole lot of consts where I thought it made sense no ok, but no objections either...
* Make multiple buffers with the same basename work correctly.. (like GNUvincent2002-02-191-11/+7
| | | | | | emacs) and unbreak a stupid loop at the same time. ok art@
* some KNFderaadt2002-02-141-3/+3
|
* Oups, don't print fname<1> when there's only one buffer for this file.vincent2002-02-131-2/+5
|
* Make mg malloc the l_text element instead of reallocating whole LINEvincent2002-02-131-2/+2
| | | | structures all the time.
* * Replace unsafe strcpy and strcat calls to safe strlcpy and strlcat.vincent2002-02-131-7/+7
| | | | | | | * Be a little bit more verbose about some errors * Fix some memory leaks in fileio.c ok deraadt@, art@
* spacesmickey2001-05-241-27/+27
|
* Get rid of unnecessary casts of NULL.art2001-05-231-5/+5
|
* remove VOID. We're way beyond the point where this could build with anart2001-05-231-10/+10
| | | | ancient compiler.
* Cleanups in filename and buffer name handling.art2001-05-041-65/+6
| | | | Mostly just using libc instead of rolling our own.
* $OpenBSD$niklas2001-01-291-0/+2
|
* More -Wall anmd KNF, from op2@tomahawk.SQUiSH.orgmillert2000-09-011-153/+173
|
* The start of KNF + -Wall. The code has been run through indent butmillert2000-04-131-179/+226
| | | | needs hand fixup. I stopped at keymap.c...
* change WINDOW -> MGWIN to avoid curses type conflictmillert2000-02-261-4/+4
| | | | | convert to terminfo in tty*.c add support for some keypad function keys (arrows, pgup, pgdown)
* initial import of mg2aderaadt2000-02-251-0/+482