]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
use the emitProc dispatch table
authorAndreas Jaeger <aj@suse.de>
Sun, 13 May 2001 01:10:47 +0000 (01:10 +0000)
committerBruce Korb <bkorb@gnu.org>
Sun, 13 May 2001 01:10:47 +0000 (01:10 +0000)
exe/ltmain.c

index 239d1b60c074f98d48af020e646eb4b80d198594..1abdc6a9a97d2db83cac8dbd587e1da4132d987b 100644 (file)
@@ -28,6 +28,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <assert.h>
 #include <sys/wait.h>
 #include <signal.h>
 
@@ -456,7 +457,16 @@ main( argc, argv )
     signal( SIGBUS,  handleSignal );
     signal( SIGSEGV, handleSignal );
 
-    emitScript( argc, argv );
+    assert( OPT_VALUE_MODE < MODE_CT );
+    {
+        emitScriptProc* pEP = ap_emitProc[ OPT_VALUE_MODE ];
+        if (pEP == NULL) {
+            fprintf( stderr, "We're in the wrong mode:  %d\n",
+                     OPT_VALUE_MODE );
+            USAGE( EXIT_FAILURE );
+        }
+        (*pEP)( argc, argv );
+    }
 
     return scriptStatus;
 }