NetBSD Problem Report #46059

From www@NetBSD.org  Mon Feb 20 08:55:12 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 1BB9663E0C8
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Feb 2012 08:55:12 +0000 (UTC)
Message-Id: <20120220085511.5CF6E63DFB4@www.NetBSD.org>
Date: Mon, 20 Feb 2012 08:55:11 +0000 (UTC)
From: naruse@airemix.jp
Reply-To: naruse@airemix.jp
To: gnats-bugs@NetBSD.org
Subject: libedit readline doesn't reset el_infile/el_outfile
X-Send-Pr-Version: www-1.0

>Number:         46059
>Category:       lib
>Synopsis:       libedit readline doesn't reset el_infile/el_outfile
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 20 09:00:01 +0000 2012
>Originator:     Yui NARUSE
>Release:        NetBSD 6.99.1 i386
>Organization:
>Environment:
NetBSD nbsd.rubyci.org 6.99.1 NetBSD 6.99.1 (GENERIC) #0: Fri Feb 17 13:43:00 JST 2012  naruse@nbsd.rubyci.org:/usr/obj/sys/arch/i386/compile/GENERIC i386
>Description:
The user program can set input/output stream of readline by rl_instream/rl_outstream.
But libedit readline wrapper doesn't reset its internal el_infile/el_outfile
even if the user program change the value after initialization.
>How-To-Repeat:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
int main(void)
{
    int pipes[2];
    pipe(pipes);
    printf("r:%s\n", readline("> "));
    rl_instream = fdopen(pipes[0], "rb");
    write(pipes[1], "foo\n", 4);
    printf("r:%s\n", readline("> "));
    return 0;
}
>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.