File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -401,8 +401,9 @@ Win9x can not rename() an open file (although WinNT can).
401
401
The Cygwin chroot() implementation has holes (it can not restrict file
402
402
access by native Win32 programs).
403
403
404
- Inplace editing ( perl -i ) of files doesn't work without doing a backup
405
- of the file being edited ( perl -i.bak ).
404
+ Inplace editing C<perl -i> of files doesn't work without doing a backup
405
+ of the file being edited C<perl -i.bak> because of windowish restrictions,
406
+ so Perl does this automagically if you just use C<perl -i>.
406
407
407
408
=back
408
409
Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ Perl_nextargv(pTHX_ register GV *gv)
790
790
#endif
791
791
}
792
792
else {
793
- #if !defined(DOSISH ) && !defined(AMIGAOS ) && !defined( __CYGWIN__ )
793
+ #if !defined(DOSISH ) && !defined(AMIGAOS )
794
794
# ifndef VMS /* Don't delete; use automatic file versioning */
795
795
if (UNLINK (PL_oldname ) < 0 ) {
796
796
if (ckWARN_d (WARN_INPLACE ))
Original file line number Diff line number Diff line change @@ -2363,6 +2363,12 @@ Perl_moreswitches(pTHX_ char *s)
2363
2363
case 'i' :
2364
2364
if (PL_inplace )
2365
2365
Safefree (PL_inplace );
2366
+ #if defined(__CYGWIN__ ) /* do backup extension automagically */
2367
+ if (* (s + 1 ) == '\0' ) {
2368
+ PL_inplace = savepv (".bak" );
2369
+ return s + 1 ;
2370
+ }
2371
+ #endif /* __CYGWIN__ */
2366
2372
PL_inplace = savepv (s + 1 );
2367
2373
/*SUPPRESS 530*/
2368
2374
for (s = PL_inplace ; * s && !isSPACE (* s ); s ++ ) ;
You can’t perform that action at this time.
0 commit comments