[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7666] no null argument to initialize_input_line
From: |
gavinsmith0123 |
Subject: |
[7666] no null argument to initialize_input_line |
Date: |
Fri, 3 Feb 2017 19:52:10 -0500 (EST) |
Revision: 7666
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7666
Author: gavin
Date: 2017-02-03 19:52:09 -0500 (Fri, 03 Feb 2017)
Log Message:
-----------
no null argument to initialize_input_line
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/echo-area.c
trunk/info/info-utils.c
trunk/info/variables.c
trunk/info/variables.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-02-03 23:47:25 UTC (rev 7665)
+++ trunk/ChangeLog 2017-02-04 00:52:09 UTC (rev 7666)
@@ -1,3 +1,13 @@
+2017-02-04 Gavin Smith <address@hidden>
+
+ * info/echo-area.c (initialize_input_line): Don't consider
+ possibility that the prompt argument is null. This removes the
+ appearance that we call 'strlen' on a pointer when it could be
+ null. (Report from Hans-Bernhard Br\xF6ker.)
+ (info_read_in_echo_area): Don't mention the possibility of a
+ null prompt argument in a comment.
+ * info/variables.c (read_variable_name): Declare as static.
+
2017-02-03 Gavin Smith <address@hidden>
* info/infodoc.c (replace_in_documentation): Remove redundant
Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c 2017-02-03 23:47:25 UTC (rev 7665)
+++ trunk/info/echo-area.c 2017-02-04 00:52:09 UTC (rev 7666)
@@ -124,11 +124,7 @@
static void
initialize_input_line (const char *prompt)
{
- if (prompt)
- strcpy (input_line, prompt);
- else
- input_line[0] = '\0';
-
+ strcpy (input_line, prompt);
input_line_beg = input_line_end = input_line_point = strlen (prompt);
}
@@ -200,8 +196,8 @@
}
/* Read a line of text in the echo area. Return a malloc ()'ed string,
- or NULL if the user aborted out of this read. PROMPT, if
- non-null, is a prompt to print before reading the line. */
+ or NULL if the user aborted out of this read. PROMPT is the prompt
+ to print before reading the line. */
char *
info_read_in_echo_area (const char *prompt)
{
Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c 2017-02-03 23:47:25 UTC (rev 7665)
+++ trunk/info/info-utils.c 2017-02-04 00:52:09 UTC (rev 7666)
@@ -2,7 +2,7 @@
$Id$
Copyright 1993, 1998, 2003, 2004, 2007, 2008, 2009, 2011, 2012,
- 2013, 2014, 2015 Free Software Foundation, Inc.
+ 2013, 2014, 2015, 2016, 2017 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
Modified: trunk/info/variables.c
===================================================================
--- trunk/info/variables.c 2017-02-03 23:47:25 UTC (rev 7665)
+++ trunk/info/variables.c 2017-02-04 00:52:09 UTC (rev 7666)
@@ -2,7 +2,7 @@
$Id$
Copyright 1993, 1997, 2001, 2002, 2004, 2007, 2008, 2011, 2013,
- 2014, 2015 Free Software Foundation, Inc.
+ 2014, 2015, 2017 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
@@ -26,6 +26,8 @@
#include "terminal.h"
#include "display.h"
+static VARIABLE_ALIST *read_variable_name (char *prompt, WINDOW *window);
+
/* **************************************************************** */
/* */
/* User Visible Variables in Info */
@@ -285,7 +287,7 @@
/* Read the name of an Info variable in the echo area and return the
address of a VARIABLE_ALIST member. A return value of NULL indicates
that no variable could be read. */
-VARIABLE_ALIST *
+static VARIABLE_ALIST *
read_variable_name (char *prompt, WINDOW *window)
{
char *line;
Modified: trunk/info/variables.h
===================================================================
--- trunk/info/variables.h 2017-02-03 23:47:25 UTC (rev 7665)
+++ trunk/info/variables.h 2017-02-04 00:52:09 UTC (rev 7666)
@@ -2,7 +2,7 @@
$Id$
Copyright 1993, 1997, 2004, 2007, 2011, 2013, 2014, 2015,
- 2016 Free Software Foundation, Inc.
+ 2016, 2017 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
@@ -46,11 +46,6 @@
#define SET_ON_COMMAND_LINE 2
#define SET_IN_SESSION 4
-/* Read the name of an Info variable in the echo area and return the
- address of a VARIABLE_ALIST member. A return value of NULL indicates
- that no variable could be read. */
-VARIABLE_ALIST *read_variable_name (char *prompt, WINDOW *window);
-
VARIABLE_ALIST *variable_by_name (char *name);
/* Make an array of REFERENCE which actually contains the names of the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7666] no null argument to initialize_input_line,
gavinsmith0123 <=