• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョンc74251adf3de3f0b248802a0aeb832f4e2471f1a (tree)
日時2020-07-01 06:10:46
作者Chet Ramey <chet.ramey@case...>
コミッターTom Tromey

ログメッセージ

reading history entries with timestamps can result in joined entries

変更サマリ

差分

--- a/readline/readline/histfile.c
+++ b/readline/readline/histfile.c
@@ -369,9 +369,11 @@ read_history_range (const char *filename, int from, int to)
369369 }
370370
371371 has_timestamps = HIST_TIMESTAMP_START (buffer);
372- history_multiline_entries += has_timestamps && history_write_timestamps;
372+ history_multiline_entries += has_timestamps && history_write_timestamps;
373373
374374 /* Skip lines until we are at FROM. */
375+ if (has_timestamps)
376+ last_ts = buffer;
375377 for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++)
376378 if (*line_end == '\n')
377379 {
@@ -380,7 +382,18 @@ read_history_range (const char *filename, int from, int to)
380382 line. We should check more extensively here... */
381383 if (HIST_TIMESTAMP_START(p) == 0)
382384 current_line++;
385+ else
386+ last_ts = p;
383387 line_start = p;
388+ /* If we are at the last line (current_line == from) but we have
389+ timestamps (has_timestamps), then line_start points to the
390+ text of the last command, and we need to skip to its end. */
391+ if (current_line >= from && has_timestamps)
392+ {
393+ for (line_end = p; line_end < bufend && *line_end != '\n'; line_end++)
394+ ;
395+ line_start = (*line_end == '\n') ? line_end + 1 : line_end;
396+ }
384397 }
385398
386399 /* If there are lines left to gobble, then gobble them now. */
--- a/readline/readline/patchlevel
+++ b/readline/readline/patchlevel
@@ -1,3 +1,3 @@
11 # Do not edit -- exists only for use by patch
22
3-2
3+3