summaryrefslogtreecommitdiff
path: root/usr.bin/mg
AgeCommit message (Collapse)Author
2018-05-28Mention column-number-mode in the tutorial to clear up a potentiallyBrian Callahan
confusing description of L and C in the mode line. Prompted by an email on tech@ by Leonid Bobrov <mazocomp () disroot ! org> Co-written by myself and florian@, ok florian@
2018-04-13mg tries to write backups to the wrong directory when run under aFlorian Obser
different effective user, i.e. when invoced via su and backup-to-home-directory is enabled. Problem pointed out and diff provied by Lucas Gabriel Vuotto <lvuotto92 () gmail ! com>, thanks! Subsequently slacked on for nearly a year by yours truly. Then remembered when Han Boetes <hboetes () gmail ! com> came up with a similar diff because of a problem report by Mark Willson where it turned out that getlogin(2) is not very portable. OK tb
2018-01-09Extract compile_mode command status with WEXITSTATUS.cheloha
Also tell the user if the parent shell spawned by popen(3) was killed by a signal. Discussed with jca@. ok millert@ jca@ deraadt@
2017-12-17Let the Insert key toggle overwrite mode. This matches GNU Emacs behavior.Brian Callahan
Diff from Lari Rasku <lari.rasku AT elisanet DOT fi> ok florian@
2017-12-11fix the description of delete-non-matching-lines;Jason McIntyre
from mazocomp
2017-10-12Replace fgetln(3) with getline(3) which is portable and less error prone.Florian Obser
From Scott Cheloha (scottcheloha AT gmail), thanks! OK bcallah
2017-09-09When inserting a newline, only increment dotline for windows that areFlorian Obser
displaying the same buffer as the current one. From Martin Wanvik (martin.kr.wanvik AT gmail), thanks! OK bcallah
2017-08-06Present the default choice before the colon in prompts. Matches GNU EmacsBrian Callahan
behavior. From Scott Cheloha <scottcheloha@gmail.com> ok florian@
2017-07-06Fix display of overlong lines containing non-ASCII bytes.Ingo Schwarze
Also fixes a crash reported by Hiltjo Posthuma <hiltjo at codemadness dot org>, though in a different way than with the patch he sent. OK florian@ bcallah@
2017-05-30The is open-file command is actually called find-file. Typo pointed outTheo Buehler
by "Choose a display name <thelocals_job_applicant protonmail com>".
2017-05-30fix -Wshadow warnings.Florian Obser
Found by bcallah, thanks!
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.