- Use of broken 'isalpha' caused 'entrée' to be parsed by Nibbler::getName
  as 'entr'.  This is part of bug #1006, but only a small part.
This commit is contained in:
Paul Beckingham
2012-06-10 16:17:09 -04:00
parent e8309fcf49
commit 9a6319a210
3 changed files with 15 additions and 9 deletions

View File

@@ -1048,12 +1048,14 @@ bool Nibbler::getName (std::string& result)
if (i < _length) if (i < _length)
{ {
if (isalpha (_input[i])) if (! isdigit (_input[i]) &&
! ispunct (_input[i]) &&
! isspace (_input[i]))
{ {
++i; ++i;
while (i < _length && while (i < _length &&
(isalpha (_input[i]) || ! ispunct (_input[i]) &&
isdigit (_input[i]))) ! isspace (_input[i]))
{ {
++i; ++i;
} }

View File

@@ -28,7 +28,7 @@
use strict; use strict;
use warnings; use warnings;
use Test::More tests => 4; use Test::More tests => 5;
# Create the rc file. # Create the rc file.
if (open my $fh, '>', 'bug.rc') if (open my $fh, '>', 'bug.rc')
@@ -51,7 +51,11 @@ unlike ($output, qr/description/ms, 'Attribute not completed in description');
$output = qx{../src/task test rc:bug.rc rc.report.test.columns:description rc.report.test.labels:__}; $output = qx{../src/task test rc:bug.rc rc.report.test.columns:description rc.report.test.labels:__};
like ($output, qr/__/ms, 'Custom column present in the output'); like ($output, qr/__/ms, 'Custom column present in the output');
### Cleanup. $output = qx{../src/task rc:bug.rc add entrée interdite};
$output = qx{../src/task rc:bug.rc list interdite};
like ($output, qr/entrée interdite/, "'entrée' left intact");
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc); unlink qw(pending.data completed.data undo.data backlog.data synch.key bug.rc);
ok (! -r 'pending.data' && ok (! -r 'pending.data' &&
! -r 'completed.data' && ! -r 'completed.data' &&

View File

@@ -39,15 +39,15 @@ int main (int argc, char** argv)
{ {
#ifdef NIBBLER_FEATURE_DATE #ifdef NIBBLER_FEATURE_DATE
#ifdef NIBBLER_FEATURE_REGEX #ifdef NIBBLER_FEATURE_REGEX
UnitTest t (385); UnitTest t (387);
#else #else
UnitTest t (361); UnitTest t (363);
#endif #endif
#else #else
#ifdef NIBBLER_FEATURE_REGEX #ifdef NIBBLER_FEATURE_REGEX
UnitTest t (335); UnitTest t (337);
#else #else
UnitTest t (311); UnitTest t (313);
#endif #endif
#endif #endif