chiark / gitweb /
@@ -4,8 +4,9 @@
[chiark-utils.git] / cprogs / summer.c
index 19c806987c18bf4d190382927acced0aa21c1e02..ada0f14830d35586401d803a442e3f56478aecec 100644 (file)
@@ -292,7 +292,6 @@ static void recurse(const char *path_or_buf) {
   static int buf_allocd;
   
   struct dirent **namelist, *const *de;
-  char *subpathp;
   const char *path_or_0= path_or_buf==buf ? 0 : path_or_buf;
   int nentries, pathl, esave, buf_want, i;
 
@@ -311,14 +310,14 @@ static void recurse(const char *path_or_buf) {
   if (path_or_0) strcpy(buf,path_or_0);
 
   buf[pathl]= '/';
-  subpathp= buf+pathl+1;
+  pathl++;
   if (nentries < 0) {
-    strcpy(subpathp,"\\?");  errno= esave;
+    strcpy(buf+pathl,"\\?");  errno= esave;
     problem_e(buf,-1,"scandir failed");
     return;
   }
   for (i=0, de=namelist; i<nentries; i++, de++) {
-    strcpy(subpathp, (*de)->d_name);
+    strcpy(buf+pathl, (*de)->d_name);
     node(buf);
     free(*de);
   }