]> git.pld-linux.org Git - packages/sed.git/commitdiff
- fix relative . dir
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 10 Nov 2008 20:37:28 +0000 (20:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    sed-follow-relfix.patch -> 1.1

sed-follow-relfix.patch [new file with mode: 0644]

diff --git a/sed-follow-relfix.patch b/sed-follow-relfix.patch
new file mode 100644 (file)
index 0000000..5f92752
--- /dev/null
@@ -0,0 +1,25 @@
+--- sed/lib/utils.c    2008-11-10 21:35:26.921679024 +0100
++++ sed/lib/utils.c    2008-11-10 21:34:45.734498611 +0100
+@@ -329,7 +329,7 @@
+ ck_follow_symlink(const char * fname)
+ {
+   static struct stat statbuf;
+-  int err;
++  int err, len;
+   char * dir;
+   static size_t bufsize = 1024;
+@@ -359,10 +359,10 @@
+           buf2 [err] = '\0';
+         /* need to handle relative paths with care */
+-        if (buf2[0] != '/')
++        dir = dirname (buf);    // dir part of orig path
++        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)
This page took 0.035003 seconds and 4 git commands to generate.