File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ pcre2.h failed to compile.
13132. To catch similar issues to the above in future, a new small test program
1414that includes pcre2posix.h but not pcre2.h has been added to the test suite.
1515
16+ 3. When the -S option of pcre2test was used to set a stack size greater than
17+ the allowed maximum, the error message displayed the hard limit incorrectly.
18+ This was pointed out on GitHub pull request #171, but the suggested patch
19+ didn't cope with all cases. Some further modification was required.
20+
1621
1722Version 10.41 06-December-2022
1823------------------------------
Original file line number Diff line number Diff line change @@ -9002,9 +9002,13 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0)
90029002 if (rlim .rlim_cur > rlim .rlim_max )
90039003 {
90049004 fprintf (stderr ,
9005- "pcre2test: requested stack size %luMiB is greater than hard limit "
9006- "%luMiB\n" , (unsigned long int )stack_size ,
9007- (unsigned long int )(rlim .rlim_max / (1024 * 1024 )));
9005+ "pcre2test: requested stack size %luMiB is greater than hard limit " ,
9006+ (unsigned long int )stack_size );
9007+ if (rlim .rlim_max % (1024 * 1024 ) == 0 ) fprintf (stderr , "%luMiB\n" ,
9008+ (unsigned long int )(rlim .rlim_max /(1024 * 1024 )));
9009+ else if (rlim .rlim_max % 1024 == 0 ) fprintf (stderr , "%luKiB\n" ,
9010+ (unsigned long int )(rlim .rlim_max /1024 ));
9011+ else fprintf (stderr , "%lu bytes\n" , (unsigned long int )(rlim .rlim_max ));
90089012 exit (1 );
90099013 }
90109014 rc = setrlimit (RLIMIT_STACK , & rlim );
You can’t perform that action at this time.
0 commit comments