debian/0000755000000000000000000000000012231757634007200 5ustar debian/postinst0000644000000000000000000000044211557077240011004 0ustar #!/bin/sh set -e if [ "$1" = configure ]; then update-alternatives --install /bin/csh csh /bin/bsd-csh 30 \ --slave /usr/share/man/man1/csh.1.gz csh.1.gz \ /usr/share/man/man1/bsd-csh.1.gz if which add-shell >/dev/null 2>&1; then add-shell /bin/csh fi fi #DEBHELPER# debian/copyright0000644000000000000000000000417211563264505011134 0ustar Format: http://www.debian.org/doc/copyright-format/1.0 Upstream-Contact: bugs@openbsd.org Source: http://www.openbsd.org/cgi-bin/cvsweb/src/bin/csh/ `debian/rules get-orig-source' can be used to retrieve the current version from the OpenBSD CVS repository. Files: * Copyright: 1980-1993 The Regents of the University of California. All rights reserved. License: BSD-3-clause Files: debian/* Copyright: 1996-1997 Dominik Kubla 1997 Joey Hess 1999 Edward Brocklesby 2001 Michael Stone 2001-2011 Matej Vela License: BSD-3-clause License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/prerm0000644000000000000000000000026611557077240010252 0ustar #!/bin/sh set -e if [ "$1" = remove ]; then update-alternatives --remove csh /bin/bsd-csh if which remove-shell >/dev/null 2>&1; then remove-shell /bin/csh fi fi #DEBHELPER# debian/changelog0000644000000000000000000002604412231757535011060 0ustar csh (20110502-2ubuntu2) trusty; urgency=low * Fix build failure, debhelper cannot handle pmake. Closes: #718068. -- Matthias Klose Wed, 23 Oct 2013 16:38:11 +0200 csh (20110502-2ubuntu1) oneiric; urgency=low * Build with -Wno-error=unused-result. -- Matthias Klose Thu, 08 Sep 2011 21:30:57 +0200 csh (20110502-2) unstable; urgency=medium * 02_libbsd.diff: Use rather than . Closes: #629684. * Drop "standard login shell on BSD systems" from the description. Thanks to Thorsten Glaser for the suggestion. -- Matej Vela Tue, 05 Jul 2011 14:27:00 +0200 csh (20110502-1) unstable; urgency=low * New upstream release. - Includes fix for exp2 conflict from #258588. * Switch to dpkg-source 3.0 (quilt) format. * Switch to debhelper 8. * 01_gnu_source.diff: Remove now-unused `-D__BSD_VISIBLE' (leaving only `-D_GNU_SOURCE'). * 02_libbsd.diff: Remove convenience copies of OpenBSD's strlcpy and vis; link to libbsd instead. * 08_glob.diff: Remove convenience copy of OpenBSD's glob; refactor to avoid any of the areas where BSD and GNU implementations differ (GLOB_MAGCHAR, GLOB_NOCHECK, GLOB_NOMAGIC, gl_matchc). * 11_groff_schar.diff: Make footnote marks legible in csh.txt. * debian/copyright: - Include full license text instead of referring to /usr/share/common-licenses/BSD. - Switch to machine-readable format (DEP-5). * debian/rules (get-orig-source): - Derive version from last-modified time rather than current date. - Clean up temporary directory in case of errors. * Conforms to Standards version 3.9.2. -- Matej Vela Fri, 13 May 2011 22:54:42 +0200 csh (20070713-2) unstable; urgency=medium * _glob.c (globextend): Use sysconf(_SC_ARG_MAX) rather than ARG_MAX. Closes: #518860. * Switch to debhelper 7. * debian/doc-base: Update section to Shells. * debian/postinst, debian/prerm: Use which rather than type. * Conforms to Standards version 3.8.0. -- Matej Vela Mon, 09 Mar 2009 09:15:35 +0100 csh (20070713-1) unstable; urgency=low * New upstream release. * debian/menu: Move to Applications/Shells. -- Matej Vela Fri, 13 Jul 2007 23:52:21 +0200 csh (20060813-1) unstable; urgency=low * New upstream release. * Switch to cdbs. * csh.c, csh.h, debian/preinst: Remove potato compatibility code. * debian/postinst: Invoke add-shell unconditionally, to handle the case where the package is re-installed after being removed. * Conforms to Standards version 3.7.2. -- Matej Vela Sun, 13 Aug 2006 15:53:42 +0200 csh (20060413-1) unstable; urgency=low * New upstream release. * Since glibc is broken with respect to GLOB_NOMAGIC and backslashes (and its maintainers refuse to see the light), switch back to BSD's implementation of glob. Closes: #220170. * Incidentally, this removes the need to reimplement glob_t.gl_matchc, fixing a bug that was causing `No match' errors when some patterns did match and some didn't. Closes: #350869. * Prefix BSD libc sources (glob.c, strlcpy.c, vis.c) with an underscore to avoid a conflict with our own glob.c. * _glob.c (globtilde): Replace issetugid with calls to get{e,}{u,g}id. * Use add-shell and remove-shell. Closes: #361544. * Switch to debhelper 5. * debian/copyright: Document `debian/rules get-orig-source'. * debian/doc-base: Rephrase abstract. * debian/rules: Set CVS_RSH to ssh. * Conforms to Standards version 3.6.2. -- Matej Vela Thu, 13 Apr 2006 18:48:29 +0200 csh (20050313-1) unstable; urgency=low * New upstream release. * Revert to a flat source tree, it does make things simpler. * exp.c (exp2): Rename to csh_exp2 to avoid conflict with gcc builtin (thanks to Andreas Jochens). Closes: #258588. * glob.c (libglob): GLOB_NOMAGIC has been fixed in glibc 2.3 (#106097). * proc.c (dokill): glibc has an undocumented sys_sigabbrev array with signal names, so we no longer have to generate our own. * vis.c (isvisible): Comparison with UCHAR_MAX triggers `always true' warnings for unsigned char arguments; since this is already checked by isascii, remove it. Closes: #268438. * vis.h: Remove OpenBSD-specific `bounded' attribute. * Switch to debhelper 4. * debian/doc-base: Add doc-base support. * debian/menu: Add menu file (thanks to Bill Allombert). Closes: #187629. * debian/rules: - Re-enable -Werror on alpha now that #97603 is fixed. - Make sure groff uses traditional (non-ANSI) escape sequences. - Remove support for DEB_BUILD_OPTIONS=debug. - Add support for DEB_BUILD_OPTIONS=noopt. * Conforms to Standards version 3.6.1. -- Matej Vela Sun, 13 Mar 2005 22:14:05 +0100 csh (20020413-1.1) unstable; urgency=high * Non-maintainer upload. * Urgency=high for sarge-targetted RC bugfix. * Fix implicit signed char assumptions in source, addressing FTBFS bugs on arm/powerpc/s390 (closes: #268438). -- Steve Langasek Mon, 6 Sep 2004 19:31:44 -0700 csh (20020413-1) unstable; urgency=low * New upstream version. * Removed the /usr/bin/csh compatibility symlink. Since /usr/bin precedes /bin in the PATH, a configure script would use the former location instead of the one managed by alternatives, and things wouldn't work with tcsh (cf. #106547). Obviously, this doesn't break anything that isn't already broken for tcsh. -- Matej Vela Sat, 13 Apr 2002 18:34:51 +0200 csh (20020213-1) unstable; urgency=low * New upstream version. Handles out of range argv subscripts. Closes: #131693. -- Matej Vela Wed, 13 Feb 2002 23:03:47 +0100 csh (20011113-1) unstable; urgency=high * New upstream version. * csh.c: On glibc (<< 2.2), call cookie_seek_function_t with an off_t instead of an off64_t *. The package now builds on potato. Closes: #119344. * csh.c: Leave standard streams open for progprintf. * csh.c, proc.c: Substitute fpurge with the recently added __fpurge. * csh.h: On the Hurd, seems to define MAXPATHLEN to PATH_MAX without defining the latter; provide a default. * func.c (doprintf): progprintf uses stdout/stderr, so flush those rather than cshout/csherr. * pathnames.h (_PATH_LOGIN): login is in /bin, not /usr/bin. -- Matej Vela Tue, 13 Nov 2001 20:53:00 +0100 csh (20010813-1) unstable; urgency=high * New upstream version. * debian/rules: stdio.h causes a cpp warning on alpha; conditionally disable -Werror until #97603 is fixed. Closes: #106285. * glob.c: GLOB_NOMAGIC produces false positives for patterns like `*/xxx'; work around it until #106097 is fixed. * Conforms to Standards version 3.5.6. -- Matej Vela Mon, 13 Aug 2001 20:33:24 +0200 csh (20010613-1) unstable; urgency=low * New upstream version. * New maintainer. Closes: #92493. * debian/prerm: `update-alternatives --remove' wants /bin/bsd-csh, not /bin/csh. * Conforms to Standards version 3.5.5. -- Matej Vela Wed, 13 Jun 2001 03:31:52 +0200 csh (20010413-1) unstable; urgency=medium * New upstream version, re-ported from OpenBSD-current: * csh.c: Include for time_t etc. Closes: #90859. * csh.c (main, readf, writef, seekf, closef): funopen substituted with fopencookie. * csh.c (pintr1), proc.c (pprint): fpurge substituted with fflush. (Anything better?) * csh.h: Define MAXPATHLEN to 4096 if it isn't already defined (e.g. on the Hurd). If X11 and Tcl can get away with it, so can we. ;-) Closes: #54993. * glob.c (libglob): * Don't set GLOB_QUOTE, it's already default. * Work around gl_matchc, this time correctly. Closes: #88780. * misc.c (closem): Upstream fixed it to use `sysconf (_SC_OPEN_MAX)' rather than NOFILE. Closes: #63650. * proc.c (dokill), proc.h, siglist.in: Use our own sys_signame array, constructed from siglist.in (taken from pdksh 5.2.14). * Package is orphaned (see #92493); maintainer set to Debian QA Group. * Converted to debhelper. Closes: #91435. * Conforms to Standards version 3.5.2: * Added build dependencies. Closes: #90860. * debian/rules: Support the `debug' build option. * debian/copyright: Updated. * Changed priority to optional, catching up with the override file. * debian/lintian: Override the `binary-without-manpage: csh' Lintian error caused by the /usr/bin/csh -> /bin/csh symlink. * debian/rules: Added a `get-orig-source' target. * Removed pre-bo (<< 5.26-6) compatibility code. -- Matej Vela Fri, 13 Apr 2001 20:43:09 +0200 csh (5.26-12) unstable; urgency=low * move csh to /bin/bsd-csh -- Michael Stone Tue, 2 Jan 2001 07:36:42 -0500 csh (5.26-11) unstable; urgency=low * New maintainer. * Updated policy version -- Michael Stone Tue, 2 Jan 2001 06:59:11 -0500 csh (5.26-10) unstable; urgency=low * New maintainer. -- Edward Brocklesby Sat, 10 Jul 1999 11:12:48 -0700 csh (5.26-9) unstable; urgency=low * libc6 release. * Several fixes (hacks really, for the most part) to get it to build on libc6. * Clean up const.h in debian/rules clean. * Run dpkg-shlibdeps. * Orphaned the package, now maintained by debian-qa. -- Joey Hess Thu, 20 Nov 1997 20:57:46 -0500 csh (5.26-8) stable unstable; urgency=HIGH * Added glob functions from 4.4BSD libc to work around missing BSD compatibility in Linux libc. That fixes Bug#6501. * Replaced manual page with newer one from NetBSD. This fixes Bug#5872. * Changed Maintainer address to . * Added USD manual "An Introduction to the C shell" from NetBSD. This will be installed both as Latin-1 text and postscript file. -- Dominik Kubla Sat, 25 Jan 1997 14:41:04 +0100 csh (5.26-7) unstable; urgency=low * Minor bugfixes in debian/rules. Should now comply with "Debian Programmers Manual", section 3.2.1 * manual page is now installed in 'gzip -9' format as per "Debian Policy Manual", section 3.2.1 * changed priority from 'optional' to 'standard'. -- Dominik Kubla Mon, 30 Sep 1996 16:43:37 +0200 csh (5.26-6) unstable; urgency=low * Applied patches provided by Randy Gobbel to fix a malloc and a string match bug. * copyright file is now installed in /usr/doc/csh/copyright as per "Debian Policy Manual", Section 3.2.6 * Package is now compiled with CFLAGS set to '-O2 -g -Wall' as per "Debian Policy Manual", Section 4.1 * csh does now use alternatives instead of diversions to coexist with tcsh. Therefore it conflicts with tcsh <= 6.06-3 because tcsh does not yet use alternatives. -- Dominik Kubla Sat, 28 Sep 1996 19:48:15 +0200 csh (5.26-5) unstable; urgency=low * Converted to new packaing standards. -- Dominik Kubla Thu, 12 Sep 1996 09:44:45 +0200 debian/doc-base0000644000000000000000000000115511557077240010600 0ustar Document: csh Title: An Introduction to the C shell Author: William Joy, Mark Seiden Abstract: The C shell was originally written at UCB to overcome limitations in the Bourne shell. Its flexibility and comfort (at that time) quickly made it the shell of choice until more advanced shells like ksh, bash, zsh or tcsh appeared. Most of the latter incorporate features original to csh. . This is a step-by-step tutorial on interactive use of the C shell. It is mainly of historical interest. Section: Shells Format: PostScript Files: /usr/share/doc/csh/csh.ps.gz Format: text Files: /usr/share/doc/csh/csh.txt.gz debian/compat0000644000000000000000000000000211557506563010401 0ustar 8 debian/menu0000644000000000000000000000017611557077240010071 0ustar ?package(csh):\ needs="text"\ section="Applications/Shells"\ longtitle="C shell"\ title="Csh"\ command="/bin/bsd-csh -l" debian/patches/0000755000000000000000000000000011604600370010612 5ustar debian/patches/08_glob.diff0000644000000000000000000001050111563317012012675 0ustar Description: Adjust for differences between BSD and GNU glob See detailed code comments. Bug-Debian: http://bugs.debian.org/88780 Bug-Debian: http://bugs.debian.org/106097 Bug-Debian: http://bugs.debian.org/220170 Bug-Debian: http://bugs.debian.org/350869 Bug-GNU: http://sourceware.org/bugzilla/show_bug.cgi?id=1342 Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110502/glob.c =================================================================== --- csh-20110502.orig/glob.c +++ csh-20110502/glob.c @@ -370,46 +370,99 @@ static Char ** libglob(Char **vl) { - int gflgs = GLOB_QUOTE | GLOB_NOMAGIC; + Char **nv, **nvp; + size_t size = GLOBSPACE; glob_t globv; - char *ptr; int nonomatch = adrof(STRnonomatch) != 0, magic = 0, match = 0; if (!vl || !vl[0]) return (vl); - globv.gl_offs = 0; - globv.gl_pathv = 0; - globv.gl_pathc = 0; - - if (nonomatch) - gflgs |= GLOB_NOCHECK; - + nvp = nv = (Char **) xmalloc(sizeof(Char *) * size); do { - ptr = short2qstr(*vl); - switch (glob(ptr, gflgs, 0, &globv)) { - case GLOB_ABORTED: - setname(vis_str(*vl)); - stderror(ERR_NAME | ERR_GLOB); - /* NOTREACHED */ - case GLOB_NOSPACE: - stderror(ERR_NOMEM); - /* NOTREACHED */ - default: - break; + int append; /* Matches to append in this round. */ + Char *magicp; + /* + * The original code depends on GLOB_NOMAGIC and GLOB_MAGCHAR to + * distinguish patterns with magic characters. Both are unreliable + * with GNU glob() as it considers a pattern magical as soon as it + * finds backslashes (unlike BSD). tglob() already implements a + * similar check for the whole list, so do it on our own: make + * magicp point to the first magic character, or NUL if none. + */ + for (magicp = *vl; *magicp; magicp++) + if (isglob(*magicp)) + break; + if (*magicp) { + /* + * Pattern is magic and we need to glob(). The original code + * calls glob() repeatedly on a single output buffer, relying on + * GLOB_NOMAGIC to append the original pattern if it didn't + * contain any magic characters, or GLOB_NOCHECK to do the same + * if nonomatch is in effect. Again, both are problematic with + * GNU glob() as it leaves backslashes unstripped in the output: + * . This + * may get fixed at some point, but for now we can't reliably + * append an unchanged pattern to an existing glob buffer, and + * must call glob() separately each time. + */ + char *ptr = short2qstr(*vl); + globv.gl_offs = 0; + globv.gl_pathv = 0; + globv.gl_pathc = 0; + switch (glob(ptr, 0, 0, &globv)) { + case GLOB_ABORTED: + setname(vis_str(*vl)); + stderror(ERR_NAME | ERR_GLOB); + /* NOTREACHED */ + case GLOB_NOSPACE: + stderror(ERR_NOMEM); + /* NOTREACHED */ + default: + break; + } + /* + * If gl_pathc shows matches, append that many. Otherwise + * append the original pattern if nonomatch is in effect. + */ + append = globv.gl_pathc ? globv.gl_pathc : nonomatch; + match |= (append != 0); /* Did any magic patterns match? */ + magic = 1; /* At least one should match. */ + } else { + /* + * No magic characters, append the pattern by itself. + */ + append = 1; } - if (globv.gl_flags & GLOB_MAGCHAR) { - match |= (globv.gl_matchc != 0); - magic = 1; + if (append) { + if (nvp + append >= nv + size) { + size = (nvp - nv) + append + GLOBSPACE; + nv = xrealloc((ptr_t) nv, sizeof(Char *) * size); + nvp = nv + size - append - GLOBSPACE; + } + if (*magicp && globv.gl_pathc) { + char **gvp; + for (gvp = globv.gl_pathv; *gvp; gvp++) + *nvp++ = SAVE(*gvp); + } else { + *nvp++ = strip(Strsave(*vl)); + } } - gflgs |= GLOB_APPEND; + if (*magicp) + globfree(&globv); /* Must free regardless of matches. */ } while (*++vl) ; - vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ? - NULL : blk2short(globv.gl_pathv); - globfree(&globv); - return (vl); + if (nvp == nv || (magic && !match)) { + /* + * Output is empty, or none of the magic patterns matched. + * It's up to the caller to generate a "No match" error. + */ + xfree(nv); + return (NULL); + } + *nvp = NULL; + return (nv); } Char * debian/patches/10_groff_no_sgr.diff0000644000000000000000000000073111563213413014421 0ustar Description: Enable GROFF_NO_SGR for traditional (non-ANSI) escape sequences Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110502/USD.doc/Makefile =================================================================== --- csh-20110502.orig/USD.doc/Makefile +++ csh-20110502/USD.doc/Makefile @@ -6,6 +6,7 @@ MACROS= -ms paper.txt: ${SRCS} + GROFF_NO_SGR=1 \ ${ROFF} -Tascii ${SRCS} > ${.TARGET} .include debian/patches/03_maxpathlen.diff0000644000000000000000000000112211563212612014105 0ustar Description: Define MAXPATHLEN if missing (e.g. on the Hurd) Bug-Debian: http://bugs.debian.org/54993 Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110313/csh.h =================================================================== --- csh-20110313.orig/csh.h +++ csh-20110313/csh.h @@ -42,6 +42,10 @@ #define BUFSIZ 1024 /* default buffer size */ #endif /* BUFSIZ */ +#ifndef MAXPATHLEN +#define MAXPATHLEN BUFSIZ +#endif + #define FORKSLEEP 10 /* delay loop on non-interactive fork failure */ #define MAILINTVL 600 /* 10 minutes */ debian/patches/06_time_h_for_time_t.diff0000644000000000000000000000063711604600370015433 0ustar Description: Include for time_t etc. Forwarded: not-needed Author: Matej Vela Last-Update: 2011-07-05 Index: csh-20110502/csh.c =================================================================== --- csh-20110502.orig/csh.c +++ csh-20110502/csh.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "csh.h" #include "proc.h" debian/patches/01_gnu_source.diff0000644000000000000000000000072211563265351014130 0ustar Description: Define _GNU_SOURCE to enable BSD and GNU features Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110313/Makefile =================================================================== --- csh-20110313.orig/Makefile +++ csh-20110313/Makefile @@ -7,6 +7,7 @@ PROG= csh DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS +DFLAGS+=-D_GNU_SOURCE #CFLAGS+=-g #CFLAGS+=-Wall CFLAGS+=-I${.CURDIR} -I. ${DFLAGS} debian/patches/04_fpurge.diff0000644000000000000000000000074011563212667013254 0ustar Description: Replace BSD-specific fpurge with GNU-specific __fpurge Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110313/csh.h =================================================================== --- csh-20110313.orig/csh.h +++ csh-20110313/csh.h @@ -96,6 +96,9 @@ #include FILE *cshin, *cshout, *csherr; +#include +#define fpurge __fpurge + #define isdir(d) (S_ISDIR(d.st_mode)) typedef int bool; debian/patches/09_sys_signame.diff0000644000000000000000000000413111563216304014300 0ustar Description: Replace BSD-specific sys_signame with GNU-specific sys_sigabbrev Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110502/proc.c =================================================================== --- csh-20110502.orig/proc.c +++ csh-20110502/proc.c @@ -38,6 +38,12 @@ #include #include +/* + * GNU libc doesn't expose sys_sigabbrev in headers, but it's been in use for + * a while: . + */ +extern const char *const sys_sigabbrev[]; + #include "csh.h" #include "dir.h" #include "proc.h" @@ -945,16 +951,22 @@ signum = atoi(short2str(v[1])); if (signum < 0 || signum >= NSIG) stderror(ERR_NAME | ERR_BADSIG); - else if (signum == 0) - (void) fputc('0', cshout); /* 0's symbolic name is '0' */ + else if (sys_sigabbrev[signum] == NULL) + (void) fprintf(cshout, "%d", signum); else - (void) fprintf(cshout, "%s ", sys_signame[signum]); + (void) fprintf(cshout, "%s ", sys_sigabbrev[signum]); } else { - for (signum = 1; signum < NSIG; signum++) { - (void) fprintf(cshout, "%s ", sys_signame[signum]); - if (signum == NSIG / 2) - (void) fputc('\n', cshout); - } + int cur = 0, len; + for (signum = 1; signum < NSIG; signum++) + if (sys_sigabbrev[signum]) { + len = strlen(sys_sigabbrev[signum]) + 1; + cur += len; + if (cur >= 80 - 1) { + (void) fputc('\n', cshout); + cur = len; + } + (void) fprintf(cshout, "%s ", sys_sigabbrev[signum]); + } } (void) fputc('\n', cshout); return; @@ -978,9 +990,10 @@ } for (signum = 1; signum < NSIG; signum++) - if (!strcasecmp(sys_signame[signum], name) || - (strlen(name) > 3 && !strncasecmp("SIG", name, 3) && - !strcasecmp(sys_signame[signum], name + 3))) + if (sys_sigabbrev[signum] && \ + (!strcasecmp(sys_sigabbrev[signum], name) || + (strlen(name) > 3 && !strncasecmp("SIG", name, 3) && + !strcasecmp(sys_sigabbrev[signum], name + 3)))) break; if (signum == NSIG) { debian/patches/02_libbsd.diff0000644000000000000000000000401211604600365013205 0ustar Description: Use libbsd for strlcpy, vis Forwarded: not-needed Author: Matej Vela Last-Update: 2011-07-05 Index: csh-20110502/Makefile =================================================================== --- csh-20110502.orig/Makefile +++ csh-20110502/Makefile @@ -14,6 +14,7 @@ SRCS= alloc.c char.c const.c csh.c dir.c dol.c error.c exec.c exp.c file.c \ func.c glob.c hist.c init.c lex.c misc.c parse.c proc.c \ sem.c set.c str.c time.c +LDADD+= -lbsd CLEANFILES+=error.h const.h Index: csh-20110502/csh.c =================================================================== --- csh-20110502.orig/csh.c +++ csh-20110502/csh.c @@ -39,9 +39,10 @@ #include #include #include +#include #include #include -#include +#include #include #include "csh.h" Index: csh-20110502/dir.c =================================================================== --- csh-20110502.orig/dir.c +++ csh-20110502/dir.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include Index: csh-20110502/glob.c =================================================================== --- csh-20110502.orig/glob.c +++ csh-20110502/glob.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include Index: csh-20110502/sem.c =================================================================== --- csh-20110502.orig/sem.c +++ csh-20110502/sem.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include Index: csh-20110502/str.c =================================================================== --- csh-20110502.orig/str.c +++ csh-20110502/str.c @@ -39,7 +39,7 @@ #include #include -#include +#include #include "csh.h" #include "extern.h" debian/patches/07_funopen.diff0000644000000000000000000000431511563212760013435 0ustar Description: Replace BSD-specific funopen with GNU-specific fopencookie Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110313/csh.c =================================================================== --- csh-20110313.orig/csh.c +++ csh-20110313/csh.c @@ -81,10 +81,11 @@ extern char **environ; -static int readf(void *, char *, int); -static fpos_t seekf(void *, fpos_t, int); -static int writef(void *, const char *, int); +static ssize_t readf(void *, char *, size_t); +static int seekf(void *, off64_t *, int); +static ssize_t writef(void *, const char *, size_t); static int closef(void *); +static cookie_io_functions_t cookief = {readf, writef, seekf, closef}; static int srccat(Char *, Char *); static int srcfile(char *, bool, bool); static void phup(int); @@ -189,14 +190,11 @@ * Fortunately this is not needed under the current implementation * of stdio. */ - (void) fclose(cshin); - (void) fclose(cshout); - (void) fclose(csherr); - if (!(cshin = funopen((void *) &SHIN, readf, writef, seekf, closef))) + if (!(cshin = fopencookie((void *) &SHIN, "r", cookief))) exit(1); - if (!(cshout = funopen((void *) &SHOUT, readf, writef, seekf, closef))) + if (!(cshout = fopencookie((void *) &SHOUT, "w", cookief))) exit(1); - if (!(csherr = funopen((void *) &SHERR, readf, writef, seekf, closef))) + if (!(csherr = fopencookie((void *) &SHERR, "w", cookief))) exit(1); (void) setvbuf(cshin, NULL, _IOLBF, 0); (void) setvbuf(cshout, NULL, _IOLBF, 0); @@ -1210,23 +1208,23 @@ */ #define DESC(a) (*((int *) (a)) - (didfds && *((int *) a) >= FSHIN ? FSHIN : 0)) -static int -readf(void *oreo, char *buf, int siz) +static ssize_t +readf(void *oreo, char *buf, size_t siz) { return read(DESC(oreo), buf, siz); } -static int -writef(void *oreo, const char *buf, int siz) +static ssize_t +writef(void *oreo, const char *buf, size_t siz) { return write(DESC(oreo), buf, siz); } -static fpos_t -seekf(void *oreo, fpos_t off, int whence) +static int +seekf(void *oreo, off64_t *off, int whence) { - return lseek(DESC(oreo), off, whence); + return lseek(DESC(oreo), (off_t) *off, whence); } debian/patches/series0000644000000000000000000000031611563215156012037 0ustar 01_gnu_source.diff 02_libbsd.diff 03_maxpathlen.diff 04_fpurge.diff 05_fhs_pathnames.diff 06_time_h_for_time_t.diff 07_funopen.diff 08_glob.diff 09_sys_signame.diff 10_groff_no_sgr.diff 11_groff_schar.diff debian/patches/11_groff_schar.diff0000644000000000000000000000165011563313315014236 0ustar Description: Make footnote marks legible in csh.txt Symptoms: . csh.2:296: warning: can't find special character `dg' csh.2:542: warning: can't find special character `dd' Bug: http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6604 Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110502/USD.doc/csh.1 =================================================================== --- csh-20110502.orig/USD.doc/csh.1 +++ csh-20110502/USD.doc/csh.1 @@ -34,6 +34,14 @@ .po 5n .ll 70n .\} +.\" If this is groff, i.e. if schar is available... +.if \n(.g \{ +.\" ... provide fallback definitions for dagger and double-dagger to make +.\" footnote marks legible in ASCII output. This is a no-op if they are +.\" supported by the output device (e.g. -Tps, -Tutf8). +.schar \(dg * +.schar \(dd ** +.\} .EH 'USD:4-%''An Introduction to the C shell' .OH 'An Introduction to the C shell''USD:4-%' .\".RP debian/patches/05_fhs_pathnames.diff0000644000000000000000000000103311563214000014560 0ustar Description: Adjust pathnames for FHS Forwarded: not-needed Author: Matej Vela Last-Update: 2011-05-13 Index: csh-20110313/pathnames.h =================================================================== --- csh-20110313.orig/pathnames.h +++ csh-20110313/pathnames.h @@ -36,5 +36,5 @@ #define _PATH_DOTCSHRC "/etc/csh.cshrc" #define _PATH_DOTLOGIN "/etc/csh.login" #define _PATH_DOTLOGOUT "/etc/csh.logout" -#define _PATH_LOGIN "/usr/bin/login" +#define _PATH_LOGIN "/bin/login" #define _PATH_USRBIN "/usr/bin" debian/control0000644000000000000000000000121311604601332010562 0ustar Source: csh Section: shells Priority: optional Maintainer: Matej Vela Standards-Version: 3.9.2 Build-Depends: debhelper (>= 8), groff, libbsd-dev, pmake Package: csh Architecture: any Provides: c-shell Depends: ${shlibs:Depends}, ${misc:Depends} Description: Shell with C-like syntax The C shell was originally written at UCB to overcome limitations in the Bourne shell. Its flexibility and comfort (at that time) quickly made it the shell of choice until more advanced shells like ksh, bash, zsh or tcsh appeared. Most of the latter incorporate features original to csh. . This package is based on current OpenBSD sources. debian/rules0000755000000000000000000000203312231757576010263 0ustar #!/usr/bin/make -f # Standard options minus `-Wall', since upstream uses `-Werror'. export CFLAGS := -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2) -Wno-error=unused-result %: dh $@ override_dh_auto_build: pmake cd USD.doc && pmake paper.ps paper.txt override_dh_auto_clean: pmake cleandir cd USD.doc && pmake cleandir override_dh_auto_test: true override_dh_auto_install: install -D csh debian/csh/bin/bsd-csh install -D -m 644 USD.doc/paper.txt debian/csh/usr/share/doc/csh/csh.txt install -D -m 644 USD.doc/paper.ps debian/csh/usr/share/doc/csh/csh.ps install -D -m 644 -p csh.1 debian/csh/usr/share/man/man1/bsd-csh.1 export CVSROOT := anoncvs@anoncvs.openbsd.org:/cvs export CVS_RSH := ssh get-orig-source: set -ex; \ tmpdir=`mktemp -d`; \ trap 'rm -rf "$$tmpdir"' EXIT; \ cd "$$tmpdir"; \ cvs export -r HEAD src/bin/csh; \ ver=`find -type f -printf '%TY%Tm%Td\n' | sort -r | head -n 1`; \ mv src/bin/csh csh-$$ver.orig; \ GZIP=-9 tar czf $(CURDIR)/csh_$$ver.orig.tar.gz csh-$$ver.orig .PHONY: get-orig-source debian/source/0000755000000000000000000000000011557510334010472 5ustar debian/source/format0000644000000000000000000000001411557013450011675 0ustar 3.0 (quilt)