kopia lustrzana https://gitlab.com/sane-project/backends
Use "C" LC_CTYPE when converting backend names to env vars
rodzic
af10791227
commit
dd4f26a805
|
@ -41,6 +41,7 @@
|
||||||
#include "../include/sane/config.h"
|
#include "../include/sane/config.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
|
@ -70,12 +71,14 @@
|
||||||
void
|
void
|
||||||
sanei_init_debug (const char * backend, int * var)
|
sanei_init_debug (const char * backend, int * var)
|
||||||
{
|
{
|
||||||
|
char *lc_ctype;
|
||||||
char ch, buf[256] = "SANE_DEBUG_";
|
char ch, buf[256] = "SANE_DEBUG_";
|
||||||
const char * val;
|
const char * val;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
*var = 0;
|
*var = 0;
|
||||||
|
|
||||||
|
lc_ctype = setlocale (LC_CTYPE, "C");
|
||||||
for (i = 11; (ch = backend[i - 11]) != 0; ++i)
|
for (i = 11; (ch = backend[i - 11]) != 0; ++i)
|
||||||
{
|
{
|
||||||
if (i >= sizeof (buf) - 1)
|
if (i >= sizeof (buf) - 1)
|
||||||
|
@ -83,6 +86,7 @@ sanei_init_debug (const char * backend, int * var)
|
||||||
buf[i] = toupper(ch);
|
buf[i] = toupper(ch);
|
||||||
}
|
}
|
||||||
buf[i] = '\0';
|
buf[i] = '\0';
|
||||||
|
setlocale (LC_CTYPE, lc_ctype);
|
||||||
|
|
||||||
val = getenv (buf);
|
val = getenv (buf);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue