Merge remote-tracking branch 'upstream/master' into xft-port

* upstream/master:
  Conform to coding standard and errors
  Fixed font selection
This commit is contained in:
krypt-n
2015-07-23 21:05:21 +02:00
2 changed files with 16 additions and 7 deletions

View File

@@ -641,13 +641,22 @@ parse (char *text)
break;
case 'T':
font_index = (int)strtoul(p, &ep, 10);
// User-specified 'font_index' ∊ (0,font_count]
// Otherwise just fallback to the automatic font selection
if (!font_index || font_index > font_count)
if (*p == '-') { //Reset to automatic font selection
font_index = -1;
p = ep;
break;
p++;
break;
} else if (isdigit(*p)) {
font_index = (int)strtoul(p, &ep, 10);
// User-specified 'font_index' ∊ (0,font_count]
// Otherwise just fallback to the automatic font selection
if (!font_index || font_index > font_count)
font_index = -1;
p = ep;
break;
} else {
fprintf(stderr, "Invalid font slot \"%c\"\n", *p++); //Swallow the token
break;
}
// In case of error keep parsing after the closing }
default: