command.c (d713e0891ff9ab8246245c3206851d486ecfdd37) | command.c (f80a33ea416e408c490a1f1f031a6abbccbae085) |
---|---|
1/* $FreeBSD$ */ 2/* 3 * Copyright (C) 1984-2023 Mark Nudelman 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Less License, as specified in the README file. 7 * 8 * For more information, see the README file. --- 167 unchanged lines hidden (view full) --- 176 if (search_type & SRCH_NO_REGEX) 177 cmd_putstr("Regex-off "); 178 if (search_type & SRCH_WRAP) 179 cmd_putstr("Wrap "); 180 for (i = 1; i <= NUM_SEARCH_COLORS; i++) 181 { 182 if (search_type & SRCH_SUBSEARCH(i)) 183 { | 1/* $FreeBSD$ */ 2/* 3 * Copyright (C) 1984-2023 Mark Nudelman 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Less License, as specified in the README file. 7 * 8 * For more information, see the README file. --- 167 unchanged lines hidden (view full) --- 176 if (search_type & SRCH_NO_REGEX) 177 cmd_putstr("Regex-off "); 178 if (search_type & SRCH_WRAP) 179 cmd_putstr("Wrap "); 180 for (i = 1; i <= NUM_SEARCH_COLORS; i++) 181 { 182 if (search_type & SRCH_SUBSEARCH(i)) 183 { |
184 char buf[8]; | 184 char buf[INT_STRLEN_BOUND(int)+8]; |
185 SNPRINTF1(buf, sizeof(buf), "Sub-%d ", i); 186 cmd_putstr(buf); 187 } 188 } 189 190#if HILITE_SEARCH 191 if (search_type & SRCH_FILTER) 192 cmd_putstr("&/"); --- 360 unchanged lines hidden (view full) --- 553 switch (c) 554 { 555 case '*': 556 if (less_is_more) 557 break; 558 case CONTROL('E'): /* ignore END of file */ 559 if (mca != A_FILTER) 560 flag = SRCH_PAST_EOF; | 185 SNPRINTF1(buf, sizeof(buf), "Sub-%d ", i); 186 cmd_putstr(buf); 187 } 188 } 189 190#if HILITE_SEARCH 191 if (search_type & SRCH_FILTER) 192 cmd_putstr("&/"); --- 360 unchanged lines hidden (view full) --- 553 switch (c) 554 { 555 case '*': 556 if (less_is_more) 557 break; 558 case CONTROL('E'): /* ignore END of file */ 559 if (mca != A_FILTER) 560 flag = SRCH_PAST_EOF; |
561 search_type &= ~SRCH_WRAP; |
|
561 break; 562 case '@': 563 if (less_is_more) 564 break; 565 case CONTROL('F'): /* FIRST file */ 566 if (mca != A_FILTER) 567 flag = SRCH_FIRST_FILE; 568 break; 569 case CONTROL('K'): /* KEEP position */ 570 if (mca != A_FILTER) 571 flag = SRCH_NO_MOVE; 572 break; 573 case CONTROL('S'): { /* SUBSEARCH */ | 562 break; 563 case '@': 564 if (less_is_more) 565 break; 566 case CONTROL('F'): /* FIRST file */ 567 if (mca != A_FILTER) 568 flag = SRCH_FIRST_FILE; 569 break; 570 case CONTROL('K'): /* KEEP position */ 571 if (mca != A_FILTER) 572 flag = SRCH_NO_MOVE; 573 break; 574 case CONTROL('S'): { /* SUBSEARCH */ |
574 char buf[32]; | 575 char buf[INT_STRLEN_BOUND(int)+24]; |
575 SNPRINTF1(buf, sizeof(buf), "Sub-pattern (1-%d):", NUM_SEARCH_COLORS); 576 clear_bot(); 577 cmd_putstr(buf); 578 flush(); 579 c = getcc(); 580 if (c >= '1' && c <= '0'+NUM_SEARCH_COLORS) 581 flag = SRCH_SUBSEARCH(c-'0'); 582 else --- 1513 unchanged lines hidden --- | 576 SNPRINTF1(buf, sizeof(buf), "Sub-pattern (1-%d):", NUM_SEARCH_COLORS); 577 clear_bot(); 578 cmd_putstr(buf); 579 flush(); 580 c = getcc(); 581 if (c >= '1' && c <= '0'+NUM_SEARCH_COLORS) 582 flag = SRCH_SUBSEARCH(c-'0'); 583 else --- 1513 unchanged lines hidden --- |