missed the new file from #18224
[p5sagit/p5-mst-13.2.git] / util.c
diff --git a/util.c b/util.c
index dde2994..9a97a6b 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2172,6 +2172,11 @@ dup2(int oldfd, int newfd)
 #ifndef PERL_MICRO
 #ifdef HAS_SIGACTION
 
+#ifdef MACOS_TRADITIONAL
+/* We don't want restart behavior on MacOS */
+#undef SA_RESTART
+#endif
+
 Sighandler_t
 Perl_rsignal(pTHX_ int signo, Sighandler_t handler)
 {
@@ -3704,6 +3709,7 @@ is a beta version).
 char *
 Perl_scan_version(pTHX_ char *s, SV *rv)
 {
+    const char *start = s;
     char *pos = s;
     I32 saw_period = 0;
     bool saw_under = 0;
@@ -3743,7 +3749,7 @@ Perl_scan_version(pTHX_ char *s, SV *rv)
                /* this is atoi() that delimits on underscores */
                char *end = pos;
                I32 mult = 1;
-               if ( s < pos && *(s-1) == '_' ) {
+               if ( s < pos && s > start && *(s-1) == '_' ) {
                    if ( *s == '0' && *(s+1) != '0')
                        mult = 10;      /* perl-style */
                    else