Commit 687f3715 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL

Fix for NULL pointer read

When closing an input file, some RISC OS specific code was trying to read the file attributes via OS_File, except it also did this when the input is stdin. Move the call down to be after the stdin check so we have a valid filename.

Version 0.03. Tagged as 'sed-0_03'
parent 678e6c28
/* (0.02)
/* (0.03)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.02
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 30 Jul 2013
#define Module_MajorVersion_CMHG 0.03
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 May 2020
#define Module_MajorVersion "0.02"
#define Module_Version 2
#define Module_MajorVersion "0.03"
#define Module_Version 3
#define Module_MinorVersion ""
#define Module_Date "30 Jul 2013"
#define Module_Date "04 May 2020"
#define Module_ApplicationDate "30-Jul-13"
#define Module_ApplicationDate "04-May-20"
#define Module_ComponentName "sed"
#define Module_ComponentPath "gpl/RiscOS/Tools/Sources/GNU/sed"
#define Module_FullVersion "0.02"
#define Module_HelpVersion "0.02 (30 Jul 2013)"
#define Module_LibraryVersionInfo "0:2"
#define Module_FullVersion "0.03"
#define Module_HelpVersion "0.03 (04 May 2020)"
#define Module_LibraryVersionInfo "0:3"
......@@ -572,12 +572,6 @@ static void
closedown(input)
struct input *input;
{
#ifdef __riscos
extern int _swix ();
int load, exec, access, type;
int ok = !_swix (8, 3 | 0x36<<24, 23, input->in_file_name,
&load, &exec, &access, &type);
#endif
input->read_fn = read_always_fail;
if (!input->fp)
return;
......@@ -586,6 +580,12 @@ closedown(input)
if (in_place_extension && output_file != NULL)
{
#ifdef __riscos
extern int _swix ();
int load, exec, access, type;
int ok = !_swix (8, 3 | 0x36<<24, 23, input->in_file_name,
&load, &exec, &access, &type);
#endif
if (strcmp(in_place_extension, "*") != 0)
{
char *backup_file_name = get_backup_file_name(input->in_file_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment