3 --- dos2unix-3.1/dos2unix.c
4 +++ dos2unix-3.1/dos2unix.c
5 @@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN
8 struct utimbuf UTimeBuf;
9 + mode_t mode = S_IRUSR | S_IWUSR;
12 /* retrieve ipInFN file date stamp */
13 - if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
14 + if (stat(ipInFN, &StatBuf))
17 + mode = StatBuf.st_mode;
19 strcpy (TempPath, "./u2dtmpXXXXXX");
20 if((fd=mkstemp (TempPath))<0) {
21 @@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN
25 + if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
29 fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);