comp.lang.ada
 help / color / mirror / Atom feed
From: Brian McGuinness <b.mcguinness747@gmail.com>
Subject: Problem with unbounded string input
Date: Wed, 27 Jan 2021 11:59:17 -0800 (PST)	[thread overview]
Message-ID: <5af60c88-b7ab-4849-badb-c407823d45e0n@googlegroups.com> (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

             reply	other threads:[~2021-01-27 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 19:59 Brian McGuinness [this message]
2021-01-27 21:42 ` Problem with unbounded string input Jeffrey R. Carter
2021-01-27 23:09 ` Shark8
2021-01-28 18:58   ` Brian McGuinness
replies disabled

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