~ubuntu-branches/ubuntu/trusty/lv/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/@patch.lv.20050502_~+num-pat-option

  • Committer: Package Import Robot
  • Author(s): HIGUCHI Daisuke (VDR dai)
  • Date: 2014-03-15 03:42:28 UTC
  • Revision ID: package-import@ubuntu.com-20140315034228-6lcwgjiug8rym3wc
Tags: 4.51-2.2
* Non-maintainer upload.
* debian/control, debian/rules, debian/compat: use dh9.
* debian/control
  - add Vcs-* tags.
  - add Homepage: tag.
  - add ${misc:Depends} to Depends:.
  - add xz-utils to Recommends:.
* debian/source/format: set 3.0 (quilt).
* debian/patches/*: rename from debian/patch* and add DEP-3 headers.
* debian/copyright: convert to DEP-5.
* debian/patches/fix-hyphen-used-as-minus-sign.diff: new file.
* debian/lv.doc-base: new file.
* bump up Standards-Version 3.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
2005-05-02  GOTO Masanori  <gotom@debian.or.jp>
2
 
 
3
 
        * Add +num and +/pat option.
4
 
 
5
 
diff -Nuarp lv451/lv.1 lv451.gotom.+num/lv.1
6
 
--- lv451/lv.1  2004-01-16 21:23:33.000000000 +0900
7
 
+++ lv451.gotom.+num/lv.1       2005-05-02 21:17:52.000000000 +0900
8
 
@@ -11,7 +11,7 @@ lv \- a Powerful Multilingual File Viewe
9
 
 -V
10
 
 .br
11
 
 .B lv
12
 
-[-[+]acdfgiklmnqsuvz]
13
 
+[-acdfgiklmnqsuvz] [+acdfgiklmnqsuvz]
14
 
 .br
15
 
      [-A\fIcoding-system\fP] [-I\fIcoding-system\fP] [-K\fIcoding-system\fP]
16
 
 .br
17
 
@@ -21,7 +21,9 @@ lv \- a Powerful Multilingual File Viewe
18
 
 .br
19
 
      [-T\fInumber\fP] [-W\fIwidth\fP] [-H\fIheight\fP] [-E'\fIeditor'\fP] [-+]
20
 
 .br
21
 
-     [-] (\fIgrep pattern\fP) [\fIfiles ...\fP]
22
 
+     [+\fInumber\fP] [+/\fIgrep-pattern\fP]
23
 
+.br
24
 
+     [-] (\fIgrep-pattern\fP) [\fIfiles ...\fP]
25
 
 .SH DESCRIPTION
26
 
 .IP "\fIMultilingual file viewer\fP"
27
 
 \fIlv\fP is a powerful multilingual file viewer.
28
 
@@ -223,8 +225,12 @@ You can also turn OFF specified options,
29
 
 using ``+<option>'' like +c, +d, ... +z.
30
 
 .IP "-"
31
 
 Treat the following arguments as filenames
32
 
-.IP "\fIgrep pattern\fP"
33
 
+.IP "\fIgrep-pattern\fP"
34
 
 lv works like \fIgrep\fP (1) when its name is \fIlgrep\fP
35
 
+.IP "+\fInumber\fP"
36
 
+Jump to the specified line immediately when lv is invoked.
37
 
+.IP "+/\fIgrep-pattern\fP"
38
 
+Search  the specified pattern immediately when lv is invoked.
39
 
 .IP "-V"
40
 
 Show lv version
41
 
 .IP "-h"
42
 
diff -Nuarp lv451/src/command.c lv451.gotom.+num/src/command.c
43
 
--- lv451/src/command.c 2004-01-05 16:42:31.000000000 +0900
44
 
+++ lv451.gotom.+num/src/command.c      2005-05-02 20:45:18.000000000 +0900
45
 
@@ -66,8 +66,6 @@
46
 
 #define COM_FILE_PREV          'p'
47
 
 #define COM_FILE_NEXT          'n'
48
 
 
49
 
-#define IsNumber( c )          ( (c) >= '0' && (c) <= '9' )
50
 
-
51
 
 #ifdef MSDOS
52
 
 #define HISTORY_SIZE           2
53
 
 #else
54
 
@@ -145,6 +143,22 @@ private void CommandCopyToHistory( str_t
55
 
     historyIndex = 0;
56
 
 }
57
 
 
58
 
+private int CommandGetChar()
59
 
+{
60
 
+  int ch;
61
 
+
62
 
+  if( FALSE == initcmd_mode ){
63
 
+    return ConsoleGetChar();
64
 
+  }
65
 
+
66
 
+  ch = initcmd_str[ initcmd_curp++ ];
67
 
+  if( initcmd_str[ initcmd_curp ] == NUL ){
68
 
+    initcmd_mode = FALSE;
69
 
+    free( initcmd_str );
70
 
+  }
71
 
+  return ch;
72
 
+}
73
 
+
74
 
 private i_str_t *CommandGetLine( file_t *f, byte prompt )
75
 
 {
76
 
   int ch, ptr, iptr, width, pre_width, index;
77
 
@@ -164,13 +178,14 @@ private i_str_t *CommandGetLine( file_t 
78
 
   pre_width = -1;
79
 
   for( ; ; ){
80
 
     ConsoleFlush();
81
 
-    ch = ConsoleGetChar();
82
 
+    ch = CommandGetChar();
83
 
     switch( ch ){
84
 
     case EOF:
85
 
     case BEL: /* C-g */
