[tuxdroid-svn] r233 - svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment va
Status: Beta
Brought to you by:
ks156
From: svnlook:warning@affinitic.be:cannot s. L. l. <c2m...@c2...> - 2007-04-09 08:56:31
|
Author: svnlook: warning: cannot set LC_CTYPE locale Date: svnlook: warning: environment variable LANG is EN New Revision: 233 Modified: daemon/trunk/main.c Log: neimad 2007-04-09 10:56:29 +0200 (Mon, 09 Apr 2007) 144 * Separate the parsing of the version string from its display. Generally not a good idea to have printing with side effects on internals ;) svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment variable LANG is EN svnlook: warning: please check that your locale name is correct Modified: daemon/trunk/main.c =================================================================== --- daemon/trunk/main.c 2007-04-09 08:51:30 UTC (rev 232) +++ daemon/trunk/main.c 2007-04-09 08:56:29 UTC (rev 233) @@ -55,9 +55,9 @@ unsigned short daemon_pid = 0; /************************************************************************ */ -/* Print_info_daemon */ +/* Setup daemon info from version string */ /************************************************************************ */ -static void print_info_daemon(void) +static void setup_daemon_info(void) { const char delimiters[] = " .-"; char cp[] = VERSION; @@ -65,15 +65,25 @@ if ((token = strtok(cp, delimiters)) != NULL) version.major = atoi(token); + if ((token = strtok(NULL, delimiters)) != NULL) version.minor = atoi(token); + if ((token = strtok(NULL, delimiters)) != NULL) version.release = atoi(token); + if ((token = strtok(NULL, delimiters)) != NULL) strncpy(version.maturity, token, sizeof(version.maturity)); + if ((token = strtok(NULL, delimiters)) != NULL) strncpy(version.release_status, token, sizeof(version.release_status)); +} +/************************************************************************ */ +/* Display daemon info on its standard output */ +/************************************************************************ */ +static void print_daemon_info(void) +{ printf("-----------------------------------\n"); printf("Tux USB Daemon version %s\n", VERSION); printf("Kysoh 2007.\n"); @@ -217,8 +227,9 @@ if (daemonized) daemonize(shell_view); - /* Print daemon informations */ - print_info_daemon(); + /* Setup & print daemon information */ + setup_daemon_info(); + print_daemon_info(); #ifdef USB_DEBUG /* Set libusb debug level */ |