]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_driver.c
ncurses 6.1 - patch 20190914
[ncurses.git] / ncurses / base / lib_driver.c
index 4f4b8ce5e20e128c9cdc01d76fa0ce799f5fce18..6211b70bec190461e559ef413c774c3a65afd708 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 2008-2014,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -33,7 +33,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_driver.c,v 1.5 2014/03/08 20:32:59 tom Exp $")
+MODULE_ID("$Id: lib_driver.c,v 1.7 2018/06/24 00:06:37 tom Exp $")
 
 typedef struct DriverEntry {
     const char *name;
@@ -42,8 +42,8 @@ typedef struct DriverEntry {
 
 static DRIVER_ENTRY DriverTable[] =
 {
-#ifdef __MINGW32__
-    {"win32con", &_nc_WIN_DRIVER},
+#ifdef _WIN32
+    {"win32console", &_nc_WIN_DRIVER},
 #endif
     {"tinfo", &_nc_TINFO_DRIVER}       /* must be last */
 };
@@ -63,24 +63,12 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret)
 
     for (i = 0; i < SIZEOF(DriverTable); i++) {
        res = DriverTable[i].driver;
-       /*
-        * Use "#" (a character which cannot begin a terminal's name) to
-        * select specific driver from the table.
-        *
-        * In principle, we could have more than one non-terminfo driver,
-        * e.g., "win32gui".
-        */
-       if (name != 0 && *name == '#') {
-           size_t n = strlen(name + 1);
-           if (n != 0
-               && strncmp(name + 1, DriverTable[i].name, n)) {
-               continue;
+       if (strcmp(DriverTable[i].name, res->td_name(TCB)) == 0) {
+           if (res->td_CanHandle(TCB, name, errret)) {
+               use = res;
+               break;
            }
        }
-       if (res->td_CanHandle(TCB, name, errret)) {
-           use = res;
-           break;
-       }
     }
     if (use != 0) {
        TCB->drv = use;