[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] Duff's Device lurking in refer.cpp
From: |
G. Branden Robinson |
Subject: |
[groff] Duff's Device lurking in refer.cpp |
Date: |
Tue, 26 Jun 2018 11:37:39 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
I enjoyed this Easter egg; maybe you will too.
src/preproc/refer/refer.cpp:
for (--argc, ++argv;
!finished_options && argc > 0 && argv[0][0] == '-'
&& argv[0][1] != '\0';
argv++, argc--) {
const char *opt = argv[0] + 1;
while (opt != 0 && *opt != '\0') {
switch (*opt) {
case 'C':
compatible_flag = 1;
opt++;
break;
// ...
case '-':
if (opt[1] == '\0') {
finished_options = 1;
opt++;
break;
}
if (strcmp(opt,"-version")==0) {
case 'v': // <-- a gibbon on the syntax tree
printf("GNU refer (groff) version %s\n", Version_string);
exit(0);
break;
}
if (strcmp(opt,"-help")==0) {
usage(stdout);
exit(0);
break;
}
// fall through
default:
error("unrecognized option '%1'", *opt);
usage(stderr);
exit(1);
break;
}
}
}
--
Regards,
Branden
signature.asc
Description: PGP signature
- [groff] Duff's Device lurking in refer.cpp,
G. Branden Robinson <=
- Re: [groff] Duff's Device lurking in refer.cpp, Steffen Nurpmeso, 2018/06/26
- Re: [groff] Duff's Device lurking in refer.cpp, Ralph Corderoy, 2018/06/27
- Re: [groff] Duff's Device lurking in refer.cpp, G. Branden Robinson, 2018/06/27
- [groff] .SY/.YS, was: Duff's Device, Ingo Schwarze, 2018/06/27
- Re: [groff] .SY/.YS, was: Duff's Device, G. Branden Robinson, 2018/06/27
- Re: [groff] .SY/.YS, was: Duff's Device, Nate Bargmann, 2018/06/27
- Re: [groff] .SY/.YS, was: Duff's Device, G. Branden Robinson, 2018/06/28