summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGerrit P. Haase <gp@familiehaase.de>2002-06-01 06:14:43 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-01 01:16:59 +0000
commitc030f24b810c923631239a170282534aaf44e4ba (patch)
treefbc3454c343b29f9943b44fd5d5c4bb3e4a6b414 /perl.c
parent4c7fc0a422d59e20b533b9ae25dd19c2ebfb68b6 (diff)
downloadperl-c030f24b810c923631239a170282534aaf44e4ba.tar.gz
[Patch] Inplace editing on Cygwin and others?
From: "Gerrit P. Haase" <gp@familiehaase.de> Message-ID: <199100765833.20020601041443@familiehaase.de> p4raw-id: //depot/perl@16946
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index 90b227eafb..2354ce5eb3 100644
--- a/perl.c
+++ b/perl.c
@@ -2363,6 +2363,12 @@ Perl_moreswitches(pTHX_ char *s)
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++) ;