Skip to content

Commit

Permalink
beeversion: Fix output of %X[ex] when X is not dash or underscore
Browse files Browse the repository at this point in the history
Enforce only prefixing dash or underscore chars when printing
extra{version,name} in %[-_][ex] format strings

fixes https://github.com/bee/bee/issues/207
  • Loading branch information
mariux committed Aug 24, 2016
1 parent 909fd52 commit a2426f2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/bee_version_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,21 @@ void print_format(char* s, struct beeversion *v, char *filter_pkgfullname)
if(*p == 'A' && *(v->arch))
printf(".%s", v->arch);
break;
}
if (*p) {
switch(*(p+1)) {
case '-':
case '_':
switch(*(p+1)) {
case 'x':
if (*(v->subname))
printf("%c%s", *p, v->subname);
p++;
continue;
break;
case 'e':
if (*(v->extraversion))
printf("%c%s", *p, v->extraversion);
p++;
continue;
}
break;
}
break;
}
continue;
} /* if '%' */
Expand Down Expand Up @@ -194,4 +195,3 @@ void print_format(char* s, struct beeversion *v, char *filter_pkgfullname)

} /* for *p */
}

0 comments on commit a2426f2

Please sign in to comment.