improved follow.patch to better handle symlinks.

This commit is contained in:
Jiří Moskovčák 2008-11-13 16:39:42 +00:00
parent d0acf9f5b4
commit 5223f1f19a
2 changed files with 8 additions and 4 deletions

View File

@ -71,10 +71,10 @@ diff -Burp sed-4.1.5-orig/lib/utils.c sed-4.1.5-follow/lib/utils.c
+ buf2 [err] = '\0';
+
+ /* need to handle relative paths with care */
+ if (buf2[0] != '/')
+ dir = dirname (buf); // dir part of orig path
+ int len = strlen (dir); // orig path len
+ if (buf2[0] != '/' && len != 1 && dir[0] != '.')
+ {
+ dir = dirname (buf); // dir part of orig path
+ int len = strlen (dir); // orig path len
+ buf[len] = '/';
+ strncpy (buf+len+1, buf2, bufsize - len - 1);
+ if (buf[bufsize-1] != 0)

View File

@ -6,7 +6,7 @@
Summary: A GNU stream text editor
Name: sed
Version: 4.1.5
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv2+
Group: Applications/Text
URL: http://sed.sourceforge.net/
@ -70,6 +70,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man*/*
%changelog
* Thu Nov 13 2008 Jiri Moskovcak <jmoskovc@redhat.com> 4.1.5-11
- improved follow.patch (thanks to Arkadiusz Miskiewicz for initial patch)
- Resolves: #470912
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 4.1.5-10
- Autorebuild for GCC 4.3