v20i042: MIT Athena delete/undelete programs, Patch14

Jonathan I. Kamens jik at Athena.MIT.EDU
Thu Jun 6 04:38:21 AEST 1991


Submitted-by: Jonathan I. Kamens <jik at Athena.MIT.EDU>
Posting-number: Volume 20, Issue 42
Archive-name: delete/patch14
Patch-To: delete: Volume 17, Issue 23-26,37

This patch brings the "delete" package from patchlevel 13 to
patchlevel 14.  Use "patch -p0" in your delete source directory to
apply it.  Several files will change, and one new file (malloc-test.c)
will be created.

  This patch accomplishes the following:

1. Lsdel now checks if stdout is a tty; if it is, then output is in
   multi-column format, and if it is not, then output is in
   single-column format.

2. The "-1" and "-C" options have been added to lsdel to allow the
   user to force single-column or multi-colun output, regardless of
   whether or not stdout is a tty.

3. Lsdel now sorts its output.

4. There is better support for machines on which malloc(0) returns
   NULL, and a Makefile rule to test if your machine falls in that
   category.  See the Makefile for more information.

5. There is some fledgling support for dirent instead of direct,
   toggled by the POSIX preprocessor symbol.

6. The Makefile now makes sure to run block-test.sh in the current
   working directory, so "make block-test" will work even if you don't
   have "." in your search path.

7. A missing newline in a message printed by block-test.sh has been
   inserted.

8. Block-test will now do the right thing on machines that have
   fundamental block sizes larger than 512 bytes but still record
   st_blocks in 512 byte increments, as long as the fundamental block
   size is smaller than 4096 bytes (if you work on machine with a
   larger one, please let me know).

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710

*** /tmp/,RCSt1021382	Tue Jun  4 22:31:27 1991
--- Makefile	Tue Jun  4 22:17:43 1991
***************
*** 5,11 ****
  #
  #     $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v 1.30 91/03/11 18:40:59 jik Exp $
  #
  
  # If you are compiling on a system that has an st_blocks field in
--- 5,11 ----
  #
  #     $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v 1.32 91/06/04 22:17:28 jik Exp $
  #
  
  # If you are compiling on a system that has an st_blocks field in
***************
*** 13,18 ****
--- 13,22 ----
  # blocks taken up by the file, add -DUSE_BLOCKS to the DEFINES
  # variable below.  If you don't know whether or not to define it, run
  # "make block-test".
+ # 
+ # If you are using a system where malloc(0) returns 0 even when it
+ # succeeds, then set MALLOC below to -DMALLOC_0_RETURNS_NULL.  If you
+ # don't know whether or not to define it, run "make malloc-test".
  
  DESTDIR=
  TARGETS= 	delete undelete expunge purge lsdel
***************
*** 24,30 ****
  DEPEND=		/usr/bin/X11/makedepend
  COMPILE_ET= 	compile_et
  LINT= 		lint
! DEFINES=	
  
  
  # These variables apply only if you want this program to recognize
--- 28,35 ----
  DEPEND=		/usr/bin/X11/makedepend
  COMPILE_ET= 	compile_et
  LINT= 		lint
! MALLOC=
! DEFINES=	$(MALLOC)
  
  
  # These variables apply only if you want this program to recognize
***************
*** 79,85 ****
  		man1/undelete.1
  
  ARCHIVE=	README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
! 		$(ETSRCS) block-test.sh
  ARCHIVEDIRS= 	man1
  
  DELETEOBJS= 	delete.o util.o delete_errs.o errors.o
--- 84,90 ----
  		man1/undelete.1
  
  ARCHIVE=	README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
! 		$(ETSRCS) block-test.sh malloc-test.c
  ARCHIVEDIRS= 	man1
  
  DELETEOBJS= 	delete.o util.o delete_errs.o errors.o
***************
*** 191,197 ****
  	$(DEPEND) -v $(CFLAGS) -s'# DO NOT DELETE' $(SRCS)
  
  block-test: block-test.sh
