[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kdm/kfrontend
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2005-01-04 12:06:20
Message-ID: 20050104120620.C9C261BB6A () office ! kde ! org
[Download RAW message or body]

CVS commit by ossi: 

don't rely on . & .. being the first entries.


  M +4 -3      genkdmconf.c   1.97


--- kdebase/kdm/kfrontend/genkdmconf.c  #1.96:1.97
@@ -2580,8 +2580,9 @@ int main(int argc, char **argv)
             struct dirent *ent;
             char bn[PATH_MAX];
-            readdir (dir); /* . */
-            readdir (dir); /* .. */
             while ((ent = readdir (dir))) {
-                int l = sprintf (bn, "%s/%s", newdir, ent->d_name); /* cannot overflow (kernel would not \
allow the creation of a longer path) */ +                int l;
+                if (!strcmp (ent->d_name, ".") || !strcmp (ent->d_name, ".."))
+                    continue;
+                l = sprintf (bn, "%s/%s", newdir, ent->d_name); /* cannot overflow (kernel would not \
allow the creation of a longer path) */  if (!stat (bn, &st) && !S_ISREG (st.st_mode))
                     continue;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic