* [ruby-dev:45655] [ruby-trunk - Bug #6456][Open] [readline] Readline.point when history edited
@ 2012-05-19 2:22 no6v (Nobuhiro IMAI)
2012-05-21 10:24 ` [ruby-dev:45663] [ruby-trunk - Bug #6456][Assigned] " mame (Yusuke Endoh)
2013-04-06 14:11 ` [ruby-dev:47230] [ruby-trunk - Bug #6456][Third Party's Issue] " Glass_saga (Masaki Matsushita)
0 siblings, 2 replies; 3+ messages in thread
From: no6v (Nobuhiro IMAI) @ 2012-05-19 2:22 UTC (permalink / raw
To: ruby developers list
Issue #6456 has been reported by no6v (Nobuhiro IMAI).
----------------------------------------
Bug #6456: [readline] Readline.point when history edited
https://bugs.ruby-lang.org/issues/6456
Author: no6v (Nobuhiro IMAI)
Status: Open
Priority: Normal
Assignee:
Category: ext
Target version:
ruby -v: ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]
=begin
以下のように、履歴をたどって編集した時に Readline.point の値がおかしくなるようです。
require "readline"
RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]"
Readline::VERSION # => "6.2"
IO.pipe do |r, w|
Readline.input = r
w << "123\n\cP456\n\cP\n"
Readline.readline("", true) # => "123"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 6
end
# >> 123
# >> 123456
# >> 123456
=end
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:45663] [ruby-trunk - Bug #6456][Assigned] [readline] Readline.point when history edited
2012-05-19 2:22 [ruby-dev:45655] [ruby-trunk - Bug #6456][Open] [readline] Readline.point when history edited no6v (Nobuhiro IMAI)
@ 2012-05-21 10:24 ` mame (Yusuke Endoh)
2013-04-06 14:11 ` [ruby-dev:47230] [ruby-trunk - Bug #6456][Third Party's Issue] " Glass_saga (Masaki Matsushita)
1 sibling, 0 replies; 3+ messages in thread
From: mame (Yusuke Endoh) @ 2012-05-21 10:24 UTC (permalink / raw
To: ruby developers list
Issue #6456 has been updated by mame (Yusuke Endoh).
Status changed from Open to Assigned
Assignee set to kouji (Kouji Takao)
----------------------------------------
Bug #6456: [readline] Readline.point when history edited
https://bugs.ruby-lang.org/issues/6456#change-26738
Author: no6v (Nobuhiro IMAI)
Status: Assigned
Priority: Normal
Assignee: kouji (Kouji Takao)
Category: ext
Target version:
ruby -v: ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]
=begin
以下のように、履歴をたどって編集した時に Readline.point の値がおかしくなるようです。
require "readline"
RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]"
Readline::VERSION # => "6.2"
IO.pipe do |r, w|
Readline.input = r
w << "123\n\cP456\n\cP\n"
Readline.readline("", true) # => "123"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 6
end
# >> 123
# >> 123456
# >> 123456
=end
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:47230] [ruby-trunk - Bug #6456][Third Party's Issue] [readline] Readline.point when history edited
2012-05-19 2:22 [ruby-dev:45655] [ruby-trunk - Bug #6456][Open] [readline] Readline.point when history edited no6v (Nobuhiro IMAI)
2012-05-21 10:24 ` [ruby-dev:45663] [ruby-trunk - Bug #6456][Assigned] " mame (Yusuke Endoh)
@ 2013-04-06 14:11 ` Glass_saga (Masaki Matsushita)
1 sibling, 0 replies; 3+ messages in thread
From: Glass_saga (Masaki Matsushita) @ 2013-04-06 14:11 UTC (permalink / raw
To: ruby developers list
Issue #6456 has been updated by Glass_saga (Masaki Matsushita).
Status changed from Assigned to Third Party's Issue
Readline.pointの実体はGNU readlineの変数rl_pointですが、次のようなコードで検証したところ
#include <stdlib.h>
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
int
main() {
const char *prompt = "> ";
char *line = NULL;
while (line = readline(prompt)) {
add_history(line);
printf("%d: \"%s\"\n", rl_point, line);
free(line);
}
clear_history();
return EXIT_SUCCESS;
}
% ./a.out
> hoge
4: "hoge"
> hogefuga # 履歴から"hoge"を復元し"fuga"を追記
4: "hogefuga"
> hogefuga # 履歴から"hogefuga"を復元
8: "hogefuga"
以上のような挙動を示したので、GNU readline側の仕様ないしバグではないかと思われます。
----------------------------------------
Bug #6456: [readline] Readline.point when history edited
https://bugs.ruby-lang.org/issues/6456#change-38294
Author: no6v (Nobuhiro IMAI)
Status: Third Party's Issue
Priority: Normal
Assignee: kouji (Kouji Takao)
Category: ext
Target version:
ruby -v: ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]
=begin
以下のように、履歴をたどって編集した時に Readline.point の値がおかしくなるようです。
require "readline"
RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-05-19 trunk 35705) [x86_64-linux]"
Readline::VERSION # => "6.2"
IO.pipe do |r, w|
Readline.input = r
w << "123\n\cP456\n\cP\n"
Readline.readline("", true) # => "123"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 3
Readline.readline("", true) # => "123456"
Readline.point # => 6
end
# >> 123
# >> 123456
# >> 123456
=end
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-06 14:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-19 2:22 [ruby-dev:45655] [ruby-trunk - Bug #6456][Open] [readline] Readline.point when history edited no6v (Nobuhiro IMAI)
2012-05-21 10:24 ` [ruby-dev:45663] [ruby-trunk - Bug #6456][Assigned] " mame (Yusuke Endoh)
2013-04-06 14:11 ` [ruby-dev:47230] [ruby-trunk - Bug #6456][Third Party's Issue] " Glass_saga (Masaki Matsushita)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).