Skip to content

Commit

Permalink
get_version: move version regex initialization outside of file looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Harder committed Jan 20, 2016
1 parent c096b48 commit d425fef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion get_version.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function version = get_version()
version = '';
version_regex = '%\s*version: (\S+)';

% extract version info from main application header
fid = fopen('AD9361_Filter_Wizard.m');
line = fgets(fid);
while strcmp(version, '') && ischar(line)
version_regex = '%\s*version: (\S+)';
[tokens, match] = regexpi(line, version_regex, 'tokens', 'match');
if ~isempty(match)
version = tokens{1}{1};
Expand Down

0 comments on commit d425fef

Please sign in to comment.