summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-19 16:12:53 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-19 16:12:53 +0900
commit9373ef64094e393d565887fe41cdbbfe4015f457 (patch)
treeb785eaa4355cd668547b20c15fe70915d2a5f0a8
parent18234bf8e675319af2c7ed3e4e46060113e73d16 (diff)
downloaded-9373ef64094e393d565887fe41cdbbfe4015f457.tar.gz
ed-9373ef64094e393d565887fe41cdbbfe4015f457.tar.bz2
ed-9373ef64094e393d565887fe41cdbbfe4015f457.zip
Imported Upstream version 1.13upstream/1.13
-rw-r--r--ChangeLog11
-rw-r--r--INSTALL2
-rw-r--r--NEWS8
-rw-r--r--README2
-rw-r--r--buffer.c7
-rw-r--r--carg_parser.c2
-rw-r--r--carg_parser.h2
-rwxr-xr-xconfigure10
-rw-r--r--doc/ed.14
-rw-r--r--doc/ed.info28
-rw-r--r--doc/ed.texi8
-rw-r--r--ed.h2
-rw-r--r--global.c2
-rw-r--r--io.c6
-rw-r--r--main.c4
-rw-r--r--main_loop.c2
-rw-r--r--regex.c2
-rw-r--r--signal.c2
-rwxr-xr-xtestsuite/check.sh2
19 files changed, 56 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index ca1c69d..4e63d63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-01-24 Antonio Diaz Diaz <antonio@gnu.org>
+
+ * Version 1.13 released.
+ * buffer.c (put_sbuf_line): Fixed a memory leak.
+ * io.c (read_file, write_file): Close file on error.
+ (Both issues reported by Cédric Picard).
+
2015-07-04 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.12 released.
@@ -22,7 +29,7 @@
2013-06-18 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.9 released.
- * check.sh: Do not feed shell scripts to ed.
+ * check.sh: Don't feed shell scripts to ed.
* configure: Options now accept a separate argument.
2013-04-23 Antonio Diaz Diaz <antonio@gnu.org>
@@ -224,7 +231,7 @@ Dec 1993 François Pinard <pinard@icule>
Copyright (C) 1993 François Pinard
Copyright (C) 1994 Andrew Moore
-Copyright (C) 2006-2015 Antonio Diaz Diaz.
+Copyright (C) 2006-2016 Antonio Diaz Diaz.
This file is a collection of facts, and thus it is not copyrightable,
but just in case, you have unlimited permission to copy, distribute and
diff --git a/INSTALL b/INSTALL
index 170db71..18e7c6c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -58,7 +58,7 @@ After running 'configure', you can run 'make' and 'make install' as
explained above.
-Copyright (C) 2006-2015 Antonio Diaz Diaz.
+Copyright (C) 2006-2016 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.
diff --git a/NEWS b/NEWS
index 8b1428d..22f6186 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,4 @@
-Changes in version 1.12:
+Changes in version 1.13:
-Extra spaces have been removed from the synopses of some commands in the
-manual.
-
-Minor documentation fixes.
+A memory leak and a resource leak (file not closed on error) have been
+fixed. (Both issues were reported by Cédric Picard).
diff --git a/README b/README
index bc86c71..5f43db1 100644
--- a/README
+++ b/README
@@ -136,7 +136,7 @@ or:
Copyright (C) 1993, 1994 Andrew Moore
-Copyright (C) 2006-2015 Antonio Diaz Diaz.
+Copyright (C) 2006-2016 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.
diff --git a/buffer.c b/buffer.c
index a3e6f6e..b2121ce 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,7 +1,7 @@
/* buffer.c: scratch-file buffer routines for the ed line editor. */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
@@ -439,11 +439,10 @@ bool put_lines( const int addr )
const char * put_sbuf_line( const char * const buf, const int size,
const int addr )
{
- line_t * const lp = dup_line_node( 0 );
const char * const p = (const char *) memchr( buf, '\n', size );
+ line_t * lp;
int len;
- if( !lp ) return 0;
if( !p ) { set_error_msg( "Line too long" ); return 0; }
len = p - buf;
/* out of position */
@@ -465,6 +464,8 @@ const char * put_sbuf_line( const char * const buf, const int size,
set_error_msg( "Cannot write temp file" );
return 0;
}
+ lp = dup_line_node( 0 );
+ if( !lp ) return 0;
lp->pos = sfpos; lp->len = len;
add_line_node( lp, addr );
++current_addr_;
diff --git a/carg_parser.c b/carg_parser.c
index 8d74ea6..3d4e89f 100644
--- a/carg_parser.c
+++ b/carg_parser.c
@@ -1,5 +1,5 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C version)
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
This library is free software. Redistribution and use in source and
binary forms, with or without modification, are permitted provided
diff --git a/carg_parser.h b/carg_parser.h
index ed4d9c5..e918942 100644
--- a/carg_parser.h
+++ b/carg_parser.h
@@ -1,5 +1,5 @@
/* Arg_parser - POSIX/GNU command line argument parser. (C version)
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
This library is free software. Redistribution and use in source and
binary forms, with or without modification, are permitted provided
diff --git a/configure b/configure
index 51875c9..50f3cad 100755
--- a/configure
+++ b/configure
@@ -1,12 +1,12 @@
#! /bin/sh
# configure script for GNU ed - The GNU line editor
-# Copyright (C) 2006-2015 Antonio Diaz Diaz.
+# Copyright (C) 2006-2016 Antonio Diaz Diaz.
#
# This configure script is free software: you have unlimited permission
# to copy, distribute and modify it.
pkgname=ed
-pkgversion=1.12
+pkgversion=1.13
progname=ed
srctrigger=doc/${pkgname}.texi
@@ -143,7 +143,7 @@ if [ -z "${no_create}" ] ; then
rm -f config.status
cat > config.status << EOF
#! /bin/sh
-# This file was generated automatically by configure. Do not edit.
+# This file was generated automatically by configure. Don't edit.
# Run this file to recreate the current configuration.
#
# This script is free software: you have unlimited permission
@@ -170,8 +170,8 @@ echo "LDFLAGS = ${LDFLAGS}"
rm -f Makefile
cat > Makefile << EOF
# Makefile for GNU ed - The GNU line editor
-# Copyright (C) 2006-2015 Antonio Diaz Diaz.
-# This file was generated automatically by configure. Do not edit.
+# Copyright (C) 2006-2016 Antonio Diaz Diaz.
+# This file was generated automatically by configure. Don't edit.
#
# This Makefile is free software: you have unlimited permission
# to copy, distribute and modify it.
diff --git a/doc/ed.1 b/doc/ed.1
index bca3551..ac8b882 100644
--- a/doc/ed.1
+++ b/doc/ed.1
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.1.
-.TH ED "1" "July 2015" "ed 1.12" "User Commands"
+.TH ED "1" "January 2016" "ed 1.13" "User Commands"
.SH NAME
ed \- line-oriented text editor
.SH SYNOPSIS
@@ -49,7 +49,7 @@ General help using GNU software: http://www.gnu.org/gethelp
.SH COPYRIGHT
Copyright \(co 1994 Andrew L. Moore.
.br
-Copyright \(co 2015 Antonio Diaz Diaz.
+Copyright \(co 2016 Antonio Diaz Diaz.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.
diff --git a/doc/ed.info b/doc/ed.info
index 3b47ae7..a239faf 100644
--- a/doc/ed.info
+++ b/doc/ed.info
@@ -5,7 +5,7 @@ START-INFO-DIR-ENTRY
* Ed: (ed). The GNU line editor
END-INFO-DIR-ENTRY
- Copyright (C) 1993, 1994, 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 2006-2016 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -18,7 +18,7 @@ File: ed.info, Node: Top, Next: Overview, Up: (dir)
The GNU ed line editor
**********************
-This manual is for GNU ed (version 1.12, 4 July 2015).
+This manual is for GNU ed (version 1.13, 24 January 2016).
GNU ed is a line-oriented text editor. It is used to create, display,
@@ -43,7 +43,7 @@ superseded by full-screen editors such as GNU Emacs or GNU Moe.
* GNU Free Documentation License:: How you can copy and share this manual
- Copyright (C) 1993, 1994, 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 2006-2016 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -338,7 +338,7 @@ prefixed with a bang.
'-l'
'--loose-exit-status'
- Do not exit with bad status if a command happens to "fail" (for
+ Don't exit with bad status if a command happens to "fail" (for
example if a substitution command finds nothing to replace). This
can be useful when 'ed' is invoked as the editor for crontab.
@@ -1412,16 +1412,16 @@ permit their use in free software.

Tag Table:
Node: Top535
-Node: Overview2191
-Node: Introduction to line editing4247
-Node: Invoking ed11466
-Node: Line addressing13267
-Node: Regular expressions16344
-Node: Commands21688
-Node: Limitations32960
-Node: Diagnostics33605
-Node: Problems34306
-Node: GNU Free Documentation License34839
+Node: Overview2195
+Node: Introduction to line editing4251
+Node: Invoking ed11470
+Node: Line addressing13270
+Node: Regular expressions16347
+Node: Commands21691
+Node: Limitations32963
+Node: Diagnostics33608
+Node: Problems34309
+Node: GNU Free Documentation License34842

End Tag Table
diff --git a/doc/ed.texi b/doc/ed.texi
index 5059473..26fb2a9 100644
--- a/doc/ed.texi
+++ b/doc/ed.texi
@@ -6,8 +6,8 @@
@finalout
@c %**end of header
-@set UPDATED 4 July 2015
-@set VERSION 1.12
+@set UPDATED 24 January 2016
+@set VERSION 1.13
@dircategory Basics
@direntry
@@ -15,7 +15,7 @@
@end direntry
@copying
-Copyright @copyright{} 1993, 1994, 2006-2015
+Copyright @copyright{} 1993, 1994, 2006-2016
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -392,7 +392,7 @@ not seem familiar, then try invoking @command{ed} with this switch.
@item -l
@itemx --loose-exit-status
-Do not exit with bad status if a command happens to "fail" (for example
+Don't exit with bad status if a command happens to "fail" (for example
if a substitution command finds nothing to replace). This can be useful
when @command{ed} is invoked as the editor for crontab.
diff --git a/ed.h b/ed.h
index 43cd355..b7ccffb 100644
--- a/ed.h
+++ b/ed.h
@@ -1,7 +1,7 @@
/* Global declarations for the ed editor. */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
diff --git a/global.c b/global.c
index 5e7def6..5a9c2e1 100644
--- a/global.c
+++ b/global.c
@@ -1,7 +1,7 @@
/* global.c: global command routines for the ed line editor */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
diff --git a/io.c b/io.c
index 548e7d3..bf7c154 100644
--- a/io.c
+++ b/io.c
@@ -1,7 +1,7 @@
/* io.c: i/o routines for the ed line editor */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
@@ -261,8 +261,8 @@ int read_file( const char * const filename, const int addr )
return -1;
}
size = read_stream( fp, addr );
- if( size < 0 ) return -1;
if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
+ if( size < 0 ) return -1;
if( ret != 0 )
{
show_strerror( filename, errno );
@@ -319,8 +319,8 @@ int write_file( const char * const filename, const char * const mode,
return -1;
}
size = write_stream( fp, from, to );
- if( size < 0 ) return -1;
if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
+ if( size < 0 ) return -1;
if( ret != 0 )
{
show_strerror( filename, errno );
diff --git a/main.c b/main.c
index ff7e4a2..915aa8b 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,5 @@
/* GNU ed - The GNU line editor.
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
@@ -44,7 +44,7 @@
static const char * const Program_name = "GNU Ed";
static const char * const program_name = "ed";
-static const char * const program_year = "2015";
+static const char * const program_year = "2016";
static const char * invocation_name = 0;
static bool restricted_ = false; /* if set, run in restricted mode */
diff --git a/main_loop.c b/main_loop.c
index 0d118cc..a4c8914 100644
--- a/main_loop.c
+++ b/main_loop.c
@@ -1,6 +1,6 @@
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
diff --git a/regex.c b/regex.c
index 4a5f2b3..2ca49ce 100644
--- a/regex.c
+++ b/regex.c
@@ -1,7 +1,7 @@
/* regex.c: regular expression interface routines for the ed line editor. */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
diff --git a/signal.c b/signal.c
index 18a3873..63ba1cc 100644
--- a/signal.c
+++ b/signal.c
@@ -1,7 +1,7 @@
/* signal.c: signal and miscellaneous routines for the ed line editor. */
/* GNU ed - The GNU line editor.
Copyright (C) 1993, 1994 Andrew Moore, Talke Studio
- Copyright (C) 2006-2015 Antonio Diaz Diaz.
+ Copyright (C) 2006-2016 Antonio Diaz Diaz.
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
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 9a7e35b..81ee128 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# check script for GNU ed - The GNU line editor
-# Copyright (C) 2006-2015 Antonio Diaz Diaz.
+# Copyright (C) 2006-2016 Antonio Diaz Diaz.
#
# This script is free software; you have unlimited permission
# to copy, distribute and modify it.