! 	CC=$(CC); TMPDIR=$(TMPDIR); export CC TMPDIR; . block-test.sh
  
  $(DELETEOBJS): delete_errs.h
  $(EXPUNGEOBJS): delete_errs.h
--- 196,207 ----
  	$(DEPEND) -v $(CFLAGS) -s'# DO NOT DELETE' $(SRCS)
  
  block-test: block-test.sh
! 	CC=$(CC); TMPDIR=$(TMPDIR); export CC TMPDIR; . ./block-test.sh
! 
! malloc-test: malloc-test.c
! 	@$(CC) -o malloc-test malloc-test.c
! 	@./malloc-test
! 	@rm malloc-test
  
  $(DELETEOBJS): delete_errs.h
  $(EXPUNGEOBJS): delete_errs.h
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:29 1991
--- PATCHLEVEL	Tue Jun  4 22:29:44 1991
***************
*** 1 ****
! 13
--- 1 ----
! 14
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:31 1991
--- delete.c	Tue Jun  4 22:07:01 1991
***************
*** 11,22 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.c,v 1.25 91/02/28 18:42:16 jik Exp $";
  #endif
  
  #include <sys/types.h>
  #include <stdio.h>
  #include <sys/dir.h>
  #ifdef SYSV
  #include <string.h>
  #define index strchr
--- 11,27 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.c,v 1.26 91/06/04 22:06:55 jik Exp $";
  #endif
  
  #include <sys/types.h>
  #include <stdio.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #ifdef SYSV
  #include <string.h>
  #define index strchr
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:33 1991
--- undelete.c	Tue Jun  4 22:07:34 1991
***************
*** 11,22 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.c,v 1.23 91/02/28 18:44:00 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
--- 11,27 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.c,v 1.24 91/06/04 22:07:21 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
***************
*** 267,273 ****
       int retval;
       
       filelist = (listrec *) Malloc((unsigned) (sizeof(listrec) * num));
