Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in section line parsing of FeatureFile #6

Closed
tolot27 opened this issue Jun 27, 2012 · 1 comment
Closed

bug in section line parsing of FeatureFile #6

tolot27 opened this issue Jun 27, 2012 · 1 comment

Comments

@tolot27
Copy link

tolot27 commented Jun 27, 2012

About a year ago, someone posted the following problem: possible bug in regex for dsn.

Shortly: GBrowse allows regular expressions in data source name configurations as described in Using Pipes in the GBrowse.conf Data Source Name

Today I run into the same problem. I traced it back to the FeatureFile module of this project and fixed it.

@tolot27
Copy link
Author

tolot27 commented Jun 27, 2012

proposed patch:

diff --git a/lib/Bio/Graphics/FeatureFile.pm b/lib/Bio/Graphics/FeatureFile.pm
index 6ce16f3..002715f 100755
--- a/lib/Bio/Graphics/FeatureFile.pm
+++ b/lib/Bio/Graphics/FeatureFile.pm
@@ -842,7 +842,7 @@ sub _state_transition {
        return 'data'   if $line =~ /^reference\s*=/; # feature-file reference sequence directive

        return 'config' if $line =~ /^\s*$/;                             #empty line
-       return 'config' if $line =~ m/^\[([^\]]+)\]/;                    # section beginning
+       return 'config' if $line =~ m/^\[(.+)\]/;                    # section beginning
        return 'config' if $line =~ m/^[\w:\s]+=/ 
            && $self->{current_config};                                  # configuration line
        return 'config' if $line =~ m/^\s+(.+)/
@@ -870,7 +870,7 @@ sub parse_config_line {
        return 1;
     }

-    elsif (/^\[([^\]]+)\]/) {  # beginning of a configuration section
+    elsif (/^\[(.+)\]/) {  # beginning of a configuration section
        my $label = $1;
        my $cc = $label =~ /^(general|default)$/i ? 'general' : $label;  # normalize
        push @{$self->{types}},$cc unless $cc eq 'general';

@lstein lstein closed this as completed in 2e6294f Jul 3, 2013
lstein added a commit that referenced this issue Jul 3, 2013
fix bug in section line parsing of FeatureFile; fixes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant