牛歩のごとく、遅いソース読みですが、続きです。
1335 intmax_t n;
1336 if (out_invert)
1337 {
1338 /* One or more lines are output. */
1339 for (n = 0; p < lim && n < outleft; n++)
1340 {
1341 char *nl = memchr (p, eol, lim - p);
1342 nl++;
1343 if (!out_quiet)
1344 prline (p, nl, SEP_CHAR_SELECTED);
1345 p = nl;
1346 }
1347 }
1348 else
invertとついているので反転ですね。しかし、out_invert、出力を反転するとは、どういうことなのでしょう。
定義を見てみます。
1006 static bool out_invert; /* Print nonmatching stuff. */
分かりました。マッチしていない文字列を出力するフラグですね。
さらに、オプション処理しているcase文を読めば理解できます。
2658 case 'v': 2659 out_invert = true; 2660 break;
-vオプションを使った時のフラグですね。
つづく



コメント