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 fa98db27c5
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'; + buf2 [err] = '\0';
+ +
+ /* need to handle relative paths with care */ + /* 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] = '/'; + buf[len] = '/';
+ strncpy (buf+len+1, buf2, bufsize - len - 1); + strncpy (buf+len+1, buf2, bufsize - len - 1);
+ if (buf[bufsize-1] != 0) + if (buf[bufsize-1] != 0)

View File

@ -6,7 +6,7 @@
Summary: A GNU stream text editor Summary: A GNU stream text editor
Name: sed Name: sed
Version: 4.1.5 Version: 4.1.5
Release: 10%{?dist} Release: 11%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/Text Group: Applications/Text
URL: http://sed.sourceforge.net/ URL: http://sed.sourceforge.net/
@ -70,6 +70,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man*/* %{_mandir}/man*/*
%changelog %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 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 4.1.5-10
- Autorebuild for GCC 4.3 - Autorebuild for GCC 4.3