!      if (! filelist) {
  	  set_error(errno);
  	  error("process_files");
  	  return error_code;
--- 272,283 ----
       int retval;
       
       filelist = (listrec *) Malloc((unsigned) (sizeof(listrec) * num));
! #ifdef MALLOC_0_RETURNS_NULL
!      if ((! filelist) && num)
! #else
!      if (! filelist)
! #endif
!      {
  	  set_error(errno);
  	  error("process_files");
  	  return error_code;
***************
*** 486,492 ****
       *number -= offset;
       files = (listrec *) realloc((char *) files,
  				 (unsigned) (sizeof(listrec) * *number));
!      if (! files) {
  	  set_error(errno);
  	  error("realloc");
  	  return errno;
--- 496,507 ----
       *number -= offset;
       files = (listrec *) realloc((char *) files,
  				 (unsigned) (sizeof(listrec) * *number));
! #ifdef MALLOC_0_RETURNS_NULL
!      if ((! files) && *number)
! #else
!      if (! files)
! #endif
!      {
  	  set_error(errno);
  	  error("realloc");
  	  return errno;
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:35 1991
--- directories.c	Tue Jun  4 22:08:21 1991
***************
*** 11,23 ****
   */
  
  #if !defined(lint) && !defined(SABER)
!      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.c,v 1.20 91/03/11 18:42:56 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/param.h>
  #include <sys/dir.h>
  #ifdef SYSV
  #include <string.h>
  #define index strchr
--- 11,28 ----
   */
  
  #if !defined(lint) && !defined(SABER)
!      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.c,v 1.21 91/06/04 22:08:14 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/param.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #ifdef SYSV
  #include <string.h>
  #define index strchr
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:38 1991
--- pattern.c	Tue Jun  4 22:06:23 1991
***************
*** 11,22 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.c,v 1.22 91/02/28 18:43:11 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
--- 11,27 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.c,v 1.23 91/06/04 22:06:14 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
***************
*** 57,63 ****
       
       *array1 = (char **) realloc((char *) *array1, (unsigned)
  				 (sizeof(char *) * (*num1 + *num2)));
!      if (! *array1) {
  	  set_error(errno);
  	  error("realloc");
  	  return error_code;
--- 62,73 ----
       
       *array1 = (char **) realloc((char *) *array1, (unsigned)
  				 (sizeof(char *) * (*num1 + *num2)));
! #ifdef MALLOC_0_RETURNS_NULL
!      if ((! *array1) && (*num1 + *num2))
! #else
!      if (! *array1)
! #endif
!      {
  	  set_error(errno);
  	  error("realloc");
  	  return error_code;
***************
*** 227,237 ****
--- 237,249 ----
       
       if (options & RECURS) {
  	  return_files = (char **) Malloc(0);
+ #ifndef MALLOC_0_RETURNS_NULL
  	  if (! return_files) {
  	       set_error(errno);
  	       error("Malloc");
  	       return error_code;
  	  }
+ #endif
  	  num_return_files = 0;
  
  	  for (i = 0; i < num_matched_files; i++) {
***************
*** 435,440 ****
--- 447,453 ----
  	  *base = '\0';
  
       *found = (char **) Malloc(0);
+ #ifndef MALLOC_0_RETURNS_NULL
       if (! *found) {
  	  set_error(errno);
  	  error("Malloc");
***************
*** 443,448 ****
--- 456,462 ----
  #endif
  	  return error_code;
       }
+ #endif
       *num_found = 0;
       
       dirp = Opendir(base);
***************
*** 743,753 ****
--- 757,769 ----
       /* start: */
       
       *found = (char **) Malloc(0);
+ #ifndef MALLOC_0_RETURNS_NULL
       if (! *found) {
  	  set_error(errno);
  	  error("Malloc");
  	  return error_code;
       }
+ #endif
       *num_found = 0;
       strcpy(base, name);
  
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:41 1991
--- util.c	Tue Jun  4 22:06:43 1991
***************
*** 11,17 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.c,v 1.22 91/02/28 18:44:11 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 11,17 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.c,v 1.23 91/06/04 22:06:34 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 20,26 ****
--- 20,31 ----
  #ifdef SYSV /* SYSV doesn't define uid_t */
  typedef unsigned short uid_t;
  #endif
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #ifdef SYSV
  #include <string.h>
  #define index strchr
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:43 1991
--- expunge.c	Tue Jun  4 22:07:51 1991
***************
*** 11,23 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.c,v 1.19 91/03/11 18:43:51 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/dir.h>
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
--- 11,28 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.c,v 1.20 91/06/04 22:07:43 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/time.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:45 1991
--- lsdel.c	Tue Jun  4 22:08:42 1991
***************
*** 11,22 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.c,v 1.16 91/03/11 18:43:29 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/dir.h>
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
--- 11,27 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.c,v 1.19 91/06/04 22:08:30 jik Exp $";
  #endif
  
  #include <stdio.h>
  #include <sys/types.h>
+ #ifdef POSIX
+ #include <dirent.h>
+ #define direct dirent
+ #else
  #include <sys/dir.h>
+ #endif
  #include <sys/param.h>
  #ifdef SYSV
  #include <string.h>
***************
*** 45,51 ****
  extern int errno;
  
  int space_total = 0;
! int dirsonly, recursive, yield, f_links, f_mounts;
  time_t timev;
  
  main(argc, argv)
--- 50,56 ----
  extern int errno;
  
  int space_total = 0;
! int dirsonly, recursive, yield, f_links, f_mounts, singlecolumn;
  time_t timev;
  
  main(argc, argv)
***************
*** 59,66 ****
       whoami = lastpart(argv[0]);
  
       dirsonly = recursive = timev = yield = f_links = f_mounts = 0;
!      while ((arg = getopt(argc, argv, "drt:ysm")) != -1) {
  	  switch (arg) {
  	  case 'd':
  	       dirsonly++;
  	       break;
--- 64,92 ----
       whoami = lastpart(argv[0]);
  
       dirsonly = recursive = timev = yield = f_links = f_mounts = 0;
!      singlecolumn = -1;
!      while ((arg = getopt(argc, argv, "1Cdrt:ysm")) != -1) {
  	  switch (arg) {
+ 	  case '1':
+ 	       if ((singlecolumn != -1) && (! singlecolumn)) {
+ 		    fprintf(stderr,
+ 			    "%s: -1 and -C options are mutually exclusive\n",
+ 			    whoami);
+ 		    usage();
+ 		    exit(1);
+ 	       }
+ 	       singlecolumn = 1;
+ 	       break;
+ 	  case 'C':
+ 	       if ((singlecolumn != -1) && singlecolumn) {
+ 		    fprintf(stderr,
+ 			    "%s: -1 and -C options are mutually exclusive\n",
+ 			    whoami);
+ 		    usage();
+ 		    exit(1);
+ 	       }
+ 	       singlecolumn = 0;
+ 	       break;
  	  case 'd':
  	       dirsonly++;
  	       break;
***************
*** 84,89 ****
--- 110,118 ----
  	       exit(1);
  	  }
       }
+      if (singlecolumn == -1)
+ 	  singlecolumn = ! isatty(1);
+ 
       if (optind == argc) {
  	  char *cwd;
  
***************
*** 113,118 ****
--- 142,150 ----
       fprintf(stderr, "     -y     report total space taken up by files\n");
       fprintf(stderr, "     -s     follow symbolic links to directories\n");
       fprintf(stderr, "     -m     follow mount points\n");
+      fprintf(stderr, "     -1     force single-column output\n");
+      fprintf(stderr, "     -C     force multi-column output (default when output is to a terminal)\n");
+      fprintf(stderr, "-1 and -C are mutually exclusive\n");
  }
  
  
***************
*** 255,260 ****
--- 287,297 ----
  
  
  
+ static int alphacmp(str1, str2)
+ char **str1, **str2;
+ {
+      return(strcmp(*str1, *str2));
+ }
  
  list_files()
  {
***************
*** 290,298 ****
  	  error("unique");
  	  return retval;
       }
!      
!      if (retval = column_array(strings, num, DEF_SCR_WIDTH, 0, 0, 2, 1, 0,
! 			       1, stdout)) {
  	  error("column_array");
  	  return retval;
       }
--- 327,337 ----
  	  error("unique");
  	  return retval;
       }
! 
!      qsort((char *) strings, num, sizeof(char *), alphacmp);
! 
!      if (retval = column_array(strings, num, DEF_SCR_WIDTH, 0, singlecolumn,
! 			       2, 1, 0, 1, stdout)) {
  	  error("column_array");
  	  return retval;
       }
***************
*** 342,348 ****
       *number -= offset;
       files = (char **) realloc((char *) files,
  			       (unsigned) (sizeof(char *) * *number));
!      if ((*number != 0) && (! files)) {
  	  set_error(errno);
  	  error("realloc");
  	  return errno;
--- 381,392 ----
       *number -= offset;
       files = (char **) realloc((char *) files,
  			       (unsigned) (sizeof(char *) * *number));
! #ifdef MALLOC_0_RETURNS_NULL
!      if ((! files) && *number)
! #else
!      if (! files)
! #endif
!      {
  	  set_error(errno);
  	  error("realloc");
  	  return errno;
*** /tmp/,RCSt1021382	Tue Jun  4 22:31:50 1991
--- stack.c	Tue Jun  4 22:06:00 1991
***************
*** 11,17 ****
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.c,v 1.9 91/02/28 18:43:49 jik Exp $";
  #endif
  
  #include <sys/types.h>
--- 11,17 ----
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.c,v 1.10 91/06/04 22:05:49 jik Exp $";
  #endif
  
  #include <sys/types.h>
***************
*** 63,69 ****
  	       stack = (caddr_t) (stack ? realloc((char *) stack,
  						  (unsigned) size) :
  				  Malloc((unsigned) size));
! 	       if (! stack) {
  		    size = count = 0;
  		    set_error(errno);
  		    error("Malloc");
--- 63,74 ----
  	       stack = (caddr_t) (stack ? realloc((char *) stack,
  						  (unsigned) size) :
  				  Malloc((unsigned) size));
! #ifdef MALLOC_0_RETURNS_NULL
! 	       if ((! stack) && size)
! #else
! 	       if (! stack)
! #endif
! 	       {
  		    size = count = 0;
  		    set_error(errno);
  		    error("Malloc");
***************
*** 119,125 ****
  	       if (newsize < size) {
  		    size = newsize;
  		    stack = (caddr_t) realloc((char *) stack, (unsigned) size);
! 		    if ((size != 0) && (! stack)) {
  			 set_error(errno);
  			 error("realloc");
  #ifdef STACK_DEBUG
--- 124,135 ----
  	       if (newsize < size) {
  		    size = newsize;
  		    stack = (caddr_t) realloc((char *) stack, (unsigned) size);
! #ifdef MALLOC_0_RETURNS_NULL
! 		    if ((! stack) && size)
! #else
! 		    if (! stack)
! #endif
! 	            {
  			 set_error(errno);
  			 error("realloc");
  #ifdef STACK_DEBUG
*** /tmp/,RCSt1021382	Tue Jun  4 22:32:08 1991
--- man1/lsdel.1	Tue Jun  4 18:57:48 1991
***************
*** 1,6 ****
  .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v 1.6 90/09/26 03:49:35 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
--- 1,6 ----
  .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v 1.7 91/06/04 18:57:40 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
***************
*** 25,30 ****
--- 25,34 ----
  .B \-m
  ] [
  .B \-y
+ ] [
+ .B \-1
+ ] [
+ .B \-C
  ] [ filename [ ... ]]
  .PP
  .SH DESCRIPTION
***************
*** 72,77 ****
--- 76,89 ----
  option causes
  .I lsdel
  to print the total amount of space taken up by all the files it lists.
+ .PP
+ The
+ .BR \-1
+ option forces output to be one file per line; this is the default when
+ output is not to a terminal.  The
+ .BR \-C
+ option does the opposite, forcing multi-column output, which is the
+ default when output is to a terminal.
  .SH "SEE ALSO"
  delete(1), undelete(1), purge(1), expunge(1), ls(1)
  .SH AUTHOR
*** /tmp/,RCSt1021382	Tue Jun  4 22:32:13 1991
--- block-test.sh	Tue Jun  4 20:51:52 1991
***************
*** 9,15 ****
  main()
  {
       struct stat statbuf;
!      char buf[1024];
       int testfile;
       char filename[20];
  
--- 9,15 ----
  main()
  {
       struct stat statbuf;
!      char buf[4096];
       int testfile;
       char filename[20];
  
***************
*** 37,48 ****
  	  exit(1);
       }
  
!      if (statbuf.st_blocks == 2) {
  	  printf("You SHOULD define USE_BLOCKS.\n");
       }
       else {
  	  printf("You SHOULD NOT define USE_BLOCKS.\n");
! 	  printf("However, you have an interesting machine that delete might be made to work\nbetter with.  Please contact the author (see the README file for an address)\nand tell him what kind of machine you have and what operating system it is\nrunning.");
       }
       exit(0);
  }
--- 37,48 ----
  	  exit(1);
       }
  
!      if (statbuf.st_blocks == sizeof(buf) / 512) {
  	  printf("You SHOULD define USE_BLOCKS.\n");
       }
       else {
  	  printf("You SHOULD NOT define USE_BLOCKS.\n");
! 	  printf("However, you have an interesting machine that delete might be made to work\nbetter with.  Please contact the author (see the README file for an address)\nand tell him what kind of machine you have and what operating system it is\nrunning.\n");
       }
       exit(0);
  }
*** /tmp/,RCSt1021382	Tue Jun  4 22:32:14 1991
--- malloc-test.c	Tue Jun  4 22:25:14 1991
***************
*** 0 ****
--- 1,6 ----
+ main()
+ {
+      printf("You %s define MALLOC_0_RETURNS_NULL.\n",
+ 	    malloc(0) ? "should NOT" : "SHOULD");
+      exit(0);
+ }

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent at sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent at uunet.uu.net.



More information about the Comp.sources.misc mailing list