[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] patch-2.6: problem report

From: Nelson H. F. Beebe
Subject: [bug-patch] patch-2.6: problem report
Date: Thu, 19 Nov 2009 18:30:05 -0700 (MST)

I've now successfully built, validated, and installed patch-2.6 on
about 25 flavors of Unix systems, with only a single failure
(described below).

However, on most, I had to make the same set of source code patches in
patch itself in order to get it to build:

(1) There are references to strndup() and strnlen(), which are
    nonstandard functions, and should have fallback implementations if
    they are not available in -lc.  I provided obvious simple versions.
    [As an aside, the prefix str...  is reserved in C89 and C99 for
    future library directions; it is a good idea to avoid that prefix
    in user code.]

    Also, strndup() is not declared before use; I added a suitable
    declaration in gl/lib/xstrndup.h:

        extern char *strndup (const char *string, size_t n);

(2) The ./update-version.sh script has no leading shell line, but it
    contains syntax that requires bash, rather than the original
    Bourne shell.  It should begin with "#! /bin/bash", or since that
    pathname does not exist on all platforms, be run as "bash

    I found in tests that it also works with dash, pdksh, and zsh, but
    not with ksh or sh, which produce errors like this:

        % ksh update-version.sh
        update-version.sh: line 13: syntax error at line 24: `(' unexpected

    It would be better to fix it so that it works with ANY
    Bourne-family shell.

(3) The following files require <stdbool.h>:


    That makes the code compilable only in a C99 environment, locking
    it out of many older systems.  I provided a small replacement
    stdbool.h file, and the master distribution of patch should be
    prepared to do that as well, if it really needs to use the _Bool

(4) It seems highly questionable to me that patch should be using
    multibyte features, since many programmers view that hack in C89
    and C99 as a poor substitute for proper Unicode support.  In
    particular, the lack of mbsinit() on SGI IRIX 6.5 MIPS prevents
    this version of patch from being built on that system.  I have
    patch-2.5.4 on that box, installed on 13-Sep-2000.  Yes, it is an
    old system, but it still works, and its compilers have superb

- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: address@hidden  -
- 155 S 1400 E RM 233                       address@hidden  address@hidden -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -

reply via email to

[Prev in Thread] Current Thread [Next in Thread]