in new code for NLST, forgot to send \r\n in ASCII mode instead
authorRick Adams <rick@ucbvax.Berkeley.EDU>
Mon, 29 May 1989 11:44:24 +0000 (03:44 -0800)
committerRick Adams <rick@ucbvax.Berkeley.EDU>
Mon, 29 May 1989 11:44:24 +0000 (03:44 -0800)
of just \n

SCCS-vsn: libexec/ftpd/ftpd.c 5.30

usr/src/libexec/ftpd/ftpd.c

index a786b54..e30621c 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ftpd.c     5.29    (Berkeley) %G%";
+static char sccsid[] = "@(#)ftpd.c     5.30    (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -1288,7 +1288,8 @@ send_file_list(whichfiles)
                                        return;
                                transflag++;
                        }
                                        return;
                                transflag++;
                        }
-                       fprintf(dout, "%s\n", dirname);
+                       fprintf(dout, "%s%s\n", dirname,
+                               type == TYPE_A ? "\r" : "");
                        byte_count += strlen(dirname) + 1;
                        continue;
                } else if ((st.st_mode&S_IFMT) != S_IFDIR)
                        byte_count += strlen(dirname) + 1;
                        continue;
                } else if ((st.st_mode&S_IFMT) != S_IFDIR)
@@ -1322,9 +1323,11 @@ send_file_list(whichfiles)
                                        transflag++;
                                }
                                if (nbuf[0] == '.' && nbuf[1] == '/')
                                        transflag++;
                                }
                                if (nbuf[0] == '.' && nbuf[1] == '/')
-                                       fprintf(dout, "%s\n", &nbuf[2]);
+                                       fprintf(dout, "%s%s\n", &nbuf[2],
+                                               type == TYPE_A ? "\r" : "");
                                else
                                else
-                                       fprintf(dout, "%s\n", nbuf);
+                                       fprintf(dout, "%s%s\n", nbuf,
+                                               type == TYPE_A ? "\r" : "");
                                byte_count += strlen(nbuf) + 1;
                        }
                }
                                byte_count += strlen(nbuf) + 1;
                        }
                }