Codebase list mg / 5e99aa3
Update upstream source from tag 'upstream/20200723' Update to upstream version '20200723' with Debian dir 58ff68f4ca41e03d19756afafcc24463a2c8d21f Tomasz Buchert 3 years ago
4 changed file(s) with 68 addition(s) and 60 deletion(s). Raw diff Collapse all Expand all
55 line.c macro.c main.c match.c modes.c paragraph.c
66 re_search.c region.c search.c spawn.c tty.c ttyio.c ttykbd.c
77 undo.c util.c version.c window.c word.c yank.c
8 cmode.c cscope.c dired.c grep.c tags.c
8 cmode.c cscope.c dired.c grep.c tags.c interpreter.c
99 )
1010
1111 add_executable (mg ${MG_SRC})
2121 link_directories (${BSD_LIBRARY_DIRS})
2222 string (REPLACE ";" " " LIBBSD_FLAGS "${BSD_CFLAGS}")
2323 target_link_libraries (mg ${BSD_LIBRARIES})
24 set (CMAKE_C_FLAGS "-Wall -DREGEX -D_GNU_SOURCE ${LIBBSD_FLAGS} ${NCURSES_FLAGS} -L${NCURSES_LIBRARY_DIRS}")
25 else()
26 set (CMAKE_C_FLAGS "-Wall -DREGEX ${LIBBSD_FLAGS} ${NCURSES_FLAGS} -L${NCURSES_LIBRARY_DIRS}")
2427 endif()
25
26 set (CMAKE_C_FLAGS "-Wall -DREGEX ${LIBBSD_FLAGS} ${NCURSES_FLAGS} -L${NCURSES_LIBRARY_DIRS}")
00 /tags.c/1.16/Result of merge//
1 /re_search.c/1.33/Mon Aug 28 19:36:58 2017//
21 /undo.c/1.58/Tue Apr 10 04:57:08 2018//
32 /region.c/1.38/Result of merge//
43 /Makefile/1.35/Result of merge//
5 /README/1.14/Mon Aug 12 23:34:18 2019//
6 /autoexec.c/1.17/Mon Aug 12 23:34:18 2019//
7 /basic.c/1.49/Mon Aug 12 23:34:18 2019//
8 /bell.c/1.5/Mon Aug 12 23:34:28 2019//
9 /buffer.c/1.107/Mon Aug 12 23:34:28 2019//
10 /chrdef.h/1.10/Mon Aug 12 23:34:18 2019//
11 /cinfo.c/1.18/Mon Aug 12 23:34:18 2019//
12 /cmode.c/1.17/Mon Aug 12 23:34:28 2019//
13 /cscope.c/1.18/Mon Aug 12 23:34:28 2019//
14 /dir.c/1.31/Mon Aug 12 23:34:28 2019//
154 /dired.c/1.93/Result of merge//
16 /display.c/1.48/Mon Aug 12 23:34:18 2019//
17 /echo.c/1.66/Mon Aug 12 23:34:18 2019//
18 /extend.c/1.71/Mon Aug 12 23:34:28 2019//
19 /file.c/1.102/Mon Aug 12 23:34:28 2019//
205 /fileio.c/1.106/Result of merge//
21 /funmap.c/1.59/Mon Aug 12 23:34:28 2019//
22 /funmap.h/1.8/Mon Aug 12 23:34:28 2019//
23 /grep.c/1.48/Mon Aug 12 23:34:28 2019//
24 /help.c/1.35/Mon Aug 12 23:34:18 2019//
25 /interpreter.c/1.5/Sat Jul 20 11:06:33 2019//
26 /kbd.h/1.19/Mon Aug 12 23:34:18 2019//
27 /key.h/1.6/Mon Aug 12 23:34:28 2019//
28 /keymap.c/1.58/Mon Aug 12 23:34:18 2019//
29 /line.c/1.61/Mon Aug 12 23:34:18 2019//
30 /log.c/1.11/Mon Aug 12 23:34:29 2019//
31 /log.h/1.5/Mon Aug 12 23:34:29 2019//
32 /macro.c/1.16/Mon Aug 12 23:34:18 2019//
33 /macro.h/1.7/Mon Aug 12 23:34:18 2019//
346 /main.c/1.87/Result of merge//
35 /match.c/1.21/Mon Aug 12 23:34:29 2019//
36 /modes.c/1.21/Mon Aug 12 23:34:18 2019//
37 /paragraph.c/1.46/Mon Aug 12 23:34:18 2019//
38 /pathnames.h/1.1/Mon Aug 12 23:34:18 2019//
39 /search.c/1.47/Mon Aug 12 23:34:18 2019//
40 /spawn.c/1.12/Mon Aug 12 23:34:18 2019//
417 /ttyio.c/1.38/Result of merge//
42 /ttykbd.c/1.19/Mon Aug 12 23:34:18 2019//
43 /tutorial/1.18/Mon Aug 12 23:34:18 2019//
44 /util.c/1.42/Mon Aug 12 23:34:29 2019//
45 /version.c/1.10/Mon Aug 12 23:34:18 2019//
46 /window.c/1.36/Mon Aug 12 23:34:18 2019//
47 /word.c/1.19/Mon Aug 12 23:34:18 2019//
48 /yank.c/1.14/Mon Aug 12 23:34:18 2019//
49 /mg.1/1.118/Mon Feb 3 03:25:17 2020//
508 /def.h/1.166/Result of merge+Sat Feb 15 14:26:34 2020//
51 /kbd.c/1.34/Result of merge//
52 /tty.c/1.37/Result of merge+Sat Feb 15 14:26:47 2020//
9 /README/1.14/Thu Mar 12 08:13:18 2020//
10 /autoexec.c/1.17/Thu Mar 12 08:13:18 2020//
11 /basic.c/1.49/Thu Mar 12 08:13:18 2020//
12 /bell.c/1.5/Thu Mar 12 08:13:18 2020//
13 /buffer.c/1.107/Thu Mar 12 08:13:18 2020//
14 /chrdef.h/1.10/Thu Mar 12 08:13:18 2020//
15 /cinfo.c/1.18/Thu Mar 12 08:13:18 2020//
16 /cmode.c/1.17/Thu Mar 12 08:13:18 2020//
17 /cscope.c/1.18/Thu Mar 12 08:13:18 2020//
18 /dir.c/1.31/Thu Mar 12 08:13:18 2020//
19 /display.c/1.48/Thu Mar 12 08:13:18 2020//
20 /echo.c/1.66/Thu Mar 12 08:13:18 2020//
21 /extend.c/1.71/Thu Mar 12 08:13:18 2020//
22 /file.c/1.102/Thu Mar 12 08:13:18 2020//
23 /funmap.c/1.59/Thu Mar 12 08:13:18 2020//
24 /funmap.h/1.8/Thu Mar 12 08:13:18 2020//
25 /grep.c/1.48/Thu Mar 12 08:13:18 2020//
26 /help.c/1.35/Thu Mar 12 08:13:18 2020//
27 /interpreter.c/1.5/Thu Mar 12 08:13:18 2020//
28 /kbd.c/1.34/Thu Mar 12 08:13:18 2020//
29 /kbd.h/1.19/Thu Mar 12 08:13:18 2020//
30 /key.h/1.6/Thu Mar 12 08:13:18 2020//
31 /keymap.c/1.58/Thu Mar 12 08:13:18 2020//
32 /log.c/1.11/Thu Mar 12 08:13:18 2020//
33 /log.h/1.5/Thu Mar 12 08:13:18 2020//
34 /macro.c/1.16/Thu Mar 12 08:13:18 2020//
35 /macro.h/1.7/Thu Mar 12 08:13:18 2020//
36 /match.c/1.21/Thu Mar 12 08:13:18 2020//
37 /mg.1/1.118/Thu Mar 12 08:13:18 2020//
38 /modes.c/1.21/Thu Mar 12 08:13:18 2020//
39 /paragraph.c/1.46/Thu Mar 12 08:13:18 2020//
40 /pathnames.h/1.1/Thu Mar 12 08:13:18 2020//
41 /search.c/1.47/Thu Mar 12 08:13:18 2020//
42 /spawn.c/1.12/Thu Mar 12 08:13:18 2020//
43 /tty.c/1.37/Thu Mar 12 08:13:18 2020//
44 /ttykbd.c/1.19/Thu Mar 12 08:13:18 2020//
45 /tutorial/1.18/Thu Mar 12 08:13:18 2020//
46 /util.c/1.42/Thu Mar 12 08:13:18 2020//
47 /version.c/1.10/Thu Mar 12 08:13:18 2020//
48 /window.c/1.36/Thu Mar 12 08:13:18 2020//
49 /word.c/1.19/Thu Mar 12 08:13:18 2020//
50 /yank.c/1.14/Thu Mar 12 08:13:18 2020//
51 /line.c/1.62/Thu Jul 23 17:18:45 2020//
52 /re_search.c/1.35/Result of merge//
5353 D
0 /* $OpenBSD: line.c,v 1.61 2018/08/29 07:50:16 reyk Exp $ */
0 /* $OpenBSD: line.c,v 1.62 2020/07/22 13:22:53 tb Exp $ */
11
22 /* This file is in the public domain. */
33
555555 goto done;
556556
557557 lp = curwp->w_dotp;
558 if (ltext(lp) == NULL)
559 goto done;
558560 doto = curwp->w_doto;
559561 n = plen;
560562
0 /* $OpenBSD: re_search.c,v 1.33 2017/08/06 04:39:45 bcallah Exp $ */
0 /* $OpenBSD: re_search.c,v 1.35 2020/07/22 13:29:05 tb Exp $ */
11
22 /* This file is in the public domain. */
33
311311 static int
312312 re_forwsrch(void)
313313 {
314 int tbo, tdotline, error;
314 int re_flags, tbo, tdotline, error;
315315 struct line *clp;
316316
317317 clp = curwp->w_dotp;
321321 if (tbo == clp->l_used)
322322 /*
323323 * Don't start matching past end of line -- must move to
324 * beginning of next line, unless at end of file.
324 * beginning of next line, unless line is empty or at
325 * end of file.
325326 */
326 if (clp != curbp->b_headp) {
327 if (clp != curbp->b_headp && llength(clp) != 0) {
327328 clp = lforw(clp);
328329 tdotline++;
329330 tbo = 0;
333334 * always makes the last line empty so this is good.
334335 */
335336 while (clp != (curbp->b_headp)) {
337 re_flags = REG_STARTEND;
338 if (tbo != 0)
339 re_flags |= REG_NOTBOL;
336340 regex_match[0].rm_so = tbo;
337341 regex_match[0].rm_eo = llength(clp);
338 error = regexec(&regex_buff, ltext(clp), RE_NMATCH, regex_match,
339 REG_STARTEND);
342 error = regexec(&regex_buff, ltext(clp) ? ltext(clp) : "",
343 RE_NMATCH, regex_match, re_flags);
340344 if (error != 0) {
341345 clp = lforw(clp);
342346 tdotline++;
392396 * do this character-by-character after the first match since
393397 * POSIX regexps don't give you a way to do reverse matches.
394398 */
395 while (!regexec(&regex_buff, ltext(clp), RE_NMATCH, regex_match,
396 REG_STARTEND) && regex_match[0].rm_so < tbo) {
399 while (!regexec(&regex_buff, ltext(clp) ? ltext(clp) : "",
400 RE_NMATCH, regex_match, REG_STARTEND) &&
401 regex_match[0].rm_so <= tbo) {
397402 memcpy(&lastmatch, &regex_match[0], sizeof(regmatch_t));
398403 regex_match[0].rm_so++;
399404 regex_match[0].rm_eo = llength(clp);
541546 /* see if line matches */
542547 regex_match[0].rm_so = 0;
543548 regex_match[0].rm_eo = llength(clp);
544 error = regexec(&regex_buff, ltext(clp), RE_NMATCH, regex_match,
545 REG_STARTEND);
549 error = regexec(&regex_buff, ltext(clp) ? ltext(clp) : "",
550 RE_NMATCH, regex_match, REG_STARTEND);
546551
547552 /* Delete line when appropriate */
548553 if ((cond == FALSE && error) || (cond == TRUE && !error)) {
616621 /* see if line matches */
617622 regex_match[0].rm_so = 0;
618623 regex_match[0].rm_eo = llength(clp);
619 error = regexec(&regex_buff, ltext(clp), RE_NMATCH, regex_match,
620 REG_STARTEND);
624 error = regexec(&regex_buff, ltext(clp) ? ltext(clp) : "",
625 RE_NMATCH, regex_match, REG_STARTEND);
621626
622627 /* Count line when appropriate */
623628 if ((cond == FALSE && error) || (cond == TRUE && !error))