🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #505

fixes for mv

#505
From: 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>
Technical Details
Message-ID: <8910170443.AA09456@mordor.eng.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!purdue!decwrl!mordor.eng.umd.edu!djm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!purdue!decwrl!mordor.eng.umd.edu!djm
From: djm@mordor.eng.umd.edu (David J. MacKenzie)
Newsgroups: gnu.utils.bug
Subject: fixes for mv
Message-ID: <8910170443.AA09456@mordor.eng.umd.edu>
Date: 17 Oct 89 04:43:39 GMT
Distribution: gnu
Organization: University of Maryland
Lines: 65