ed: updated to 0.3

This commit is contained in:
Tilman Sauerbeck 2006-11-12 11:13:42 +01:00
parent 1b9874f223
commit b5ad99aa2e
3 changed files with 13 additions and 60 deletions

View File

@ -1,2 +1 @@
869cc429fd71bcb5ab0b316c36863020 ed-0.2.patch
ddd57463774cae9b50e70cd51221281b ed-0.2.tar.gz
56950c74e0239556296310a01c83ae7d ed-0.3.tar.bz2

View File

@ -3,16 +3,21 @@
# Maintainer: Per Lidén, core-ports at crux dot nu
name=ed
version=0.2
release=2
source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz $name-$version.patch)
version=0.3
release=1
source=(ftp://ftp.gnu.org/gnu/$name/$name-$version.tar.bz2)
build() {
cd $name-$version
patch -p1 < ../$name-$version.patch
./configure --prefix=/usr
# ed wants to use hard links for the binary and man pages,
# but pkgmk cannot compress hard linked man pages yet.
# as a temporary workaround, i'm making it use symlinks instead.
sed -i -e 's/ln /ln -s /' Makefile.in
./configure --prefix=/usr --mandir=/usr/man
make
make prefix=$PKG/usr install
make DESTDIR=$PKG install install-man
mv $PKG/usr/bin $PKG
rm -rf $PKG/usr/info
rm -rf $PKG/usr/share
}

View File

@ -1,51 +0,0 @@
--- ed-0.2/buf.c.chmou Sat Nov 19 13:37:59 1994
+++ ed-0.2/buf.c Mon Nov 27 11:46:54 2000
@@ -194,21 +194,17 @@
extern int newline_added;
-char sfn[15] = ""; /* scratch file name */
-
/* open_sbuf: open scratch file */
int
open_sbuf ()
{
- char *mktemp ();
int u;
isbinary = newline_added = 0;
u = umask(077);
- strcpy (sfn, "/tmp/ed.XXXXXX");
- if (mktemp (sfn) == NULL || (sfp = fopen (sfn, "w+")) == NULL)
+ if ((sfp = tmpfile()) == NULL)
{
- fprintf (stderr, "%s: %s\n", sfn, strerror (errno));
+ fprintf (stderr, "%s\n", strerror (errno));
sprintf (errmsg, "Cannot open temp file");
umask(u);
return ERR;
@@ -226,14 +222,14 @@
{
if (fclose (sfp) < 0)
{
- fprintf (stderr, "%s: %s\n", sfn, strerror (errno));
+ fprintf (stderr, "Cannot close temp file: %s\n", strerror (errno));
sprintf (errmsg, "Cannot close temp file");
return ERR;
}
sfp = NULL;
- unlink (sfn);
}
sfseek = seek_write = 0;
+
return 0;
}
@@ -246,7 +242,6 @@
if (sfp)
{
fclose (sfp);
- unlink (sfn);
}
exit (n);
}