Gerrit P. Haase [Sat, 1 Jun 2002 04:14:43 +0000 (06:14 +0200)]
From: "Gerrit P. Haase" <gp@familiehaase.de>
Message-ID: <
199100765833.20020601041443@familiehaase.de>
p4raw-id: //depot/perl@16946
The Cygwin chroot() implementation has holes (it can not restrict file
access by native Win32 programs).
-Inplace editing ( perl -i ) of files doesn't work without doing a backup
-of the file being edited ( perl -i.bak ).
+Inplace editing C<perl -i> of files doesn't work without doing a backup
+of the file being edited C<perl -i.bak> because of windowish restrictions,
+so Perl does this automagically if you just use C<perl -i>.
=back
#endif
}
else {
-#if !defined(DOSISH) && !defined(AMIGAOS) && !defined(__CYGWIN__)
+#if !defined(DOSISH) && !defined(AMIGAOS)
# ifndef VMS /* Don't delete; use automatic file versioning */
if (UNLINK(PL_oldname) < 0) {
if (ckWARN_d(WARN_INPLACE))
case 'i':
if (PL_inplace)
Safefree(PL_inplace);
+#if defined(__CYGWIN__) /* do backup extension automagically */
+ if (*(s+1) == '\0') {
+ PL_inplace = savepv(".bak");
+ return s+1;
+ }
+#endif /* __CYGWIN__ */
PL_inplace = savepv(s+1);
/*SUPPRESS 530*/
for (s = PL_inplace; *s && !isSPACE(*s); s++) ;