Deleted Added
full compact
1c1
< /* $Header: /src/pub/tcsh/sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $ */
---
> /* $Header: /src/pub/tcsh/sh.file.c,v 3.28 2005/01/05 16:06:13 christos Exp $ */
36c36
< RCSID("$Id: sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $")
---
> RCSID("$Id: sh.file.c,v 3.28 2005/01/05 16:06:13 christos Exp $")
67,68c67,68
< static Char filetype __P((Char *, Char *));
< static void print_by_column __P((Char *, Char *[], int));
---
> static int filetype __P((Char *, Char *));
> static void print_by_column __P((Char *, Char *[], size_t));
78c78
< static int recognize __P((Char *, Char *, int, int));
---
> static int recognize __P((Char *, Char *, int, size_t));
89c89
< bool filec = 0;
---
> int filec = 0;
229d228
< char c;
260,261c259,266
< for (p = string; (c = *p) != '\0'; p++)
< (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
---
> for (p = string; *p != '\0'; p++) {
> char buf[MB_LEN_MAX];
> size_t i, len;
>
> len = one_wctomb(buf, *p & CHAR);
> for (i = 0; i < len; i++)
> (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) &buf[i]);
> }
318c323
< static Char
---
> static int
357c362
< int count;
---
> size_t count;
359c364,365
< int i, rows, r, c, maxwidth = 0, columns;
---
> size_t i;
> int rows, r, c, maxwidth = 0, columns;
519,523c525
< /* atp vmsposix - I need to remove all the setpwent
< * getpwent endpwent stuff. VMS_POSIX has getpwnam getpwuid
< * and getlogin. This needs fixing. (There is no access to
< * pw->passwd in VMS - a secure system benefit :-| )
< */
---
>
533c535
< #ifdef _VMS_POSIX
---
> #ifndef HAVE_GETPWENT
584c586
< int numitems = 0, ignoring = TRUE, nignored = 0;
---
> int ignoring = TRUE, nignored = 0;
590c592
< size_t maxitems = 0;
---
> size_t numitems = 0, maxitems = 0;
594c596
< #ifndef _VMS_POSIX
---
> #ifdef HAVE_GETPWENT
596c598
< #endif /*atp vmsposix */
---
> #endif
644,645c646,647
< if (looking_for_lognames)
< #ifndef _VMS_POSIX
---
> if (looking_for_lognames) {
> #ifdef HAVE_GETPWENT
648c650
< else
---
> } else
653,654c655,656
< if (looking_for_lognames)
< #ifndef _VMS_POSIX
---
> if (looking_for_lognames) {
> #ifndef HAVE_GETPWENT
656,657c658,659
< #endif /*atp vmsposix */
< else
---
> #endif
> } else
672c674
< qsort((ptr_t) items, (size_t) numitems, sizeof(items[0]),
---
> qsort((ptr_t) items, numitems, sizeof(items[0]),
687,690c689,692
< #if defined(NLS) && !defined(NOSTRCOLL)
< errno = 0; /* strcoll sets errno, another brain-damage */
<
< return (strcoll(*(char **) p, *(char **) q));
---
> #ifdef WIDE_STRINGS
> errno = 0;
>
> return (wcscoll(*(Char **) p, *(Char **) q));
692,693c694,708
< return (strcmp(*(char **) p, *(char **) q));
< #endif /* NLS && !NOSTRCOLL */
---
> char *p1, *q1;
> int res;
>
> p1 = strsave(short2str(*(Char **) p));
> q1 = strsave(short2str(*(Char **) q));
> # if defined(NLS) && !defined(NOSTRCOLL)
> errno = 0; /* strcoll sets errno, another brain-damage */
> res = strcoll(p1, q1);
> # else
> res = strcmp(p1, q1);
> # endif /* NLS && !NOSTRCOLL */
> xfree (p1);
> xfree (q1);
> return res;
> #endif /* not WIDE_STRINGS */
707c722,723
< int name_length, numitems;
---
> int name_length;
> size_t numitems;
766c782
< char tinputline[BUFSIZE];
---
> char tinputline[BUFSIZE + 1];
772d787
< int i;
779,780c794,796
< for (i = 0; i < num_read; i++)
< inputline[i] = (unsigned char) tinputline[i];
---
> tinputline[num_read] = 0;
> Strcpy(inputline, str2short(tinputline));
> num_read = Strlen(inputline);