summaryrefslogtreecommitdiff
path: root/usr.bin/mg
AgeCommit message (Collapse)Author
2017-03-13When aborting switch-to-buffer keep current buffer instead ofFlorian Obser
switching to *scratch*. (Which seems to be the least useful thing to do.) This brings mg in line with emacs. OK lum; deraadt@ was bugged by this, too
2016-10-24remove double semicolonJasper Lievisse Adriaanse
from Brian Callahan
2016-10-07Switch a SLIST_FOREACH loop containing SLIST_REMOVE to SLIST_FOREACH_SAFE.Jonathan Gray
ok lum@ sunil@
2016-09-16like the sparc port, ancient wisdom is ancient. consign to the archives.Ted Unangst
ok beck
2016-09-12If we can't get the CWD, use relative paths. Fixes editing filesTodd C. Miller
in a directory without read permission. OK lum@
2016-09-11Install mg tutorial with correct permissions. ok deraadtMartin Natano
2016-09-09Source Joachim Nilsson:Mark Lumsden
Coverity Scan found this interesting buglet. If read() fails the code, before this patch, would trigger a "Negative array index write". ok florian@
2016-09-08Source Joachim Nilsson:Mark Lumsden
Collect forked off children from M-| command Mg left zombies from commands executed when piping a region of text to an external command. This patch makes sure to collect for the child before returning. ok sunil@ millert@
2016-09-07Source Joachim Nilsson:Mark Lumsden
Found by Coverity Scan. The popbuf() function iterated over a list to find a wp pointer, then sent it to showbuffer() which immediately went ahead and dereferenced it. This patch simply adds a NULL pointer check before calling showbuffer(), if NULL then just return NULL to callee. ok awolk@ millert@
2016-09-06If you have a paragraph:Mark Lumsden
123 456 With the cursor on either the 4, 5 or 6 and no newline after the '6', and then execute forward-paragraph (M-}), the cursor sits still and does not move to the end of the second line (after the 6), which is in effect the end of parapraph. This diff fixes that behaviour.
2016-09-05Initialize stack variables to zero before memmove().Mark Lumsden
Coverity Scan reported these two stack variables as uninitialized, in particular the .r_lineno struct member was uninitialized. This patch clears the 'struct region' rather than setting .r_lineno because if any more struct members are added in the future the clear will cover them too. Source Joachim Nilsson. ok tom@ millert@
2016-09-01Fix file descriptor leakMark Lumsden
Found by Coverity Scan. The ffropen() function returns FIODIR when the file is a directory. Check return value on error, in case of directory, close the descriptor. Source Joachim Nilsson, ok sunil@
2016-09-01Fix possible NULL pointer dereference.Sunil Nimmagadda
Found by Coverity Scan. The tagsvisit() function calls eread(), which may return NULL. This is then immediately passed to stat() without a proper check. This patch adds that check. From Joachim Nilsson <troglobit@gmail.com> via lum@. Ok lum@
2016-08-31Fix a bug reported by Han Boetes. Easily reproducible via:Mark Lumsden
mg c-x b RET c-x k RET mg segvs. Initial diff from Joachim Nilsson. This diff tested by Han and Joachim and ok florian@ jasper@
2016-08-16All that complexity stopped us from getting flying cars by today.Ted Unangst
2016-07-28strncmp is a more reasonable way to check the beginning of a string.Ted Unangst
2016-07-28these programs probably do not need to use TMPDIR. ok florianTed Unangst
2016-07-14make several program to use "chown" promise.Sebastien Marie
it allows chown(2) call to change the user or group on a file. - usr.bin/compress : aka gzip - usr.bin/mg : open a file for writing - usr.bin/sed : inplace editing - usr.bin/sort : if outfile equals one of the input files ok deraadt@ tb@ (and a reminder from Remi Locherer) warning: in order to use it, you must have a recent kernel with the new promise.
2016-07-04Use fstatat() instead of crafting a filename to use with stat()Philip Guenther
ok millert@
2016-06-07"Well finally everyone can see that the shit is really shitty."Ted Unangst
2016-04-14Add 'sentence-end-double-space'.Mark Lumsden
If you prefer "lighter" punctuation and one space between sentences, for example: Mr and Mrs Jones are from the UK. They arrived today. over more liberal use of full stops and double spaces between sentences: Mr. and Mrs. Jones are from the U.K. They arrived today. then toggling 'sentence-end-double-space' will make mg's fill-paragraph function format text using one space instead of two (the default) between sentences. However, be careful, should you have a double spaced document and accidentally "format" it to have single spaces, then you may have a problem. mg won't be able to revert the formatting for you (unless you have a previous version of the text in the "undo" history, or are using mg's backup facility and haven't opened and saved multiple times!). Comments from schwarze@
2016-04-12Stop mg putting a space at the end of a paragraph when usingMark Lumsden
fill-paragraph. Reported by Harald Dunkel.
2016-03-17Show modes for buffers more clearly. ok jasper@Mark Lumsden
2016-03-16notab mode is not enabled at the moment.Mark Lumsden
2016-01-26ensure the backup file has the same mtime as the original file, this is in lineJasper Lievisse Adriaanse
with emacs' behaviour. from Harald Dunkel via Han Boetes ok lum@
2016-01-19Bounds check while stripping trailing slashes. From max atSunil Nimmagadda
max-fillinger.net. Ok lum@
2016-01-19Update my mail address.Sunil Nimmagadda
2016-01-19Fix bad indents. From max at max-fillinger.netSunil Nimmagadda
Ok lum@ jasper@
2016-01-19Check snprintf(3) return value for overflow instead of manual lengthSunil Nimmagadda
check. From max at max-fillinger.net. Ok lum@ jasper@
2016-01-19Skip empty entries in $PATH instead of erroneously interpretingSunil Nimmagadda
them as ".". Ok lum@ jasper@
2016-01-03Allow macro execution to continue without delay in the event of aMark Lumsden
visble bell call.
2016-01-02Add dired-find-alternate-file.Mark Lumsden
2015-12-31Return FALSE on parse errors.Sunil Nimmagadda
Found by and Ok lum@.
2015-12-30Small tidy of recently committed transpose-words: unused valueMark Lumsden
assignment and I missed an ABORT case.
2015-12-30Widen the dired command list. ok jmc@Mark Lumsden
2015-12-29Add transpose-words, ok jasper@.Mark Lumsden
Limited to one iteration until 'undo' is looked into.
2015-12-24Add -R option to allow files specified on the command line to beMark Lumsden
opened read-only. ok jasper@ phessler@ and man page advice from jmc@
2015-12-23Do undo.Mark Lumsden
2015-12-22Remove commands that are not implemented, at the moment. Added byMark Lumsden
accident in previous diff.
2015-12-21Add RET to dired-find-file. ok jasper@Mark Lumsden
(and jasper@ ok'd recent tutorial diff, forgot to mention)
2015-12-21Mention dired.Mark Lumsden
2015-12-14s/begining/beginning/gmmcc
2015-12-11Remove NULL-checks before free().mmcc
2015-12-05Fix an incorrect use of sizeof(pointer) by removing it and switchingJonathan Gray
from strncasecmp to strcasecmp which will stop matching strings with unwanted trailing characters. ok jasper@ deraadt@
2015-11-19"tty proc exec", not "proc exec tty"Anthony J. Bentley
2015-11-18shrink differences between ttinsl/ttdellJasper Lievisse Adriaanse
2015-11-18whitespaceJasper Lievisse Adriaanse
2015-11-18Remove "space-to-tabstop" from the manpage - it is not enabled,Reyk Floeter
ifdef'ed with NOTAB, and doesn't seem to work. OK lum@
2015-11-14The people who wrote this code are not on your sideStuart Henderson
2015-11-12Update the dired mode comments.Mark Lumsden