View | Details | Raw Unified | Return to bug 2643 | Differences between
and this patch

Collapse All | Expand All

(-)a/ssh.c (-1 / +31 lines)
Lines 503-508 set_addrinfo_port(struct addrinfo *addrs, int port) Link Here
503
	}
503
	}
504
}
504
}
505
505
506
void
507
xsetlocale(int unused1, const char *unused2)
508
{
509
	const char *vars[] = { "LC_CTYPE", "LC_ALL", "LANG", NULL };
510
	char *cp;
511
	int i;
512
513
	/*
514
	 * We can't yet cope with dotless/dotted I in Turkish locales,
515
	 * so fall back to the C locale for these.
516
	 */
517
	for (i = 0; vars[i] != NULL; i++) {
518
		if ((cp = getenv(vars[i])) == NULL)
519
			continue;
520
		if (strncasecmp(cp, "TR", 2) != 0)
521
			continue;
522
		/*
523
		 * If we're in a UTF-8 locale then prefer to use
524
		 * C.UTF-8 locale if it exists.
525
		 */
526
		if (strstr(cp, "UTF-8") != NULL &&
527
		    setlocale(LC_CTYPE, "C.UTF-8") != NULL)
528
			return;
529
		setlocale(LC_CTYPE, "C");
530
		return;
531
	}
532
	/* We can handle this locale */
533
	setlocale(LC_CTYPE, "");
534
}
535
506
/*
536
/*
507
 * Main program for the ssh client.
537
 * Main program for the ssh client.
508
 */
538
 */
Lines 589-595 main(int ac, char **av) Link Here
589
	 */
619
	 */
590
	umask(022);
620
	umask(022);
591
621
592
	setlocale(LC_CTYPE, "");
622
	xsetlocale(LC_CTYPE, "");
593
623
594
	/*
624
	/*
595
	 * Initialize option structure to indicate that no values have been
625
	 * Initialize option structure to indicate that no values have been

Return to bug 2643