[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5711] info_find_file: call xstrdup on a string
From: |
Gavin D. Smith |
Subject: |
[5711] info_find_file: call xstrdup on a string |
Date: |
Tue, 15 Jul 2014 14:45:39 +0000 |
Revision: 5711
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5711
Author: gavin
Date: 2014-07-15 14:45:36 +0000 (Tue, 15 Jul 2014)
Log Message:
-----------
info_find_file: call xstrdup on a string
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/Makefile.am
trunk/info/nodes.c
trunk/info/t/Init-inter.inc
trunk/info/t/Timeout-test.inc
Added Paths:
-----------
trunk/info/t/relative-reference.sh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-07-15 13:05:36 UTC (rev 5710)
+++ trunk/ChangeLog 2014-07-15 14:45:36 UTC (rev 5711)
@@ -1,5 +1,15 @@
2014-07-15 Gavin Smith <address@hidden>
+ * info/nodes.c (info_find_file): Call xstrdup on a string so we can
+ free it later.
+
+ * info/t/relative-reference.sh: New test.
+ * info/t/Init-inter.inc (run_ginfo): Inform about program failure
+ on pipe.
+ * info/t/Timeout-test.inc: Check for failure message.
+
+2014-07-15 Gavin Smith <address@hidden>
+
* info/t/Init-inter.inc (run_ginfo): New function to wrap call of
program for interactive tests.
* info/t/Timeout-test.inc: New file.
Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am 2014-07-15 13:05:36 UTC (rev 5710)
+++ trunk/info/Makefile.am 2014-07-15 14:45:36 UTC (rev 5711)
@@ -116,6 +116,7 @@
t/split-index.sh \
t/index-long-nodeline.sh \
t/menu-sequence.sh \
+ t/relative-reference.sh \
t/quoted-label-as-target.sh \
t/quoted-target.sh \
t/quoted-label-and-target.sh \
Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c 2014-07-15 13:05:36 UTC (rev 5710)
+++ trunk/info/nodes.c 2014-07-15 14:45:36 UTC (rev 5711)
@@ -628,7 +628,7 @@
if (!is_fullpath)
fullpath = info_find_fullpath (filename, 0);
else
- fullpath = filename;
+ fullpath = xstrdup (filename);
/* FIXME: Put the following in info_find_fullpath, or remove
it altogether. */
Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2014-07-15 13:05:36 UTC (rev 5710)
+++ trunk/info/t/Init-inter.inc 2014-07-15 14:45:36 UTC (rev 5711)
@@ -49,7 +49,8 @@
{
rm -f $0.finished
mkfifo $0.finished
- { $GINFO "$@" ; echo finished >$0.finished ; } 0<>$PTS_DEVICE 1<&0 &
+ { $GINFO "$@" ; test $? -eq 0 || echo failure >$0.finished ;
+ echo finished >$0.finished ; } 0<>$PTS_DEVICE 1<&0 &
}
Modified: trunk/info/t/Timeout-test.inc
===================================================================
--- trunk/info/t/Timeout-test.inc 2014-07-15 13:05:36 UTC (rev 5710)
+++ trunk/info/t/Timeout-test.inc 2014-07-15 14:45:36 UTC (rev 5711)
@@ -17,8 +17,13 @@
read -t 3 FINISHED <>$0.finished
rm -f $0.finished
-if ! test "$FINISHED" = finished
+
+if test "$FINISHED" = failure
then
+ echo 'Program exited unsuccessfully' >&2
+ RETVAL=1
+elif ! test "$FINISHED" = finished
+then
echo 'Program timed out after 3 seconds' >&2
TIMED_OUT=1
Added: trunk/info/t/relative-reference.sh
===================================================================
--- trunk/info/t/relative-reference.sh (rev 0)
+++ trunk/info/t/relative-reference.sh 2014-07-15 14:45:36 UTC (rev 5711)
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+srcdir=${srcdir:-.}
+. $srcdir/t/Init-test.inc
+. $t/Init-inter.inc
+
+# Split window with C-x 2, follow menu entry with a slash in the filename.
+# Close window (so destination file will be forgotten), and do it again with
+# the other window.
+run_ginfo -f file-menu
+printf '\0302\t\t\t\r' >$PTY_TYPE
+printf '\030o\0301\t\t\t\rq' >$PTY_TYPE
+
+. $t/Timeout-test.inc
+. $t/Cleanup.inc
+
Property changes on: trunk/info/t/relative-reference.sh
___________________________________________________________________
Added: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5711] info_find_file: call xstrdup on a string,
Gavin D. Smith <=