Skip to content

Commit

Permalink
Limit vim modeline salvage to header section.
Browse files Browse the repository at this point in the history
There might be legitimate usages of vim modelines in the middle of
a spec file (e.g. in inline config file sections), so best not mess
with that all over the file. Case in point:

https://build.opensuse.org/package/view_file/Apache:Modules/apache2-mod_fastcgi/apache2-mod_fastcgi.spec?expand=1
  • Loading branch information
Thorsten Behrens committed Jul 17, 2014
1 parent 7c6d1e1 commit a75f2d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prepare_spec
Expand Up @@ -267,7 +267,7 @@ sub read_and_parse_old_spec {
next;
}

if ( /^# vim:/ ) {
if ( /^# vim:/ && $current_section eq "header" ) {
$vim_modeline = $_;
next;
}
Expand Down

0 comments on commit a75f2d8

Please sign in to comment.