comp.lang.ada
 help / color / mirror / Atom feed
* Problem with unbounded string input
@ 2021-01-27 19:59 Brian McGuinness
  2021-01-27 21:42 ` Jeffrey R. Carter
  2021-01-27 23:09 ` Shark8
  0 siblings, 2 replies; 4+ messages in thread
From: Brian McGuinness @ 2021-01-27 19:59 UTC (permalink / raw)


I was having trouble reading unbounded strings, so I wrote a short test program and had the same problem.

with Ada.Strings.Unbounded;
with Ada.Text_IO;
with Ada.Text_IO.Unbounded_IO;

procedure scan2 is
  use Ada.Strings.Unbounded;
  line : Ada.Strings.Unbounded.Unbounded_String;
begin
  loop
    Ada.Text_IO.Put ("-> ");
    line := Ada.Text_IO.Unbounded_IO.Get_Line;
    exit when line = "quit";
    Ada.Text_IO.Unbounded_IO.Put_Line ("""" & line & """");
  end loop;
end scan2;

When I compile this with gnatmake 8.3.0 under Linux Mint Debian edition 4 and run it, every so often when I type a line and hit Enter there is no response until I hit Enter again, and then everything typed before the first Enter is ignored.  The rest of the time the lines I type are read and returned correctly.  I am really puzzled by this.  Is this a bug in the Ada library or am I doing something wrong?

--- Brian McGuinness

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-28 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 19:59 Problem with unbounded string input Brian McGuinness
2021-01-27 21:42 ` Jeffrey R. Carter
2021-01-27 23:09 ` Shark8
2021-01-28 18:58   ` Brian McGuinness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox