the dailywtf contest in co.
::: it's nice when you get into the company and in the room everybody just finds new and new daily wtfs in codes.
yesterdays special was: strcpy(addr.sun_path, path);
if you don't get it then take a look at /usr/include/sys/un.h
::: today's best is the one with reinventing getops:
if(!strcmp(arg, "--debug-cache"))
debug_flags |= DEBUG_CACHE;
else if(!strcmp(arg, "--debug-conf"))
debug_flags |= DEBUG_CONF;
else if(!strcmp(arg, "--debug-update"))
debug_flags |= DEBUG_UPDATE;
else if(!strcmp(arg, "--debug-parsing"))
debug_flags |= DEBUG_PARSING;
else if(!strcmp(arg, "--debug-gui"))
debug_flags |= DEBUG_GUI;
else if(!strcmp(arg, "--debug-trace"))
debug_flags |= DEBUG_TRACE;
else if(!strcmp(arg, "--debug-all"))
debug_flags |= DEBUG_TRACE|DEBUG_CACHE|DEBUG_CONF|DEBUG_UPDATE|DEBUG_PARSING|DEBUG_GUI;
else if(!strcmp(arg, "--debug-verbose"))
debug_flags |= DEBUG_VERBOSE;
else if(!strcmp(arg, "--version") || !strcmp(arg, "-v")) {
g_print("liferea %s\n", VERSION);
return 0;
}
else if(!strcmp(arg, "--help") || !strcmp(arg, "-h")) {
show_help();
return 0;
}