Unified · Split
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <ctype.h> | ||
| 2 | |||
| 1 | static void | 3 | static void |
| 2 | printusage(Otfile *f) | 4 | printusage(Otfile *f) |
| 3 | { | 5 | { |
| @@ -185,7 +187,7 @@ glypherr: · 181 unmodified lines | |||
| 185 | highlight = strtol(EARGF(usage(&out)), nil, 0); \ | 187 | highlight = strtol(EARGF(usage(&out)), nil, 0); \ |
| 186 | break; \ | 188 | break; \ |
| 187 | case 'i': \ | 189 | case 'i': \ |
| 188 | if(rune != Runeerror){ \ | 190 | if(rune != NoRune){ \ |
| 189 | errboth: \ | 191 | errboth: \ |
| 190 | out.print(out.aux, "can't specify both rune and glyph\n"); \ | 192 | out.print(out.aux, "can't specify both rune and glyph\n"); \ |
| 191 | usage(&out); \ | 193 | usage(&out); \ |
| @@ -198,14 +200,17 @@ errboth: \ · 6 unmodified lines | |||
| 198 | case 'p': \ | 200 | case 'p': \ |
| 199 | ppem = strtod(EARGF(usage(&out)), nil); \ | 201 | ppem = strtod(EARGF(usage(&out)), nil); \ |
| 200 | break; \ | 202 | break; \ |
| 201 | case 'r': \ | 203 | case 'r': { \ |
| 204 | char *s = EARGF(usage(&out)); \ | ||
| 202 | if(gind >= 0) \ | 205 | if(gind >= 0) \ |
| 203 | goto errboth; \ | 206 | goto errboth; \ |
| 204 | if(chartorune(&rune, EARGF(usage(&out))) == 1 && rune == Runeerror){ \ | 207 | if(isdigit(*s) && strlen(s) > 1) \ |
| 208 | rune = strtol(s, nil, 0); \ | ||
| 209 | else if(chartorune(&rune, s) == 1 && rune == Runeerror){ \ | ||
| 205 | out.print(out.aux, "invalid rune\n"); \ | 210 | out.print(out.aux, "invalid rune\n"); \ |
| 206 | usage(&out); \ | 211 | usage(&out); \ |
| 207 | } \ | 212 | } \ |
| 208 | break; \ | 213 | } break; \ |
| 209 | case 'R': \ | 214 | case 'R': \ |
| 210 | runesonly++; \ | 215 | runesonly++; \ |
| 211 | break; \ | 216 | break; \ |