Path: 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 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 #include + #ifdef EACCES + #define EACCESS EACCES + #endif #include #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