summaryrefslogtreecommitdiff
path: root/usr.bin/mg
AgeCommit message (Collapse)Author
2015-06-03Remove unused defines and functions.Brian Callahan
"Looks fine." deraadt@
2015-05-08Remove ereply prototype since it is never used. Tweak a comment to reflectBrian Callahan
ereply removal. ok jasper@ florian@
2015-04-12Prevent use after free in definemacro().Florian Obser
When the startup file contains (start-kbd-macro) mg crashes when executing "start-kbd-macro" two times in the running mg. The problem is that execline() is cleaning up behind our backs. Finish the cleanup and make sure mg doesn't think we are in the middle of a macro definition. Problem found, tracked down and diff by gsoares@ Tweaked & OK by me. Committing on request of gsoares@ who currently doesn't have good net to commit.
2015-04-03Pull an #include out of an #ifdef.Brian Callahan
XCHAR and XSHORT have always been defined to be int. Just make them int. We don't need to care about making better code for whatever non-VAX machines were being used in 1986. ok florian@
2015-03-25unifdef -U NO_DPROMPT and GOSREC.Brian Callahan
NO_DPROMPT has been around since the import of mg2a and it has never been considered a "(Common) compile-time option" in the Makefile. Assume everyone has been running mg this way since at least 2000 if not already in the 90s. Same with GOSREC. Has always been there but it looks like no one noticed it (and no one was running with it). Indeed, the mg tutorial appears to be oblivious to GOSREC being an option. With this commit there are no more #ifndef blocks in mg. Only a couple of #ifdef blocks remain. ok lum@
2015-03-25Remove unused METACH #define.Brian Callahan
No one is defining their own METABIT so remove the #ifndef around it. ok florian@
2015-03-25We really don't need ttydef.h -- it is like sysdef.h -- once useful becauseBrian Callahan
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@
2015-03-24When exiting the loop early don't forget to clean up.Florian Obser
This fixes a segfault reported by and tracked down by Kaspars Bankovskis kaspars at bankovskis dot net, thanks! OK bcallah@
2015-03-24unifdef -DBINDKEY -- you can't build mg the other way.Brian Callahan
unifdef -UMOVE_STANDOUT -- we had it under an '#ifdef undef' in ttydef.h also remove those lines from ttydef.h Set linenos = TRUE instead of an odd #ifdef dance that isn't used anywhere else. ok florian@
2015-03-23DIFFTOOL has to be defined for mg to build. TCSASOFT is defined viaBrian Callahan
termios.h so we don't need the code for when it is not defined. ok reyk@
2015-03-19More unifdef cleanup:Brian Callahan
-UDIRED_XMAPS and -UFUND_XMAPS: you can't build mg the other way. -DTIOCGWINSZ: you have this if you have term.h Remove a #define TERMCAP which isn't being used. Remove defines for NDIRED_XMAPS, NFUND_XMAPS, and IMAPEXT. They are all defined to be 0 and are only ever used in addition. We don't need to add 0. Simply lines that were using those defines. ok florian@
2015-03-19Clean up the includes in mg.Brian Callahan
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@
2015-03-18Clean up a pair of sentences that aren't true anymore for mg while keepingBrian Callahan
the original spirit of those sentences. ok jasper@
2015-03-17It is impossible to build mg without both -DFKEYS and -DXKEYS. So let'sBrian Callahan
enforce that and remove the options. Mostly mechanical diff from unifdef with bonus removal of comments that no longer have any relevance. ok florian@
2015-03-17correct command name; from kaspars bankovskisJason McIntyre
2015-03-16Change the internal name of the newline function to deconflict with aBrian Callahan
function of the same name in term.h. This is the first step towards cleaning up mg's includes. No user-visible changes. ok florian@
2015-02-17shuffle reallocarray arguments around for better overflow checkingTed Unangst
2015-02-17undef tryreallocarray like tryrealloc when done.Ted Unangst
from Kamil Rytarowski. ok bcallah
2015-01-13Remove a variable that's not really being used.Brian Callahan
ok deraadt@ jasper@
2015-01-05As pointed out by Kaspars Bankovskis on tech@, there is no ifdef forMark Lumsden
STARTUP.
2015-01-02Remove unused variable.Mark Lumsden
2014-12-30Remove some checks that will always evaluate to true. Noticed by a veryBrian Callahan
recent clang. ok schwarze@ lum@
2014-12-06A few last 'easy' #include dedups.Kenneth R Westerback
ok tedu@
2014-11-19Fire up your IC fabs!Ingo Schwarze
2014-11-16Stop using <sys/param.h>; replace MAXPATHLEN with PATH_MAX, stop using MAX(),Philip Guenther
and pull in <limits.h> for *_MAX constants. inspired on a diff from Kamil Rytarowski (n54 (at) gmx.com) ok bcallah@
2014-11-16Don't save the return from getindent() if you don't need it; adjustPhilip Guenther
comments to reflect that based on a diff from Kamil Rytarowski (n54 (at) gmx.com)
2014-11-16pull in <time.h> for struct timespecPhilip Guenther
diff from Kamil Rytarowski (n54 (at) gmx.com)
2014-11-16ctype macros/functions expect unsigned char values. Note that the lgetc()Philip Guenther
macro does the cast internally like getc() does, so its return should be put an in int for the same reason. based on a diff from Kamil Rytarowski (n54 (at) gmx.com)
2014-11-16scroll_fwd should be const char *Philip Guenther
from Kamil Rytarowski (n54 (at) gmx.com)
2014-11-16constipate charcost()Philip Guenther
from Kamil Rytarowski (n54 (at) gmx.com)
2014-11-13Nuke GOOD define and just exit(0) on success. While there removeFlorian Obser
unused MALLOCROUND define. No binary change. From Martin Natano (natano AT natano DOT net). OK lum@
2014-11-03comment out no-tab-mode, since mg is currently compiled without it;Jason McIntyre
From: Kaspars Bankovskis ok lum
2014-10-19Move the description of mg automatic recentering further down theMark Lumsden
tutorial, next to the C-l (recenter) command description. This also removes confusion if you read the tutorial on a screen larger than 24 lines. Input jmc@ ok florian@
2014-10-17If gotoeop() is called requiring more than one iteration, it behavesMark Lumsden
oddly if it reaches the end of buffer before completing all iterations. This diff makes the kill-paragraph and forward-paragraph commands stop once they can go no further. ok florian@
2014-10-16Use reallocarray() where possible. There are further possible overflowsTheo de Raadt
in the region, but my time is limited...
2014-10-15some choice thoughts on back compatTed Unangst
2014-10-13gotoeop() does not behave as expected when there is no '\n' at the end of theMark Lumsden
buffer. ok florian@
2014-10-12Fix a bug in backward-paragraph. If the cursor is on the first line ofMark Lumsden
a paragraph, it jumps to the start of the previous paragraph if you press M-{. Input and fix to my diff from florian@
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-09-27sound reasoningSebastian Benoit
2014-08-19Let's talk about obstacles you face when trying to pull off a partial tedu@.Ingo Schwarze
2014-08-14Add bounce matching for [] and {} like mg already does with () and likeBrian Callahan
Emacs does. ok florian@
2014-06-12Remove a comparison that is always true. Reported by clang.Brian Callahan
Merge the new if into a single line, requested by florian@ ok matthew@ florian@
2014-05-28On delete-window, remember the position of dot and mark in the bufferFlorian Obser
so that an revisiting the buffer the correct line number is displayed. Found by jasper@ OK lum@
2014-05-08protip: "It's largely bad style to do (int)sizeof"Ted Unangst
amusingly, theo phrased this with considerably more restraint than i did.
2014-04-18We should probably thank OpenSSL.Ingo Schwarze
They gave Theo another chance to be happy.
2014-04-17I'm just trying to improve the code...Ted Unangst
2014-04-17spidey sensesStuart Henderson
2014-04-15My mailbox is full of shock.Ted Unangst
2014-04-14"the randomization in this entire codebase is a grand experiment in stupid"Ted Unangst