[Tux4kids-commits] r352 - tuxmath/trunk/src

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Sun Dec 2 07:59:56 UTC 2007


Author: tholy-guest
Date: 2007-12-02 07:59:56 +0000 (Sun, 02 Dec 2007)
New Revision: 352

Modified:
   tuxmath/trunk/src/titlescreen.c
Log:
Slightly better error reporting for misconfigured multi-user setups.


Modified: tuxmath/trunk/src/titlescreen.c
===================================================================
--- tuxmath/trunk/src/titlescreen.c	2007-12-02 07:34:35 UTC (rev 351)
+++ tuxmath/trunk/src/titlescreen.c	2007-12-02 07:59:56 UTC (rev 352)
@@ -934,6 +934,8 @@
   char *trailer_quit = "Quit";
   char *trailer_back = "Back";
 
+  DIR *dir;
+
   // Check for & read user_login_questions file
   n_login_questions = read_user_login_questions(&user_login_questions);
 
@@ -972,6 +974,13 @@
       // User chose an entry, set it up
       strcat(user_home,user_names[chosen_login]);
       strcat(user_home,"/");
+      dir = opendir(user_home);
+      if (dir == NULL) {
+	printf("Directory cannot be opened, there is a configuration error\n");
+	// We can continue anyway, and tuxmath will simply be going in
+	// no-save mode. It will bail and go straight to the main menu
+	// next.
+      }
       level++;
       menu_opts.starting_entry = 0;
     }




More information about the Tux4kids-commits mailing list