Skip to content

Instantly share code, notes, and snippets.

@vaiorabbit
Created February 23, 2012 15:35
Show Gist options
  • Save vaiorabbit/1893331 to your computer and use it in GitHub Desktop.
Save vaiorabbit/1893331 to your computer and use it in GitHub Desktop.
LV Version 4.51 : patch for '-F' to select filename display
diff -u src_orig/conf.c src/conf.c
--- src_orig/conf.c 2004-01-05 16:23:29.000000000 +0900
+++ src/conf.c 2012-02-24 00:20:06.000000000 +0900
@@ -285,6 +285,7 @@
case 'd': casefold_search = TRUE; s++; continue;
case 'i': casefold_search = TRUE; s++; continue;
case 'f': regexp_search = FALSE; s++; continue;
+ case 'F': show_filename = TRUE; s++; continue;
case 'g': grep_mode = TRUE; s++; continue;
case 'k': kana_conv = TRUE; s++; continue;
case 'l': carefully_divide = FALSE; s++; continue;
@@ -323,6 +324,7 @@
case 'd': casefold_search = FALSE; s++; continue;
case 'i': casefold_search = FALSE; s++; continue;
case 'f': regexp_search = TRUE; s++; continue;
+ case 'F': show_filename = FALSE; s++; continue;
case 'g': grep_mode = FALSE; s++; continue;
case 'k': kana_conv = FALSE; s++; continue;
case 'l': carefully_divide = TRUE; s++; continue;
diff -u src_orig/conv.h src/conv.h
--- src_orig/conv.h 2003-11-13 12:08:19.000000000 +0900
+++ src/conv.h 2012-02-24 00:21:44.000000000 +0900
@@ -10,6 +10,7 @@
#include <file.h>
+public boolean_t show_filename;
public boolean_t grep_mode;
public boolean_t grep_inverted;
public boolean_t line_number;
diff -u src_orig/lv.c src/lv.c
--- src_orig/lv.c 2004-01-05 16:30:15.000000000 +0900
+++ src/lv.c 2012-02-24 00:24:31.000000000 +0900
@@ -251,14 +251,14 @@
/*
* 対象ファイルが一個
*/
- if( TRUE == LvGrep( conf, FALSE ) )
+ if( TRUE == LvGrep( conf, show_filename/*FALSE*/ ) )
flagMatched = TRUE;
} else {
/*
* 対象ファイルが複数
*/
for( ; ; ){
- if( TRUE == LvGrep( conf, TRUE ) )
+ if( TRUE == LvGrep( conf, show_filename/*TRUE*/ ) )
flagMatched = TRUE;
if( NULL == *(++conf->file) )
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment