Index: avatar_selection.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/avatar_selection/avatar_selection.module,v
retrieving revision 1.1.2.22.2.25
diff -u -r1.1.2.22.2.25 avatar_selection.module
--- avatar_selection.module 7 Apr 2008 12:39:38 -0000 1.1.2.22.2.25
+++ avatar_selection.module 7 Apr 2008 13:18:00 -0000
@@ -447,7 +447,8 @@

   // Remove ones already in use if necessary.
   if (!empty($user) && variable_get('avatar_selection_distinctive_avatars', FALSE)) {
-    $result = db_query("SELECT DISTINCT avs.avatar FROM {avatar_selection} avs LEFT JOIN {users} u ON u.picture = avs.avatar WHERE u.picture IS NOT NULL AND u.uid <> %d", $user->uid);
+    $dir = file_create_path('avatar_selection');
+    $result = db_query("SELECT DISTINCT avs.avatar FROM {avatar_selection} avs LEFT JOIN {users} u ON u.picture = concat('%s/', avs.avatar) WHERE u.picture IS NOT NULL AND u.uid <> %d", $dir, $user->uid);
     while ($avatar = db_fetch_object($result)) {
       $avs_image = $avatar->avatar;
       unset($avatars[$avs_image]);
