(main): Move to the end.
authorJim Meyering <jim@meyering.net>
Fri, 10 Nov 1995 03:14:41 +0000 (03:14 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 10 Nov 1995 03:14:41 +0000 (03:14 +0000)
Remove fwd dcls.

src/rmdir.c

index da43313..8c2f75b 100644 (file)
@@ -33,9 +33,6 @@
 
 void strip_trailing_slashes ();
 
-static void remove_parents (char *path);
-static void usage (int status);
-
 /* The name this program was run with. */
 char *program_name;
 
@@ -57,6 +54,47 @@ static struct option const longopts[] =
   {NULL, 0, NULL, 0}
 };
 
+/* Remove any empty parent directories of `path'.
+   Replaces '/' characters in `path' with NULs. */
+
+static void
+remove_parents (char *path)
+{
+  char *slash;
+
+  do
+    {
+      slash = strrchr (path, '/');
+      if (slash == NULL)
+       break;
+      /* Remove any characters after the slash, skipping any extra
+        slashes in a row. */
+      while (slash > path && *slash == '/')
+       --slash;
+      slash[1] = 0;
+    }
+  while (rmdir (path) == 0);
+}
+
+static void
+usage (int status)
+{
+  if (status != 0)
+    fprintf (stderr, "Try `%s --help' for more information.\n",
+            program_name);
+  else
+    {
+      printf ("Usage: %s [OPTION]... DIRECTORY...\n", program_name);
+      printf ("\
+Remove the DIRECTORY(ies), if they are empty.\n\
+\n\
+  -p, --parents   remove explicit parent directories if being emptied\n\
+      --help      display this help and exit\n\
+      --version   output version information and exit\n");
+    }
+  exit (status);
+}
+
 void
 main (int argc, char **argv)
 {
@@ -111,44 +149,3 @@ main (int argc, char **argv)
 
   exit (errors);
 }
-
-/* Remove any empty parent directories of `path'.
-   Replaces '/' characters in `path' with NULs. */
-
-static void
-remove_parents (char *path)
-{
-  char *slash;
-
-  do
-    {
-      slash = strrchr (path, '/');
-      if (slash == NULL)
-       break;
-      /* Remove any characters after the slash, skipping any extra
-        slashes in a row. */
-      while (slash > path && *slash == '/')
-       --slash;
-      slash[1] = 0;
-    }
-  while (rmdir (path) == 0);
-}
-
-static void
-usage (int status)
-{
-  if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
-            program_name);
-  else
-    {
-      printf ("Usage: %s [OPTION]... DIRECTORY...\n", program_name);
-      printf ("\
-Remove the DIRECTORY(ies), if they are empty.\n\
-\n\
-  -p, --parents   remove explicit parent directories if being emptied\n\
-      --help      display this help and exit\n\
-      --version   output version information and exit\n");
-    }
-  exit (status);
-}