+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.
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>
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
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.
-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).
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.
/* 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
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 */
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_;
/* 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
/* 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
#! /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
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
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.
.\" 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
.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.
* 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
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,
* 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
'-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.
\1f
Tag Table:
Node: Top\7f535
-Node: Overview\7f2191
-Node: Introduction to line editing\7f4247
-Node: Invoking ed\7f11466
-Node: Line addressing\7f13267
-Node: Regular expressions\7f16344
-Node: Commands\7f21688
-Node: Limitations\7f32960
-Node: Diagnostics\7f33605
-Node: Problems\7f34306
-Node: GNU Free Documentation License\7f34839
+Node: Overview\7f2195
+Node: Introduction to line editing\7f4251
+Node: Invoking ed\7f11470
+Node: Line addressing\7f13270
+Node: Regular expressions\7f16347
+Node: Commands\7f21691
+Node: Limitations\7f32963
+Node: Diagnostics\7f33608
+Node: Problems\7f34309
+Node: GNU Free Documentation License\7f34842
\1f
End Tag Table
@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
@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
@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.
/* 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
/* 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
/* 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
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 );
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 );
/* 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
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 */
/* 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
/* 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
/* 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
#! /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.