]> git.pld-linux.org Git - packages/zsh.git/commitdiff
- new
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 16 Dec 2005 08:24:00 +0000 (08:24 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    zsh-restore-histfile.patch -> 1.1

zsh-restore-histfile.patch [new file with mode: 0644]

diff --git a/zsh-restore-histfile.patch b/zsh-restore-histfile.patch
new file mode 100644 (file)
index 0000000..dd8747b
--- /dev/null
@@ -0,0 +1,21 @@
+--- zsh.org/Src/hist.c.org     2005-12-16 10:51:24.680963000 +0100
++++ zsh/Src/hist.c     2005-12-16 10:59:14.100963000 +0100
+@@ -2127,8 +2127,18 @@
+       }
+       fclose(out);
+       if (tmpfile) {
++          struct stat sb;
++          int restore = 0;
++          if (stat(unmeta(fn), &sb) == 0)
++                  restore = 1;
+           if (rename(tmpfile, unmeta(fn)) < 0)
+               zerr("can't rename %s.new to $HISTFILE", fn, 0);
++          else if (restore) {
++                  if (chown(unmeta(fn), sb.st_uid, sb.st_gid) < 0)
++                          zerr("can't restore user/group on $HISTFILE", 0);
++                  if (chmod(unmeta(fn), sb.st_mode) < 0)
++                          zerr("can't restore permissions on $HISTFILE", 0);
++          }
+           free(tmpfile);
+       }
This page took 0.175265 seconds and 4 git commands to generate.