Mail Archives: djgpp-workers/2002/03/02/11:20:14
Here are two patches for Fileutils, to correct the following two
problems:
- ginstall would crash when invoked to install a file with no
extension (such as a shell script);
- "cp -Pp" would print an error message on filesystems that don't
allow setting timestamps of directories.
HTH
2002-03-02 Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
* src/cp.c (re_protect) [MSDOS]: Don't print an error message if
utime fails.
* src/install.c (install_file_in_file) [__DJGPP__]: Don't compute
to_dot (it's unused), and don't pass from_dot to STREQ unless it
is non-NULL.
--- src/cp.c~0 Sat Sep 19 17:09:22 1998
+++ src/cp.c Sat Mar 2 17:52:26 2002
@@ -242,8 +242,12 @@ re_protect (const char *const_dst_path,
if (utime (dst_path, &utb))
{
+#ifndef MSDOS
+ /* MS-DOS doesn't allow to change timestamp of a
+ directory. */
error (0, errno, _("preserving times for %s"), dst_path);
return 1;
+#endif
}
}
--- src/install.c~0 Sun May 27 11:42:22 2001
+++ src/install.c Sat Mar 2 17:07:18 2002
@@ -454,11 +454,11 @@ install_file_in_file (const char *from,
#ifdef __DJGPP__
static char STUBIFY[] = "stubify.exe";
char *from_dot = strrchr(from, '.');
- char *to_dot = strrchr(to, '.');
/* DJGPP executables need to be stubbed and to have a valid executable file
* extension, to be executable by some DOS shells (e.g. COMMAND.COM). */
- if (!STREQ (from_dot, ".exe") && !STREQ (from_dot, ".com"))
+ if (!(from_dot
+ && (STREQ (from_dot, ".exe") || STREQ (from_dot, ".com"))))
{
char *new_from, *new_to;
const _v2_prog_type *file_type;
- Raw text -