86
 
       if( NULL != istr )
87
 
        IstrFree( istr );
88
 
       return NULL;
89
 
+    case LF: /* C-j */
90
 
     case CR: /* C-m */
91
 
       if( NULL == istr )
92
 
        return NULL;
93
 
@@ -344,7 +359,7 @@ private boolean_t CommandGetNumber( unsi
94
 
     ConsolePrints( buf );
95
 
 
96
 
     ConsoleFlush();
97
 
-    ch = ConsoleGetChar();
98
 
+    ch = CommandGetChar();
99
 
     if( EOF == ch )
100
 
       return FALSE;
101
 
     else if( BS == ch || DEL == ch ){
102
 
@@ -902,7 +917,7 @@ private void CommandCursor( unsigned int
103
 
   flagLeft = flagRight = flagUp = flagDown = flagPpage = flagNpage = TRUE;
104
 
   step = 1;
105
 
   for( ; ; ){
106
 
-    ch = ConsoleGetChar();
107
 
+    ch = CommandGetChar();
108
 
     if( NULL == cur_left || ch != cur_left[ step ] )
109
 
       flagLeft = FALSE;
110
 
     if( NULL == cur_right || ch != cur_right[ step ] )
111
 
@@ -954,7 +969,7 @@ private void CommandColon( unsigned int 
112
 
   stream_t *st;
113
 
   file_list_t *next_target;
114
 
 
115
 
-  ch = ConsoleGetChar();
116
 
+  ch = CommandGetChar();
117
 
 
118
 
   if( COM_FILE_PREV == ch || COM_FILE_NEXT == ch ){
119
 
     if( 0 < arg ){
120
 
@@ -1179,7 +1194,7 @@ public void Command( file_t *file, byte 
121
 
     }
122
 
 
123
 
     ConsoleFlush();
124
 
-    com = ConsoleGetChar();
125
 
+    com = CommandGetChar();
126
 
     if( com < 0x00 || com > 0x7f )
127
 
       continue;
128
 
 
129
 
diff -Nuarp lv451/src/command.h lv451.gotom.+num/src/command.h
130
 
--- lv451/src/command.h 2003-11-13 12:08:19.000000000 +0900
131
 
+++ lv451.gotom.+num/src/command.h      2005-05-02 20:29:11.000000000 +0900
132
 
@@ -12,6 +12,12 @@
133
 
 
134
 
 public byte *editor_program;
135
 
 
136
 
+public boolean_t initcmd_mode;
137
 
+public char *initcmd_str;
138
 
+public int initcmd_curp;
139
 
+
140
 
+#define IsNumber( c )          ( (c) >= '0' && (c) <= '9' )
141
 
+
142
 
 public boolean_t CommandInit();
143
 
 public void Command( file_t *file, byte **optional );
144
 
 
145
 
diff -Nuarp lv451/src/conf.c lv451.gotom.+num/src/conf.c
146
 
--- lv451/src/conf.c    2004-01-05 16:23:29.000000000 +0900
147
 
+++ lv451.gotom.+num/src/conf.c 2005-05-02 20:33:44.000000000 +0900
148
 
@@ -313,38 +313,52 @@ private void ConfArg( conf_t *conf, byte
149
 
     }
150
 
   } else if( TRUE == conf->options && '+' == **argv ){
151
 
     s = *argv + 1;
152
 
-    while( *s ){
153
 
-      switch( *s ){
154
 
+    if( *s == '/' || IsNumber( *s ) ){
155
 
+      size_t initcmd_len = strlen( s );
156
 
+      initcmd_mode = TRUE;
157
 
+      initcmd_curp = 0;
158
 
+      initcmd_str = Malloc( initcmd_len + 2 );
159
 
+      strcpy( initcmd_str, s );
160
 
+      if( *s == '/' ){
161
 
+       initcmd_str[ initcmd_len ] = CR;
162
 
+      } else if( IsNumber( *s ) && IsNumber( s[ initcmd_len - 1 ] ) ){
163
 
+       initcmd_str[ initcmd_len ] = 'g';
164
 
+      }
165
 
+      initcmd_str[ initcmd_len + 1 ] = NUL;
166
 
+    } else {
167
 
+      while( *s ){
168
 
+       switch( *s ){
169
 
 #ifndef MSDOS /* IF NOT DEFINED */
170
 
-      case 'm': unimap_iso8859 = FALSE; s++; continue;
171
 
+       case 'm': unimap_iso8859 = FALSE; s++; continue;
172
 
 #endif /* MSDOS */
173
 
-      case 'a': adjust_charset = FALSE; s++; continue;
174
 
-      case 'c': allow_ansi_esc = FALSE; s++; continue;
175
 
-      case 'd': casefold_search = FALSE; s++; continue;
176
 
-      case 'i': casefold_search = FALSE; s++; continue;
177
 
-      case 'f': regexp_search = TRUE; s++; continue;
178
 
-      case 'g': grep_mode = FALSE; s++; continue;
179
 
-      case 'k': kana_conv = FALSE; s++; continue;
180
 
-      case 'l': carefully_divide = TRUE; s++; continue;
181
 
-      case 'n': line_number = FALSE; s++; continue;
182
 
-      case 'q': no_scroll = TRUE; s++; continue;
183
 
-      case 's': smooth_paging = FALSE; s++; continue;
184
 
-      case 'u': allow_unify = FALSE; s++; continue;
185
 
-      case 'v': grep_inverted = FALSE; s++; continue;
186
 
-      case 'z': hz_detection = FALSE; s++; continue;
187
 
-      case SP:
188
 
-      case HT:
189
 
-       break;
190
 
-      default:
191
 
-       UnknownOption( s, location );
192
 
-      }
193
 
-      do {
194
 
-       s++;
195
 
-       if( '-' == *s || '+' == *s ){
196
 
-         s++;
197
 
+       case 'a': adjust_charset = FALSE; s++; continue;
198
 
+       case 'c': allow_ansi_esc = FALSE; s++; continue;
199
 
+       case 'd': casefold_search = FALSE; s++; continue;
200
 
+       case 'i': casefold_search = FALSE; s++; continue;
201
 
+       case 'f': regexp_search = TRUE; s++; continue;
202
 
+       case 'g': grep_mode = FALSE; s++; continue;
203
 
+       case 'k': kana_conv = FALSE; s++; continue;
204
 
+       case 'l': carefully_divide = TRUE; s++; continue;
205
 
+       case 'n': line_number = FALSE; s++; continue;
206
 
+       case 'q': no_scroll = TRUE; s++; continue;
207
 
+       case 's': smooth_paging = FALSE; s++; continue;
208
 
+       case 'u': allow_unify = FALSE; s++; continue;
209
 
+       case 'v': grep_inverted = FALSE; s++; continue;
210
 
+       case 'z': hz_detection = FALSE; s++; continue;
211
 
+       case SP:
212
 
+       case HT:
213
 
          break;
214
 
+       default:
215
 
+         UnknownOption( s, location );
216
 
        }
217
 
-      } while( *s );
218
 
+       do {
219
 
+         s++;
220
 
+         if( '-' == *s || '+' == *s ){
221
 
+           s++;
222
 
+           break;
223
 
+         }
224
 
+       } while( *s );
225
 
+      }
226
 
     }
227
 
   } else {
228
 
     if( TRUE == grep_mode && NULL == conf->pattern )