🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by David J. MacKenzie Tue, 17 Oct 1989 04:43
fixes for mv
#505
Author: David J. MacKenzie
Date: Tue, 17 Oct 1989 04:43
65 lines
1890 bytes
Three recent changes to mv caused problems when I tried to compile it:

1.  It erroneously called 'getopt' instead of 'getopt_long', so the long
option names weren't recognized.

2.  Initialization of automatic structures is not supported by many C
compilers.

3.  EACCESS is called EACCES on at least some System V-derived systems.

Below are fixes for these problems.

Also, perhaps the usage message should mention the long option names.

*** mv-old.c	Mon Oct 16 15:31:29 1989
--- mv.c	Tue Oct 17 00:36:54 1989
***************
*** 47,52 ****
--- 47,55 ----
  
  #include <stdio.h>
  #include <errno.h>
+ #ifdef EACCES
+ #define EACCESS EACCES
+ #endif
  #include <sys/types.h>
  
  #include "system.h"
***************
*** 96,102 ****
  {
    int c;
    extern int optind;
!   struct option long_options[] = 
    	{{"interactive", 0, &interactive, 1},
  	 {"force",	 0, &force,	  1}};
  
--- 99,105 ----
  {
    int c;
    extern int optind;
!   static struct option long_options[] = 
    	{{"interactive", 0, &interactive, 1},
  	 {"force",	 0, &force,	  1}};
  
***************
*** 105,111 ****
  
    pgm = av[0];
  
!   while ((c = getopt (ac, av, "if", long_options, &ind)) != EOF)
      switch (c)
        {
        case 0 :
--- 108,114 ----
  
    pgm = av[0];
  
!   while ((c = getopt_long (ac, av, "if", long_options, &ind)) != EOF)
      switch (c)
        {
        case 0 :
-- 
David J. MacKenzie <djm@wam.umd.edu>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads