[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42111] ans = [] for input()
From: |
Ben Abbott |
Subject: |
[Octave-bug-tracker] [bug #42111] ans = [] for input() |
Date: |
Sun, 13 Apr 2014 21:34:36 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14 |
URL:
<http://savannah.gnu.org/bugs/?42111>
Summary: ans = [] for input()
Project: GNU Octave
Submitted by: bpabbott
Submitted on: Sun 13 Apr 2014 05:34:35 PM EDT
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Ben Abbott
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The "input()" function returns an empty result when nargout = 0.
This was originally reported on the help list.
http://lists.gnu.org/archive/html/help-octave/2014-04/msg00131.html
The patch below works for me, but I'm not sure if this is a proper fix.
diff --git a/libinterp/corefcn/input.cc b/libinterp/corefcn/input.cc
--- a/libinterp/corefcn/input.cc
+++ b/libinterp/corefcn/input.cc
@@ -770,7 +770,7 @@
int nargin = args.length ();
if (nargin == 1 || nargin == 2)
- retval = get_user_input (args, nargout);
+ retval = get_user_input (args, 1);
else
print_usage ();
Should "get_user_input ()" be modified to always return at least one arg?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42111>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #42111] ans = [] for input(),
Ben Abbott <=