OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.50 / (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, HEAD
Changes since 1.49: +1 -7 lines
Diff to previous 1.49 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Mar 1 10:51:14 2021 UTC (3 years, 2 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
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Put the hardcoded '\n' character which is found throughout mg into a
buffer specific variable. The diff should not produce any behavourial
changes in mg.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Jul 11 18:20:18 2019 UTC (4 years, 10 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.47: +6 -6 lines
Diff to previous 1.47 (colored)

Allow functions that have 1 or more parameters receive and process
multiple arguments when evaluated in a startup file or via one of the
'eval' commands.

This diff does treat the '(' and ')' chars differently during
evaluation than previously, in-so-far as they are not ignored if they
are at the end or start of a line now. However, even though these
characters are not ignored, this diff should not change the behaviour
of an extant .mg file, with '(' and ')' chars at the end and start of
a line.  This situation is accomodated for in this diff (with limited
testing though).

Revision 1.47 / (download) - annotate - [select for diffs], Sun Dec 30 23:09:58 2018 UTC (5 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored)

Delete unnecessary <libgen.h> #includes

ok deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jan 9 17:59:29 2018 UTC (6 years, 4 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.45: +14 -7 lines
Diff to previous 1.45 (colored)

Extract compile_mode command status with WEXITSTATUS.

Also tell the user if the parent shell spawned by popen(3)
was killed by a signal.

Discussed with jca@.

ok millert@ jca@ deraadt@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Oct 12 14:12:00 2017 UTC (6 years, 7 months ago) by florian
Branch: MAIN
Changes since 1.44: +12 -9 lines
Diff to previous 1.44 (colored)

Replace fgetln(3) with getline(3) which is portable and less error prone.
From Scott Cheloha (scottcheloha AT gmail), thanks!
OK bcallah

Revision 1.44 / (download) - annotate - [select for diffs], Thu Mar 19 21:48:05 2015 UTC (9 years, 2 months ago) by bcallah
Branch: MAIN
CVS Tags: 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, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

More unifdef cleanup:
-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@

Revision 1.43 / (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.42: +11 -5 lines
Diff to previous 1.42 (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.42 / (download) - annotate - [select for diffs], Sun Nov 16 04:16:41 2014 UTC (9 years, 6 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

Stop using <sys/param.h>; replace MAXPATHLEN with PATH_MAX, stop using MAX(),
and pull in <limits.h> for *_MAX constants.

inspired on a diff from Kamil Rytarowski (n54 (at) gmx.com)
ok bcallah@

Revision 1.41 / (download) - annotate - [select for diffs], Sun Nov 16 00:59:25 2014 UTC (9 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored)

ctype macros/functions expect unsigned char values.  Note that the lgetc()
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)

Revision 1.40 / (download) - annotate - [select for diffs], Thu Mar 20 07:47:29 2014 UTC (10 years, 2 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.39: +7 -1 lines
Diff to previous 1.39 (colored)

Add some missing dobeeps.
ok florian@

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 1 17:31:11 2013 UTC (10 years, 11 months ago) by lum
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.38: +1 -27 lines
Diff to previous 1.38 (colored)

Remove 'lint' mode. lint(1) is gone, and the mode was not documented
anywhere.
ok jasper@ florian@

Revision 1.38 / (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_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.37: +6 -6 lines
Diff to previous 1.37 (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.37 / (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.36: +3 -3 lines
Diff to previous 1.36 (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.36 / (download) - annotate - [select for diffs], Sat Jun 14 08:39:30 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.35: +2 -3 lines
Diff to previous 1.35 (colored)

Add compile (c-C c-P) to the c-mode keymap (export from grep.c)
Also, attempt to make indent an atomic undo operation.

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jun 10 00:19:31 2008 UTC (15 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.34: +3 -26 lines
Diff to previous 1.34 (colored)

Remove copyright notices and put these files back into the public domain.
ok art

Revision 1.34 / (download) - annotate - [select for diffs], Mon May 28 17:52:17 2007 UTC (16 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.33: +22 -3 lines
Diff to previous 1.33 (colored)

Add a global-wd-mode command, which toggles between the current
behavior (every buffer maintains its own cwd) and the old behavior of
one global working directory. This makes it slightly easier to hack
on things like kernel code, where compilation, etc, are initiated from
a different directory than you are working in.
While here, fix setting/handling of global wd.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Nov 19 16:51:19 2006 UTC (17 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

spacing

Revision 1.32 / (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.31: +5 -5 lines
Diff to previous 1.31 (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.31 / (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.30: +5 -5 lines
Diff to previous 1.30 (colored)

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

Revision 1.30 / (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.29: +2 -2 lines
Diff to previous 1.29 (colored)

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

Revision 1.29 / (download) - annotate - [select for diffs], Sat May 27 21:22:45 2006 UTC (17 years, 11 months ago) by kjell
Branch: MAIN
Changes since 1.28: +22 -27 lines
Diff to previous 1.28 (colored)

Move stderr redirection to a common location, as suggested by vincent a
while ago. While here, get rid of some of the stupid static buffer
sizes. I've been running with this for quite a while.

Revision 1.28 / (download) - annotate - [select for diffs], Tue May 2 17:10:25 2006 UTC (18 years ago) by kjell
Branch: MAIN
Changes since 1.27: +22 -76 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Mon Apr 3 00:19:32 2006 UTC (18 years, 1 month ago) by kjell
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

Always leave compile buffer on first line after compilation.
Change 0->NUL while I'm here.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Dec 13 07:20:13 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

Last round of easy delinting.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Dec 13 02:08:06 2005 UTC (18 years, 5 months ago) by kjell
Branch: MAIN
Changes since 1.24: +51 -15 lines
Diff to previous 1.24 (colored)

Add a "M-x lint" mode, now that lint is next-error friendly.
While here, delint some name clashes.

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

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

Revision 1.23 / (download) - annotate - [select for diffs], Sat Nov 12 19:13:09 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

remove unused variable; ok kjell

Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 11 18:40:51 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

spacing

Revision 1.21 / (download) - annotate - [select for diffs], Tue Oct 18 21:22:52 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.20: +16 -9 lines
Diff to previous 1.20 (colored)

Don't consider the last line of the compilation buffer as
parsable output. It is always a status message.
While here, some better error checking.
looks ok, cloder@.

Revision 1.20 / (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.19: +6 -1 lines
Diff to previous 1.19 (colored)

add missing /* ARGSUSED */ to quiet lint.

Revision 1.19 / (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.18: +4 -4 lines
Diff to previous 1.18 (colored)

spacing

Revision 1.18 / (download) - annotate - [select for diffs], Thu Oct 13 05:24:52 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.17: +90 -11 lines
Diff to previous 1.17 (colored)

Make mg's grep and compile more path-aware, by defaulting to
the path of the invoking buffer.
Also, make subshell output look more like emacs (show directory,
completion time). oked at one point by deraadt@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Oct 11 00:50:00 2005 UTC (18 years, 7 months ago) by kjell
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Enable the 'next-error' (C-x `) keybinding by default.
Niklas, this one is for you.
ok deraadt@, cloder@

Revision 1.16 / (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.15: +12 -6 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Fri Jun 3 23:39:55 2005 UTC (18 years, 11 months ago) by cloder
Branch: MAIN
Changes since 1.14: +11 -8 lines
Diff to previous 1.14 (colored)

Make M-x gid tokenize C identifiers correctly. Problem reported by mjc.
Testing and OK mjc

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 25 20:15:18 2005 UTC (18 years, 11 months ago) by jason
Branch: MAIN
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

in M-x compile, after prompting for command, check buffers and optionally
save them.  ok cloder@

Revision 1.13 / (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.12: +62 -62 lines
Diff to previous 1.12 (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.12 / (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_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.11: +12 -11 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Sat Jun 12 15:04:41 2004 UTC (19 years, 11 months ago) by vincent
Branch: MAIN
Changes since 1.10: +32 -4 lines
Diff to previous 1.10 (colored)

make M-x gid try to guess the symbol name to look up by looking at the
current word.

ok beck@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jan 15 20:55:47 2004 UTC (20 years, 4 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored)

fix an early free that made compile-goto-error work only from time to time

Revision 1.9 / (download) - annotate - [select for diffs], Sun Nov 9 00:16:36 2003 UTC (20 years, 6 months ago) by vincent
Branch: MAIN
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

knf

Revision 1.8 / (download) - annotate - [select for diffs], Tue Apr 8 21:19:57 2003 UTC (21 years, 1 month ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.7: +5 -2 lines
Diff to previous 1.7 (colored)

remember the last M-x compile command used.

ok art@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jul 25 16:37:54 2002 UTC (21 years, 9 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (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.6 / (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.5: +7 -7 lines
Diff to previous 1.5 (colored)

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

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 18 01:22:31 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.4: +1 -2 lines
Diff to previous 1.4 (colored)

 grep/compile mode shouldn't be readonly by default.

 ok art@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 16 19:30:29 2002 UTC (22 years, 2 months ago) by vincent
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

 Make these special buffers readonly by default. ok art@

Revision 1.3 / (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.2: +5 -5 lines
Diff to previous 1.2 (colored)

some KNF

Revision 1.2 / (download) - annotate - [select for diffs], Sun Nov 25 07:34:17 2001 UTC (22 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +5 -5 lines
Diff to previous 1.1 (colored)

snprintf makes me happy

Revision 1.1 / (download) - annotate - [select for diffs], Thu May 24 10:58:34 2001 UTC (23 years ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0

Add a compile/grep/id-utils mode.

The only pollution this code introduces in the rest of thed code is a call to
an init function in main(). In the future we might want to load extensions
like this dynamically.

Of course I did the test compile in the compile mode.

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.