diff src/xs_stil.c @ 232:e613873c3379

Thread locking now final. All parts, including GTK GUI, should be(?) properly locked and no race conditions should be present.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Dec 2004 13:13:05 +0000
parents 608f31f6c095
children f436e16fa6d9
line wrap: on
line diff
--- a/src/xs_stil.c	Tue Dec 21 13:12:04 2004 +0000
+++ b/src/xs_stil.c	Tue Dec 21 13:13:05 2004 +0000
@@ -457,23 +457,27 @@
  XS_MUTEX_LOCK(xs_stildb_db);
  XS_MUTEX_LOCK(xs_cfg);
 
- if (xs_cfg.hvscPath)
+ if (xs_cfg.stilDBEnable && xs_stildb_db)
  	{
- 	/* Remove postfixed directory separator from HVSC-path */
- 	tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/');
- 	if (tmpFilename && (tmpFilename[1] == 0))
- 		tmpFilename[0] = 0;
+	if (xs_cfg.hvscPath)
+ 		{
+ 		/* Remove postfixed directory separator from HVSC-path */
+ 		tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/');
+ 		if (tmpFilename && (tmpFilename[1] == 0))
+ 			tmpFilename[0] = 0;
  
-	/* Remove HVSC location-prefix from filename */
-	tmpFilename = strstr(pcFilename, xs_cfg.hvscPath);
-	if (tmpFilename)
-		tmpFilename += strlen(xs_cfg.hvscPath);
-		else
-		tmpFilename = pcFilename; 
+		/* Remove HVSC location-prefix from filename */
+		tmpFilename = strstr(pcFilename, xs_cfg.hvscPath);
+		if (tmpFilename)
+			tmpFilename += strlen(xs_cfg.hvscPath);
+			else
+			tmpFilename = pcFilename; 
+		} else
+		tmpFilename = pcFilename;
+	
+	pResult = xs_stildb_get_node(xs_stildb_db, tmpFilename);
 	} else
-	tmpFilename = pcFilename;
-	
- pResult = xs_stildb_get_node(xs_stildb_db, tmpFilename);
+	pResult = NULL;
 
  XS_MUTEX_UNLOCK(xs_stildb_db);
  XS_MUTEX_UNLOCK(xs_cfg);