Code

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 24 Nov 2010 21:24:49 +0000 (13:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Nov 2010 21:24:49 +0000 (13:24 -0800)
* maint:
  imap-send: link against libcrypto for HMAC and others
  git-send-email.perl: Deduplicate "to:" and "cc:" entries with names
  mingw: do not set errno to 0 on success

1  2 
Makefile
compat/mingw.c
git-send-email.perl

diff --cc Makefile
Simple merge
diff --cc compat/mingw.c
index 29f403649f0e3c6d4240fc93e6fa1787a017b9ea,b98e6000062134f01a0611fb17a3fd43250f7989..fdbf093f6eb704ec0ca0e5abf6baf1f94350676b
@@@ -192,15 -192,13 +192,16 @@@ static inline time_t filetime_to_time_t
  /* We keep the do_lstat code in a separate function to avoid recursion.
   * When a path ends with a slash, the stat will fail with ENOENT. In
   * this case, we strip the trailing slashes and stat again.
 + *
 + * If follow is true then act like stat() and report on the link
 + * target. Otherwise report on the link itself.
   */
 -static int do_lstat(const char *file_name, struct stat *buf)
 +static int do_lstat(int follow, const char *file_name, struct stat *buf)
  {
+       int err;
        WIN32_FILE_ATTRIBUTE_DATA fdata;
  
-       if (!(errno = get_file_attr(file_name, &fdata))) {
+       if (!(err = get_file_attr(file_name, &fdata))) {
                buf->st_ino = 0;
                buf->st_gid = 0;
                buf->st_uid = 0;
                buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
                buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
                buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
 +              if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
 +                      WIN32_FIND_DATAA findbuf;
 +                      HANDLE handle = FindFirstFileA(file_name, &findbuf);
 +                      if (handle != INVALID_HANDLE_VALUE) {
 +                              if ((findbuf.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
 +                                              (findbuf.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) {
 +                                      if (follow) {
 +                                              char buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
 +                                              buf->st_size = readlink(file_name, buffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
 +                                      } else {
 +                                              buf->st_mode = S_IFLNK;
 +                                      }
 +                                      buf->st_mode |= S_IREAD;
 +                                      if (!(findbuf.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
 +                                              buf->st_mode |= S_IWRITE;
 +                              }
 +                              FindClose(handle);
 +                      }
 +              }
                return 0;
        }
+       errno = err;
        return -1;
  }
  
Simple merge