changeset 5133:7191f6e086f9

[project @ 2005-02-08 19:17:41 by jwe]
author jwe
date Tue, 08 Feb 2005 19:17:41 +0000
parents 5c96a48f8dc2
children 0309b6722ee9
files libcruft/ChangeLog libcruft/misc/quit.h scripts/ChangeLog scripts/strings/dec2base.m
diffstat 4 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libcruft/ChangeLog	Tue Feb 08 17:20:38 2005 +0000
+++ b/libcruft/ChangeLog	Tue Feb 08 19:17:41 2005 +0000
@@ -1,3 +1,7 @@
+2005-02-08  John W. Eaton  <jwe@octave.org>
+
+	* misc/quit.h: Use C-style comments.
+
 2004-09-08  John W. Eaton  <jwe@octave.org>
 
 	* misc/machar.c (rmachar): Use modern C declaration.
--- a/libcruft/misc/quit.h	Tue Feb 08 17:20:38 2005 +0000
+++ b/libcruft/misc/quit.h	Tue Feb 08 19:17:41 2005 +0000
@@ -68,10 +68,11 @@
 
 extern sig_atomic_t octave_interrupt_immediately;
 
-// > 0: interrupt pending
-//   0: no interrupt pending
-// < 0: handling interrupt
-//
+/*
+  > 0: interrupt pending
+    0: no interrupt pending
+  < 0: handling interrupt
+*/
 extern sig_atomic_t octave_interrupt_state;
 
 extern sig_atomic_t octave_allocation_error;
--- a/scripts/ChangeLog	Tue Feb 08 17:20:38 2005 +0000
+++ b/scripts/ChangeLog	Tue Feb 08 19:17:41 2005 +0000
@@ -1,3 +1,8 @@
+2005-02-08  John W. Eaton  <jwe@octave.org>
+
+	* strings/dec2base.m: Don't delete leading zero if third arg is
+	provided and len <= computed max_len.
+
 2005-01-27  David Bateman  <dbateman@free.fr>
 
 	* strings/dec2base.m: Be even more careful about handling all digits.
--- a/scripts/strings/dec2base.m	Tue Feb 08 17:20:38 2005 +0000
+++ b/scripts/strings/dec2base.m	Tue Feb 08 19:17:41 2005 +0000
@@ -89,8 +89,13 @@
   ## convert digits to symbols
   retval = reshape (symbols (digits+1), size (digits));
 
-  ## Check if the first element is the zero symbol
-  if (all (retval(:,1) == symbols(1)))
+  ## Check if the first element is the zero symbol. It seems possible
+  ## that LEN is provided, and is less than the computed MAX_LEN and
+  ## MAX_LEN is computed to be one larger than necessary, so we would
+  ## have a leading zero to remove.  But if LEN >= MAX_LEN, we should
+  ## not remove any leading zeros.
+  if ((nargin == 2 || (nargin == 3 && max_len > len))
+      && all (retval(:,1) == symbols(1)))
     retval = retval(:,2:end);
   endif