Index: vendor/misc-GNU/patch/2.4/pch.c =================================================================== --- vendor/misc-GNU/patch/2.4/pch.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/pch.c (nonexistent) @@ -1,1823 +0,0 @@ -/* reading patches */ - -/* $Id: pch.c,v 1.23 1997/06/17 06:52:12 eggert Exp $ */ - -/* -Copyright 1986, 1987, 1988 Larry Wall -Copyright 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#define INITHUNKMAX 125 /* initial dynamic allocation size */ - -/* Patch (diff listing) abstract type. */ - -static FILE *pfp; /* patch file pointer */ -static int p_says_nonexistent[2]; /* [0] for old file, [1] for new; - value is 0 for nonempty, 1 for empty, 2 for nonexistent */ -static time_t p_timestamp[2]; /* timestamps in patch headers */ -static off_t p_filesize; /* size of the patch file */ -static LINENUM p_first; /* 1st line number */ -static LINENUM p_newfirst; /* 1st line number of replacement */ -static LINENUM p_ptrn_lines; /* # lines in pattern */ -static LINENUM p_repl_lines; /* # lines in replacement text */ -static LINENUM p_end = -1; /* last line in hunk */ -static LINENUM p_max; /* max allowed value of p_end */ -static LINENUM p_prefix_context; /* # of prefix context lines */ -static LINENUM p_suffix_context; /* # of suffix context lines */ -static LINENUM p_input_line; /* current line # from patch file */ -static char **p_line; /* the text of the hunk */ -static size_t *p_len; /* line length including \n if any */ -static char *p_Char; /* +, -, and ! */ -static LINENUM hunkmax = INITHUNKMAX; /* size of above arrays */ -static int p_indent; /* indent to patch */ -static file_offset p_base; /* where to intuit this time */ -static LINENUM p_bline; /* line # of p_base */ -static file_offset p_start; /* where intuit found a patch */ -static LINENUM p_sline; /* and the line number for it */ -static LINENUM p_hunk_beg; /* line number of current hunk */ -static LINENUM p_efake = -1; /* end of faked up lines--don't free */ -static LINENUM p_bfake = -1; /* beg of faked up lines */ - -enum nametype { OLD, NEW, INDEX, NONE }; - -static enum diff intuit_diff_type PARAMS ((void)); -static enum nametype best_name PARAMS ((char * const *, int const *)); -static int prefix_components PARAMS ((char *, int)); -static size_t pget_line PARAMS ((int)); -static size_t get_line PARAMS ((void)); -static bool incomplete_line PARAMS ((void)); -static bool grow_hunkmax PARAMS ((void)); -static void malformed PARAMS ((void)); -static void next_intuit_at PARAMS ((file_offset, LINENUM)); -static void skip_to PARAMS ((file_offset, LINENUM)); - -/* Prepare to look for the next patch in the patch file. */ - -void -re_patch() -{ - p_first = 0; - p_newfirst = 0; - p_ptrn_lines = 0; - p_repl_lines = 0; - p_end = -1; - p_max = 0; - p_indent = 0; -} - -/* Open the patch file at the beginning of time. */ - -void -open_patch_file(filename) - char const *filename; -{ - file_offset file_pos = 0; - struct stat st; - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -#if HAVE_SETMODE - if (binary_transput) - { - if (isatty (STDIN_FILENO)) - fatal ("cannot read binary data from tty on this platform"); - setmode (STDIN_FILENO, O_BINARY); - } -#endif - if (fstat (STDIN_FILENO, &st) != 0) - pfatal ("fstat"); - if (S_ISREG (st.st_mode) && (stdin_pos = file_tell (stdin)) != -1) - { - pfp = stdin; - file_pos = stdin_pos; - } - else - { - size_t charsread; - pfp = fopen (TMPPATNAME, "w+b"); - if (!pfp) - pfatal ("can't create `%s'", TMPPATNAME); - for (st.st_size = 0; - (charsread = fread (buf, 1, bufsize, stdin)) != 0; - st.st_size += charsread) - if (fwrite (buf, 1, charsread, pfp) != charsread) - write_fatal (); - if (ferror (stdin) || fclose (stdin) != 0) - read_fatal (); - if (fflush (pfp) != 0 - || file_seek (pfp, (file_offset) 0, SEEK_SET) != 0) - write_fatal (); - } - } - else - { - pfp = fopen (filename, binary_transput ? "rb" : "r"); - if (!pfp) - pfatal ("can't open patch file `%s'", filename); - if (fstat (fileno (pfp), &st) != 0) - pfatal ("fstat"); - } - p_filesize = st.st_size; - next_intuit_at (file_pos, (LINENUM) 1); - set_hunkmax(); -} - -/* Make sure our dynamically realloced tables are malloced to begin with. */ - -void -set_hunkmax() -{ - if (!p_line) - p_line = (char **) malloc (hunkmax * sizeof *p_line); - if (!p_len) - p_len = (size_t *) malloc (hunkmax * sizeof *p_len); - if (!p_Char) - p_Char = malloc (hunkmax * sizeof *p_Char); -} - -/* Enlarge the arrays containing the current hunk of patch. */ - -static bool -grow_hunkmax() -{ - hunkmax *= 2; - assert (p_line && p_len && p_Char); - if ((p_line = (char **) realloc (p_line, hunkmax * sizeof (*p_line))) - && (p_len = (size_t *) realloc (p_len, hunkmax * sizeof (*p_len))) - && (p_Char = realloc (p_Char, hunkmax * sizeof (*p_Char)))) - return TRUE; - if (!using_plan_a) - memory_fatal (); - /* Don't free previous values of p_line etc., - since some broken implementations free them for us. - Whatever is null will be allocated again from within plan_a (), - of all places. */ - return FALSE; -} - -/* True if the remainder of the patch file contains a diff of some sort. */ - -bool -there_is_another_patch() -{ - if (p_base != 0 && p_base >= p_filesize) { - if (verbosity == VERBOSE) - say ("done\n"); - return FALSE; - } - if (verbosity == VERBOSE) - say ("Hmm..."); - diff_type = intuit_diff_type(); - if (diff_type == NO_DIFF) { - if (verbosity == VERBOSE) - say (p_base - ? " Ignoring the trailing garbage.\ndone\n" - : " I can't seem to find a patch in there anywhere.\n"); - return FALSE; - } - if (skip_rest_of_patch) - { - Fseek (pfp, p_start, SEEK_SET); - p_input_line = p_sline - 1; - return TRUE; - } - if (verbosity == VERBOSE) - say (" %sooks like %s to me...\n", - (p_base == 0 ? "L" : "The next patch l"), - diff_type == UNI_DIFF ? "a unified diff" : - diff_type == CONTEXT_DIFF ? "a context diff" : - diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : - diff_type == NORMAL_DIFF ? "a normal diff" : - "an ed script" ); - - if (verbosity != SILENT) - { - if (p_indent) - say ("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s"); - if (! inname) - say ("can't find file to patch at input line %ld\n", - p_sline); - } - - skip_to(p_start,p_sline); - while (!inname) { - if (force || batch) { - say ("No file to patch. Skipping patch.\n"); - skip_rest_of_patch = TRUE; - return TRUE; - } - ask ("File to patch: "); - inname = fetchname (buf, 0, (time_t *) 0); - if (inname) - { - if (stat (inname, &instat) == 0) - { - inerrno = 0; - invc = -1; - } - else - { - perror (inname); - free (inname); - inname = 0; - } - } - if (!inname) { - ask ("Skip this patch? [y] "); - if (*buf != 'n') { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - return TRUE; - } - } - } - return TRUE; -} - -/* Determine what kind of diff is in the remaining part of the patch file. */ - -static enum diff -intuit_diff_type() -{ - register char *s; - register char *t; - register int indent; - register file_offset this_line = 0; - register file_offset previous_line; - register file_offset first_command_line = -1; - LINENUM fcl_line = 0; /* Pacify `gcc -W'. */ - register bool last_line_was_command = FALSE; - register bool this_is_a_command = FALSE; - register bool stars_last_line = FALSE; - register bool stars_this_line = FALSE; - enum nametype i; - char *name[3]; - struct stat st[3]; - int stat_errno[3]; - int version_controlled[3]; - register enum diff retval; - - name[OLD] = name[NEW] = name[INDEX] = 0; - version_controlled[OLD] = -1; - version_controlled[NEW] = -1; - version_controlled[INDEX] = -1; - p_timestamp[OLD] = p_timestamp[NEW] = (time_t) -1; - p_says_nonexistent[OLD] = p_says_nonexistent[NEW] = 0; - Fseek (pfp, p_base, SEEK_SET); - p_input_line = p_bline - 1; - for (;;) { - previous_line = this_line; - last_line_was_command = this_is_a_command; - stars_last_line = stars_this_line; - this_line = file_tell (pfp); - indent = 0; - if (! pget_line (0)) { - if (first_command_line >= 0) { - /* nothing but deletes!? */ - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - else { - p_start = this_line; - p_sline = p_input_line; - retval = NO_DIFF; - goto scan_exit; - } - } - for (s = buf; *s == ' ' || *s == '\t' || *s == 'X'; s++) { - if (*s == '\t') - indent = (indent + 8) & ~7; - else - indent++; - } - for (t = s; ISDIGIT (*t) || *t == ','; t++) - continue; - this_is_a_command = (ISDIGIT (*s) && - (*t == 'd' || *t == 'c' || *t == 'a') ); - if (first_command_line < 0 && this_is_a_command) { - first_command_line = this_line; - fcl_line = p_input_line; - p_indent = indent; /* assume this for now */ - } - if (!stars_last_line && strnEQ(s, "*** ", 4)) - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "--- ", 4)) - name[NEW] = fetchname (s+4, strippath, &p_timestamp[NEW]); - else if (strnEQ(s, "+++ ", 4)) - /* Swap with NEW below. */ - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "Index:", 6)) - name[INDEX] = fetchname (s+6, strippath, (time_t *) 0); - else if (strnEQ(s, "Prereq:", 7)) { - for (t = s + 7; ISSPACE ((unsigned char) *t); t++) - continue; - revision = t; - for (t = revision; *t && !ISSPACE ((unsigned char) *t); t++) - continue; - if (t == revision) - revision = 0; - else { - char oldc = *t; - *t = '\0'; - revision = savestr (revision); - *t = oldc; - } - } - if ((diff_type == NO_DIFF || diff_type == ED_DIFF) && - first_command_line >= 0 && - strEQ(s, ".\n") ) { - p_indent = indent; - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == UNI_DIFF) - && strnEQ(s, "@@ -", 4)) { - - /* `name' and `p_timestamp' are backwards; swap them. */ - time_t ti = p_timestamp[OLD]; - p_timestamp[OLD] = p_timestamp[NEW]; - p_timestamp[NEW] = ti; - t = name[OLD]; - name[OLD] = name[NEW]; - name[NEW] = t; - - s += 4; - if (! atol (s)) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - while (*s != ' ' && *s != '\n') - s++; - while (*s == ' ') - s++; - if (! atol (s)) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - p_indent = indent; - p_start = this_line; - p_sline = p_input_line; - retval = UNI_DIFF; - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW]))) - say ("missing header for unified diff at line %ld of patch\n", - p_sline); - goto scan_exit; - } - stars_this_line = strnEQ(s, "********", 8); - if ((diff_type == NO_DIFF - || diff_type == CONTEXT_DIFF - || diff_type == NEW_CONTEXT_DIFF) - && stars_last_line && strnEQ (s, "*** ", 4)) { - s += 4; - if (! atol (s)) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - /* if this is a new context diff the character just before */ - /* the newline is a '*'. */ - while (*s != '\n') - s++; - p_indent = indent; - p_start = previous_line; - p_sline = p_input_line - 1; - retval = (*(s-1) == '*' ? NEW_CONTEXT_DIFF : CONTEXT_DIFF); - - { - /* Scan the first hunk to see whether the file contents - appear to have been deleted. */ - file_offset saved_p_base = p_base; - LINENUM saved_p_bline = p_bline; - Fseek (pfp, previous_line, SEEK_SET); - p_input_line -= 2; - if (another_hunk (retval, 0) - && ! p_repl_lines && p_newfirst == 1) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - next_intuit_at (saved_p_base, saved_p_bline); - } - - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW]))) - say ("missing header for context diff at line %ld of patch\n", - p_sline); - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == NORMAL_DIFF) && - last_line_was_command && - (strnEQ(s, "< ", 2) || strnEQ(s, "> ", 2)) ) { - p_start = previous_line; - p_sline = p_input_line - 1; - p_indent = indent; - retval = NORMAL_DIFF; - goto scan_exit; - } - } - - scan_exit: - - /* To intuit `inname', the name of the file to patch, - use the algorithm specified by POSIX 1003.2b/D11 section 5.22.7.2 - (with some modifications if posixly_correct is zero): - - - Take the old and new names from the context header if present, - and take the index name from the `Index:' line if present and - if either the old and new names are both absent - or posixly_correct is nonzero. - Consider the file names to be in the order (old, new, index). - - If some named files exist, use the first one if posixly_correct - is nonzero, the best one otherwise. - - If patch_get is nonzero, and no named files exist, - but an RCS or SCCS master file exists, - use the first named file with an RCS or SCCS master. - - If no named files exist, no RCS or SCCS master was found, - some names are given, posixly_correct is zero, - and the patch appears to create a file, then use the best name - requiring the creation of the fewest directories. - - Otherwise, report failure by setting `inname' to 0; - this causes our invoker to ask the user for a file name. */ - - i = NONE; - - if (!inname) - { - enum nametype i0 = NONE; - - if (! posixly_correct && (name[OLD] || name[NEW]) && name[INDEX]) - { - free (name[INDEX]); - name[INDEX] = 0; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - if (i0 != NONE && strcmp (name[i0], name[i]) == 0) - { - /* It's the same name as before; reuse stat results. */ - stat_errno[i] = stat_errno[i0]; - if (! stat_errno[i]) - st[i] = st[i0]; - } - else if (stat (name[i], &st[i]) != 0) - stat_errno[i] = errno; - else - { - stat_errno[i] = 0; - if (posixly_correct) - break; - } - i0 = i; - } - - if (! posixly_correct) - { - i = best_name (name, stat_errno); - - if (i == NONE && patch_get) - { - enum nametype nope = NONE; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - char const *cs; - char *getbuf; - char *diffbuf; - int readonly = outfile && strcmp (outfile, name[i]) != 0; - - if (nope == NONE || strcmp (name[nope], name[i]) != 0) - { - cs = (version_controller - (name[i], readonly, (struct stat *) 0, - &getbuf, &diffbuf)); - version_controlled[i] = !! cs; - if (cs) - { - if (version_get (name[i], cs, 0, readonly, - getbuf, &st[i])) - stat_errno[i] = 0; - else - version_controlled[i] = 0; - - free (getbuf); - free (diffbuf); - - if (! stat_errno[i]) - break; - } - } - - nope = i; - } - } - - if (p_says_nonexistent[reverse ^ (i == NONE || st[i].st_size == 0)]) - { - assert (i0 != NONE); - if (ok_to_reverse - ("The next patch%s would %s the file `%s',\nwhich %s!", - reverse ? ", when reversed," : "", - (i == NONE ? "delete" - : st[i].st_size == 0 ? "empty out" - : "create"), - name[i == NONE || st[i].st_size == 0 ? i0 : i], - (i == NONE ? "does not exist" - : st[i].st_size == 0 ? "is already empty" - : "already exists"))) - reverse ^= 1; - } - - if (i == NONE && p_says_nonexistent[reverse]) - { - int newdirs[3]; - int newdirs_min = INT_MAX; - int distance_from_minimum[3]; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - newdirs[i] = (prefix_components (name[i], 0) - - prefix_components (name[i], 1)); - if (newdirs[i] < newdirs_min) - newdirs_min = newdirs[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - distance_from_minimum[i] = newdirs[i] - newdirs_min; - - i = best_name (name, distance_from_minimum); - } - } - } - - if (i == NONE) - inerrno = -1; - else - { - inname = name[i]; - name[i] = 0; - inerrno = stat_errno[i]; - invc = version_controlled[i]; - instat = st[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - free (name[i]); - - return retval; -} - -/* Count the path name components in FILENAME's prefix. - If CHECKDIRS is nonzero, count only existing directories. */ -static int -prefix_components (filename, checkdirs) - char *filename; - int checkdirs; -{ - int count = 0; - struct stat stat_buf; - int stat_result; - char *f = filename + FILESYSTEM_PREFIX_LEN (filename); - - if (*f) - while (*++f) - if (ISSLASH (f[0]) && ! ISSLASH (f[-1])) - { - if (checkdirs) - { - *f = '\0'; - stat_result = stat (filename, &stat_buf); - *f = '/'; - if (! (stat_result == 0 && S_ISDIR (stat_buf.st_mode))) - break; - } - - count++; - } - - return count; -} - -/* Return the index of the best of NAME[OLD], NAME[NEW], and NAME[INDEX]. - Ignore null names, and ignore NAME[i] if IGNORE[i] is nonzero. - Return NONE if all names are ignored. */ -static enum nametype -best_name (name, ignore) - char *const *name; - int const *ignore; -{ - enum nametype i; - int components[3]; - int components_min = INT_MAX; - size_t basename_len[3]; - size_t basename_len_min = (size_t) -1; - size_t len[3]; - size_t len_min = (size_t) -1; - - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i]) - { - /* Take the names with the fewest prefix components. */ - components[i] = prefix_components (name[i], 0); - if (components_min < components[i]) - continue; - components_min = components[i]; - - /* Of those, take the names with the shortest basename. */ - basename_len[i] = strlen (base_name (name[i])); - if (basename_len_min < basename_len[i]) - continue; - basename_len_min = basename_len[i]; - - /* Of those, take the shortest names. */ - len[i] = strlen (name[i]); - if (len_min < len[i]) - continue; - len_min = len[i]; - } - - /* Of those, take the first name. */ - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i] - && components[i] == components_min - && basename_len[i] == basename_len_min - && len[i] == len_min) - break; - - return i; -} - -/* Remember where this patch ends so we know where to start up again. */ - -static void -next_intuit_at(file_pos,file_line) -file_offset file_pos; -LINENUM file_line; -{ - p_base = file_pos; - p_bline = file_line; -} - -/* Basically a verbose fseek() to the actual diff listing. */ - -static void -skip_to(file_pos,file_line) -file_offset file_pos; -LINENUM file_line; -{ - register FILE *i = pfp; - register FILE *o = stdout; - register int c; - - assert(p_base <= file_pos); - if ((verbosity == VERBOSE || !inname) && p_base < file_pos) { - Fseek (i, p_base, SEEK_SET); - say ("The text leading up to this was:\n--------------------------\n"); - - while (file_tell (i) < file_pos) - { - putc ('|', o); - do - { - if ((c = getc (i)) == EOF) - read_fatal (); - putc (c, o); - } - while (c != '\n'); - } - - say ("--------------------------\n"); - } - else - Fseek (i, file_pos, SEEK_SET); - p_input_line = file_line - 1; -} - -/* Make this a function for better debugging. */ -static void -malformed () -{ - fatal ("malformed patch at line %ld: %s", p_input_line, buf); - /* about as informative as "Syntax error" in C */ -} - -/* 1 if there is more of the current diff listing to process; - 0 if not; -1 if ran out of memory. */ - -int -another_hunk (difftype, rev) - enum diff difftype; - int rev; -{ - register char *s; - register LINENUM context = 0; - register size_t chars_read; - - while (p_end >= 0) { - if (p_end == p_efake) - p_end = p_bfake; /* don't free twice */ - else - free(p_line[p_end]); - p_end--; - } - assert(p_end == -1); - p_efake = -1; - - p_max = hunkmax; /* gets reduced when --- found */ - if (difftype == CONTEXT_DIFF || difftype == NEW_CONTEXT_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - LINENUM repl_beginning = 0; /* index of --- line */ - register LINENUM fillcnt = 0; /* #lines of missing ptrn or repl */ - register LINENUM fillsrc; /* index of first line to copy */ - register LINENUM filldst; /* index of first missing line */ - bool ptrn_spaces_eaten = FALSE; /* ptrn was slightly misformed */ - bool some_context = FALSE; /* (perhaps internal) context seen */ - register bool repl_could_be_missing = TRUE; - bool repl_missing = FALSE; /* we are now backtracking */ - file_offset repl_backtrack_position = 0; - /* file pos of first repl line */ - LINENUM repl_patch_line; /* input line number for same */ - LINENUM repl_context; /* context for same */ - LINENUM ptrn_prefix_context = -1; /* lines in pattern prefix context */ - LINENUM ptrn_suffix_context = -1; /* lines in pattern suffix context */ - LINENUM repl_prefix_context = -1; /* lines in replac. prefix context */ - register LINENUM ptrn_copiable = 0; - /* # of copiable lines in ptrn */ - - /* Pacify `gcc -Wall'. */ - fillsrc = filldst = repl_patch_line = repl_context = 0; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 8 - || strncmp (buf, "********", 8) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_hunk_beg = p_input_line + 1; - while (p_end < p_max) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - return -1; - if (!chars_read) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - if (p_max - p_end < 4) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 3; - } else { - fatal ("unexpected end of file in patch"); - } - } - p_end++; - if (p_end == hunkmax) - fatal ("unterminated hunk starting at line %ld; giving up at line %ld: %s", - pch_hunk_beg (), p_input_line, buf); - assert(p_end < hunkmax); - p_Char[p_end] = *buf; - p_len[p_end] = 0; - p_line[p_end] = 0; - switch (*buf) { - case '*': - if (strnEQ(buf, "********", 8)) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - else - fatal ("unexpected end of hunk at line %ld", - p_input_line); - } - if (p_end != 0) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - fatal ("unexpected `***' at line %ld: %s", - p_input_line, buf); - } - context = 0; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) { - p_end--; - return -1; - } - for (s = buf; *s && !ISDIGIT (*s); s++) - continue; - if (!*s) - malformed (); - if (strnEQ(s,"0,0",3)) - remove_prefix (s, 2); - p_first = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - while (*s && !ISDIGIT (*s)) - s++; - if (!*s) - malformed (); - p_ptrn_lines = ((LINENUM)atol(s)) - p_first + 1; - } - else if (p_first) - p_ptrn_lines = 1; - else { - p_ptrn_lines = 0; - p_first = 1; - } - p_max = p_ptrn_lines + 6; /* we need this much at least */ - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - p_max = hunkmax; - break; - case '-': - if (buf[1] != '-') - goto change_line; - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - ptrn_suffix_context = context; - if (repl_beginning - || (p_end - != p_ptrn_lines + 1 + (p_Char[p_end - 1] == '\n'))) - { - if (p_end == 1) - { - /* `Old' lines were omitted. Set up to fill - them in from `new' context lines. */ - p_end = p_ptrn_lines + 1; - ptrn_prefix_context = ptrn_suffix_context = -1; - fillsrc = p_end + 1; - filldst = 1; - fillcnt = p_ptrn_lines; - } - else if (! repl_beginning) - fatal ("%s `---' at line %ld; check line numbers at line %ld", - (p_end <= p_ptrn_lines - ? "Premature" - : "Overdue"), - p_input_line, p_hunk_beg); - else if (! repl_could_be_missing) - fatal ("duplicate `---' at line %ld; check line numbers at line %ld", - p_input_line, p_hunk_beg + repl_beginning); - else - { - repl_missing = TRUE; - goto hunk_done; - } - } - repl_beginning = p_end; - repl_backtrack_position = file_tell (pfp); - repl_patch_line = p_input_line; - repl_context = context; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) - { - p_end--; - return -1; - } - p_Char[p_end] = '='; - for (s = buf; *s && ! ISDIGIT (*s); s++) - continue; - if (!*s) - malformed (); - p_newfirst = (LINENUM) atol (s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') - { - do - { - if (!*++s) - malformed (); - } - while (! ISDIGIT (*s)); - p_repl_lines = (LINENUM) atol (s) - p_newfirst + 1; - } - else if (p_newfirst) - p_repl_lines = 1; - else - { - p_repl_lines = 0; - p_newfirst = 1; - } - p_max = p_repl_lines + p_end; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - if (p_repl_lines != ptrn_copiable - && (p_prefix_context != 0 - || context != 0 - || p_repl_lines != 1)) - repl_could_be_missing = FALSE; - context = 0; - break; - case '+': case '!': - repl_could_be_missing = FALSE; - change_line: - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, " \n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - if (! repl_beginning) - { - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - } - else - { - if (repl_prefix_context == -1) - repl_prefix_context = context; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (s, chars_read))) { - p_end--; - return -1; - } - context = 0; - break; - case '\t': case '\n': /* assume spaces got eaten */ - s = buf; - if (*buf == '\t') { - s++; - chars_read--; - } - if (repl_beginning && repl_could_be_missing && - (!ptrn_spaces_eaten || difftype == NEW_CONTEXT_DIFF) ) { - repl_missing = TRUE; - goto hunk_done; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf, chars_read))) { - p_end--; - return -1; - } - if (p_end != p_ptrn_lines + 1) { - ptrn_spaces_eaten |= (repl_beginning != 0); - some_context = TRUE; - context++; - if (!repl_beginning) - ptrn_copiable++; - p_Char[p_end] = ' '; - } - break; - case ' ': - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, "\n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - some_context = TRUE; - context++; - if (!repl_beginning) - ptrn_copiable++; - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf + 2, chars_read))) { - p_end--; - return -1; - } - break; - default: - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - malformed (); - } - } - - hunk_done: - if (p_end >=0 && !repl_beginning) - fatal ("no `---' found in patch at line %ld", pch_hunk_beg ()); - - if (repl_missing) { - - /* reset state back to just after --- */ - p_input_line = repl_patch_line; - context = repl_context; - for (p_end--; p_end > repl_beginning; p_end--) - free(p_line[p_end]); - Fseek (pfp, repl_backtrack_position, SEEK_SET); - - /* redundant 'new' context lines were omitted - set */ - /* up to fill them in from the old file context */ - fillsrc = 1; - filldst = repl_beginning+1; - fillcnt = p_repl_lines; - p_end = p_max; - } - else if (!some_context && fillcnt == 1) { - /* the first hunk was a null hunk with no context */ - /* and we were expecting one line -- fix it up. */ - while (filldst < p_end) { - p_line[filldst] = p_line[filldst+1]; - p_Char[filldst] = p_Char[filldst+1]; - p_len[filldst] = p_len[filldst+1]; - filldst++; - } -#if 0 - repl_beginning--; /* this doesn't need to be fixed */ -#endif - p_end--; - p_first++; /* do append rather than insert */ - fillcnt = 0; - p_ptrn_lines = 0; - } - - p_prefix_context = ((repl_prefix_context == -1 - || (ptrn_prefix_context != -1 - && ptrn_prefix_context < repl_prefix_context)) - ? ptrn_prefix_context : repl_prefix_context); - p_suffix_context = ((ptrn_suffix_context != -1 - && ptrn_suffix_context < context) - ? ptrn_suffix_context : context); - assert (p_prefix_context != -1 && p_suffix_context != -1); - - if (difftype == CONTEXT_DIFF - && (fillcnt - || (p_first > 1 - && p_prefix_context + p_suffix_context < ptrn_copiable))) { - if (verbosity == VERBOSE) - say ("%s\n%s\n%s\n", -"(Fascinating -- this is really a new-style context diff but without", -"the telltale extra asterisks on the *** line that usually indicate", -"the new style...)"); - diff_type = difftype = NEW_CONTEXT_DIFF; - } - - /* if there were omitted context lines, fill them in now */ - if (fillcnt) { - p_bfake = filldst; /* remember where not to free() */ - p_efake = filldst + fillcnt - 1; - while (fillcnt-- > 0) { - while (fillsrc <= p_end && fillsrc != repl_beginning - && p_Char[fillsrc] != ' ') - fillsrc++; - if (p_end < fillsrc || fillsrc == repl_beginning) - fatal ("replacement text or line numbers mangled in hunk at line %ld", - p_hunk_beg); - p_line[filldst] = p_line[fillsrc]; - p_Char[filldst] = p_Char[fillsrc]; - p_len[filldst] = p_len[fillsrc]; - fillsrc++; filldst++; - } - while (fillsrc <= p_end && fillsrc != repl_beginning) - { - if (p_Char[fillsrc] == ' ') - fatal ("replacement text or line numbers mangled in hunk at line %ld", - p_hunk_beg); - fillsrc++; - } - if (debug & 64) - printf("fillsrc %ld, filldst %ld, rb %ld, e+1 %ld\n", - fillsrc,filldst,repl_beginning,p_end+1); - assert(fillsrc==p_end+1 || fillsrc==repl_beginning); - assert(filldst==p_end+1 || filldst==repl_beginning); - } - } - else if (difftype == UNI_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - register LINENUM fillsrc; /* index of old lines */ - register LINENUM filldst; /* index of new lines */ - char ch = '\0'; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 4 - || strncmp (buf, "@@ -", 4) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = buf+4; - if (!*s) - malformed (); - p_first = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s); - while (ISDIGIT (*s)) - s++; - } else - p_ptrn_lines = 1; - if (*s == ' ') s++; - if (*s != '+' || !*++s) - malformed (); - p_newfirst = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - p_repl_lines = (LINENUM) atol(++s); - while (ISDIGIT (*s)) - s++; - } else - p_repl_lines = 1; - if (*s == ' ') s++; - if (*s != '@') - malformed (); - if (!p_ptrn_lines) - p_first++; /* do append rather than insert */ - if (!p_repl_lines) - p_newfirst++; - p_max = p_ptrn_lines + p_repl_lines + 1; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - fillsrc = 1; - filldst = fillsrc + p_ptrn_lines; - p_end = filldst + p_repl_lines; - sprintf (buf,"*** %ld,%ld ****\n",p_first,p_first + p_ptrn_lines - 1); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - sprintf (buf,"--- %ld,%ld ----\n",p_newfirst,p_newfirst+p_repl_lines-1); - p_len[filldst] = strlen (buf); - if (! (p_line[filldst] = savestr (buf))) { - p_end = 0; - return -1; - } - p_Char[filldst++] = '='; - p_prefix_context = -1; - p_hunk_beg = p_input_line + 1; - while (fillsrc <= p_ptrn_lines || filldst <= p_end) { - chars_read = get_line (); - if (!chars_read) { - if (p_max - filldst < 3) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 2; - } else { - fatal ("unexpected end of file in patch"); - } - } - if (chars_read == (size_t) -1) - s = 0; - else if (*buf == '\t' || *buf == '\n') { - ch = ' '; /* assume the space got eaten */ - s = savebuf (buf, chars_read); - } - else { - ch = *buf; - s = savebuf (buf+1, --chars_read); - } - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - switch (ch) { - case '-': - if (fillsrc > p_ptrn_lines) { - free(s); - p_end = filldst-1; - malformed (); - } - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - break; - case '=': - ch = ' '; - /* FALL THROUGH */ - case ' ': - if (fillsrc > p_ptrn_lines) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - context++; - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - s = savebuf (s, chars_read); - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - /* FALL THROUGH */ - case '+': - if (filldst > p_end) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - chars_read -= filldst == p_end && incomplete_line (); - p_Char[filldst] = ch; - p_line[filldst] = s; - p_len[filldst++] = chars_read; - break; - default: - p_end = filldst; - malformed (); - } - if (ch != ' ') { - if (p_prefix_context == -1) - p_prefix_context = context; - context = 0; - } - }/* while */ - if (p_prefix_context == -1) - malformed (); - p_suffix_context = context; - } - else { /* normal diff--fake it up */ - char hunk_type; - register int i; - LINENUM min, max; - file_offset line_beginning = file_tell (pfp); - - p_prefix_context = p_suffix_context = 0; - chars_read = get_line (); - if (chars_read == (size_t) -1 || !chars_read || !ISDIGIT (*buf)) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_first = (LINENUM)atol(buf); - for (s = buf; ISDIGIT (*s); s++) - continue; - if (*s == ',') { - p_ptrn_lines = (LINENUM)atol(++s) - p_first + 1; - while (ISDIGIT (*s)) - s++; - } - else - p_ptrn_lines = (*s != 'a'); - hunk_type = *s; - if (hunk_type == 'a') - p_first++; /* do append rather than insert */ - min = (LINENUM)atol(++s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') - max = (LINENUM)atol(++s); - else - max = min; - if (hunk_type == 'd') - min++; - p_end = p_ptrn_lines + 1 + max - min + 1; - while (p_end >= hunkmax) - if (! grow_hunkmax ()) - { - p_end = -1; - return -1; - } - p_newfirst = min; - p_repl_lines = max - min + 1; - sprintf (buf, "*** %ld,%ld\n", p_first, p_first + p_ptrn_lines - 1); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - for (i=1; i<=p_ptrn_lines; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (buf[0] != '<' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`<' expected at line %ld of patch", p_input_line); - chars_read -= 2 + (i == p_ptrn_lines && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '-'; - } - if (hunk_type == 'c') { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (! chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (*buf != '-') - fatal ("`---' expected at line %ld of patch", p_input_line); - } - sprintf (buf, "--- %ld,%ld\n", min, max); - p_len[i] = strlen (buf); - if (! (p_line[i] = savestr (buf))) { - p_end = i-1; - return -1; - } - p_Char[i] = '='; - for (i++; i<=p_end; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (buf[0] != '>' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`>' expected at line %ld of patch", p_input_line); - chars_read -= 2 + (i == p_end && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '+'; - } - } - if (rev) /* backwards patch? */ - if (!pch_swap()) - say ("Not enough memory to swap next hunk!\n"); - if (debug & 2) { - LINENUM i; - char special; - - for (i=0; i <= p_end; i++) { - if (i == p_ptrn_lines) - special = '^'; - else - special = ' '; - fprintf (stderr, "%3ld %c %c ", i, p_Char[i], special); - pch_write_line (i, stderr); - fflush (stderr); - } - } - if (p_end+1 < hunkmax) /* paranoia reigns supreme... */ - p_Char[p_end+1] = '^'; /* add a stopper for apply_hunk */ - return 1; -} - -static size_t -get_line () -{ - return pget_line (p_indent); -} - -/* Input a line from the patch file, worrying about indentation. - Strip up to INDENT characters' worth of leading indentation. - Ignore any partial lines at end of input, but warn about them. - Succeed if a line was read; it is terminated by "\n\0" for convenience. - Return the number of characters read, including '\n' but not '\0'. - Return -1 if we ran out of memory. */ - -static size_t -pget_line (indent) - int indent; -{ - register FILE *fp = pfp; - register int c; - register int i = 0; - register char *b; - register size_t s; - - for (;;) - { - c = getc (fp); - if (c == EOF) - { - if (ferror (fp)) - read_fatal (); - return 0; - } - if (indent <= i) - break; - if (c == ' ' || c == 'X') - i++; - else if (c == '\t') - i = (i + 8) & ~7; - else - break; - } - - i = 0; - b = buf; - s = bufsize; - - for (;;) - { - if (i == s - 1) - { - s *= 2; - b = realloc (b, s); - if (!b) - { - if (!using_plan_a) - memory_fatal (); - return (size_t) -1; - } - buf = b; - bufsize = s; - } - b[i++] = c; - if (c == '\n') - break; - c = getc (fp); - if (c == EOF) - { - if (ferror (fp)) - read_fatal (); - say ("patch unexpectedly ends in middle of line\n"); - return 0; - } - } - - b[i] = '\0'; - p_input_line++; - return i; -} - -static bool -incomplete_line () -{ - register FILE *fp = pfp; - register int c; - register file_offset line_beginning = file_tell (fp); - - if (getc (fp) == '\\') - { - while ((c = getc (fp)) != '\n' && c != EOF) - continue; - return TRUE; - } - else - { - /* We don't trust ungetc. */ - Fseek (pfp, line_beginning, SEEK_SET); - return FALSE; - } -} - -/* Reverse the old and new portions of the current hunk. */ - -bool -pch_swap() -{ - char **tp_line; /* the text of the hunk */ - size_t *tp_len; /* length of each line */ - char *tp_char; /* +, -, and ! */ - register LINENUM i; - register LINENUM n; - bool blankline = FALSE; - register char *s; - - i = p_first; - p_first = p_newfirst; - p_newfirst = i; - - /* make a scratch copy */ - - tp_line = p_line; - tp_len = p_len; - tp_char = p_Char; - p_line = 0; /* force set_hunkmax to allocate again */ - p_len = 0; - p_Char = 0; - set_hunkmax(); - if (!p_line || !p_len || !p_Char) { - if (p_line) - free (p_line); - p_line = tp_line; - if (p_len) - free (p_len); - p_len = tp_len; - if (p_Char) - free (p_Char); - p_Char = tp_char; - return FALSE; /* not enough memory to swap hunk! */ - } - - /* now turn the new into the old */ - - i = p_ptrn_lines + 1; - if (tp_char[i] == '\n') { /* account for possible blank line */ - blankline = TRUE; - i++; - } - if (p_efake >= 0) { /* fix non-freeable ptr range */ - if (p_efake <= i) - n = p_end - i + 1; - else - n = -i; - p_efake += n; - p_bfake += n; - } - for (n=0; i <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '+') - p_Char[n] = '-'; - p_len[n] = tp_len[i]; - } - if (blankline) { - i = p_ptrn_lines + 1; - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - p_len[n] = tp_len[i]; - n++; - } - assert(p_Char[0] == '='); - p_Char[0] = '*'; - for (s=p_line[0]; *s; s++) - if (*s == '-') - *s = '*'; - - /* now turn the old into the new */ - - assert(tp_char[0] == '*'); - tp_char[0] = '='; - for (s=tp_line[0]; *s; s++) - if (*s == '*') - *s = '-'; - for (i=0; n <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '-') - p_Char[n] = '+'; - p_len[n] = tp_len[i]; - } - assert(i == p_ptrn_lines + 1); - i = p_ptrn_lines; - p_ptrn_lines = p_repl_lines; - p_repl_lines = i; - if (tp_line) - free (tp_line); - if (tp_len) - free (tp_len); - if (tp_char) - free (tp_char); - return TRUE; -} - -/* Return whether file WHICH (0 = old, 1 = new) appears to nonexistent. - Return 1 for empty, 2 for nonexistent. */ - -bool -pch_says_nonexistent (which) - int which; -{ - return p_says_nonexistent[which]; -} - -/* Return timestamp of patch header for file WHICH (0 = old, 1 = new), - or -1 if there was no timestamp or an error in the timestamp. */ - -time_t -pch_timestamp (which) - int which; -{ - return p_timestamp[which]; -} - -/* Return the specified line position in the old file of the old context. */ - -LINENUM -pch_first() -{ - return p_first; -} - -/* Return the number of lines of old context. */ - -LINENUM -pch_ptrn_lines() -{ - return p_ptrn_lines; -} - -/* Return the probable line position in the new file of the first line. */ - -LINENUM -pch_newfirst() -{ - return p_newfirst; -} - -/* Return the number of lines in the replacement text including context. */ - -LINENUM -pch_repl_lines() -{ - return p_repl_lines; -} - -/* Return the number of lines in the whole hunk. */ - -LINENUM -pch_end() -{ - return p_end; -} - -/* Return the number of context lines before the first changed line. */ - -LINENUM -pch_prefix_context () -{ - return p_prefix_context; -} - -/* Return the number of context lines after the last changed line. */ - -LINENUM -pch_suffix_context () -{ - return p_suffix_context; -} - -/* Return the length of a particular patch line. */ - -size_t -pch_line_len(line) -LINENUM line; -{ - return p_len[line]; -} - -/* Return the control character (+, -, *, !, etc) for a patch line. */ - -char -pch_char(line) -LINENUM line; -{ - return p_Char[line]; -} - -/* Return a pointer to a particular patch line. */ - -char * -pfetch(line) -LINENUM line; -{ - return p_line[line]; -} - -/* Output a patch line. */ - -bool -pch_write_line (line, file) - LINENUM line; - FILE *file; -{ - bool after_newline = p_line[line][p_len[line] - 1] == '\n'; - if (! fwrite (p_line[line], sizeof (*p_line[line]), p_len[line], file)) - write_fatal (); - return after_newline; -} - -/* Return where in the patch file this hunk began, for error messages. */ - -LINENUM -pch_hunk_beg() -{ - return p_hunk_beg; -} - -/* Apply an ed script by feeding ed itself. */ - -void -do_ed_script (ofp) - FILE *ofp; -{ - static char const ed_program[] = ed_PROGRAM; - - register char *t; - register file_offset beginning_of_this_line; - register bool this_line_is_command = FALSE; - register FILE *pipefp = 0; - register size_t chars_read; - - if (!skip_rest_of_patch) { - assert (! inerrno); - copy_file (inname, TMPOUTNAME, instat.st_mode); - sprintf (buf, "%s %s%s", ed_program, verbosity == VERBOSE ? "" : "- ", - TMPOUTNAME); - fflush (stdout); - pipefp = popen(buf, binary_transput ? "wb" : "w"); - if (!pipefp) - pfatal ("can't open pipe to `%s'", buf); - } - for (;;) { - beginning_of_this_line = file_tell (pfp); - chars_read = get_line (); - if (! chars_read) { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - for (t = buf; ISDIGIT (*t) || *t == ','; t++) - continue; - this_line_is_command = (ISDIGIT (*buf) && - (*t == 'd' || *t == 'c' || *t == 'a' || *t == 'i' || *t == 's') ); - if (this_line_is_command) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (*t != 'd' && *t != 's') { - while ((chars_read = get_line ()) != 0) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (chars_read == 2 && strEQ (buf, ".\n")) - break; - } - } - } - else { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - } - if (!pipefp) - return; - if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0 - || fflush (pipefp) != 0) - write_fatal (); - if (pclose (pipefp) != 0) - fatal ("%s FAILED", ed_program); - - if (ofp) - { - FILE *ifp = fopen (TMPOUTNAME, binary_transput ? "rb" : "r"); - int c; - if (!ifp) - pfatal ("can't open `%s'", TMPOUTNAME); - while ((c = getc (ifp)) != EOF) - if (putc (c, ofp) == EOF) - write_fatal (); - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - } -} Property changes on: vendor/misc-GNU/patch/2.4/pch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/acconfig.h =================================================================== --- vendor/misc-GNU/patch/2.4/acconfig.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/acconfig.h (nonexistent) @@ -1,14 +0,0 @@ -/* Local acconfig.h for autoheader. - Descriptive text for the C preprocessor macros that - the patch configure.in can define. - autoheader copies the comments into config.hin. */ - -/* Define if there is a member named d_ino in the struct describing - directory headers. */ -#undef D_INO_IN_DIRENT - -/* Define if memchr works. */ -#undef HAVE_MEMCHR - -/* Define if `struct utimbuf' is declared -- usually in . */ -#undef HAVE_STRUCT_UTIMBUF Property changes on: vendor/misc-GNU/patch/2.4/acconfig.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/pch.h =================================================================== --- vendor/misc-GNU/patch/2.4/pch.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/pch.h (nonexistent) @@ -1,25 +0,0 @@ -/* reading patches */ - -/* $Id: pch.h,v 1.8 1997/06/13 06:28:37 eggert Exp $ */ - -LINENUM pch_end PARAMS ((void)); -LINENUM pch_first PARAMS ((void)); -LINENUM pch_hunk_beg PARAMS ((void)); -LINENUM pch_newfirst PARAMS ((void)); -LINENUM pch_prefix_context PARAMS ((void)); -LINENUM pch_ptrn_lines PARAMS ((void)); -LINENUM pch_repl_lines PARAMS ((void)); -LINENUM pch_suffix_context PARAMS ((void)); -bool pch_swap PARAMS ((void)); -bool pch_write_line PARAMS ((LINENUM, FILE *)); -bool there_is_another_patch PARAMS ((void)); -char *pfetch PARAMS ((LINENUM)); -char pch_char PARAMS ((LINENUM)); -int another_hunk PARAMS ((enum diff, int)); -int pch_says_nonexistent PARAMS ((int)); -size_t pch_line_len PARAMS ((LINENUM)); -time_t pch_timestamp PARAMS ((int)); -void do_ed_script PARAMS ((FILE *)); -void open_patch_file PARAMS ((char const *)); -void re_patch PARAMS ((void)); -void set_hunkmax PARAMS ((void)); Property changes on: vendor/misc-GNU/patch/2.4/pch.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/basename.c =================================================================== --- vendor/misc-GNU/patch/2.4/basename.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/basename.c (nonexistent) @@ -1,32 +0,0 @@ -/* basename.c -- return the last element in a path */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#ifndef FILESYSTEM_PREFIX_LEN -#define FILESYSTEM_PREFIX_LEN(f) 0 -#endif - -#ifndef ISSLASH -#define ISSLASH(c) ((c) == '/') -#endif - -/* In general, we can't use the builtin `basename' function if available, - since it has different meanings in different environments. - In some environments the builtin `basename' modifies its argument. */ - -char * -base_name (name) - char const *name; -{ - char const *base = name += FILESYSTEM_PREFIX_LEN (name); - - for (; *name; name++) - if (ISSLASH (*name)) - base = name + 1; - - return (char *) base; -} Property changes on: vendor/misc-GNU/patch/2.4/basename.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/version.c =================================================================== --- vendor/misc-GNU/patch/2.4/version.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/version.c (nonexistent) @@ -1,30 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.c,v 1.5 1997/05/21 18:29:20 eggert Exp $ */ - -#define XTERN extern -#include -#undef XTERN -#define XTERN -#include -#include - -static char const copyright_string[] = "\ -Copyright 1988 Larry Wall\n\ -Copyright 1997 Free Software Foundation, Inc."; - -static char const free_software_msgid[] = "\ -This program comes with NO WARRANTY, to the extent permitted by law.\n\ -You may redistribute copies of this program\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the file named COPYING."; - -static char const authorship_msgid[] = "\ -written by Larry Wall with lots o' patches by Paul Eggert"; - -void -version() -{ - printf ("%s %s\n%s\n\n%s\n\n%s\n", program_name, PATCH_VERSION, - copyright_string, free_software_msgid, authorship_msgid); -} Property changes on: vendor/misc-GNU/patch/2.4/version.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/quotearg.c =================================================================== --- vendor/misc-GNU/patch/2.4/quotearg.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/quotearg.c (nonexistent) @@ -1,125 +0,0 @@ -/* Shell command argument quoting. - Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -/* Place into QUOTED a quoted version of ARG suitable for `system'. - Return the length of the resulting string (which is not null-terminated). - If QUOTED is null, return the length without any side effects. */ - -size_t -quote_system_arg (quoted, arg) - char *quoted; - char const *arg; -{ - char const *a; - size_t len = 0; - - /* Scan ARG, copying it to QUOTED if QUOTED is not null, - looking for shell metacharacters. */ - - for (a = arg; ; a++) - { - char c = *a; - switch (c) - { - case 0: - /* ARG has no shell metacharacters. */ - return len; - - case '=': - if (*arg == '-') - break; - /* Fall through. */ - case '\t': case '\n': case ' ': - case '!': case '"': case '#': case '$': case '%': case '&': case '\'': - case '(': case ')': case '*': case ';': - case '<': case '>': case '?': case '[': case '\\': - case '^': case '`': case '|': case '~': - { - /* ARG has a shell metacharacter. - Start over, quoting it this time. */ - - len = 0; - c = *arg++; - - /* If ARG is an option, quote just its argument. - This is not necessary, but it looks nicer. */ - if (c == '-' && arg < a) - { - c = *arg++; - - if (quoted) - { - quoted[len] = '-'; - quoted[len + 1] = c; - } - len += 2; - - if (c == '-') - while (arg < a) - { - c = *arg++; - if (quoted) - quoted[len] = c; - len++; - if (c == '=') - break; - } - c = *arg++; - } - - if (quoted) - quoted[len] = '\''; - len++; - - for (; c; c = *arg++) - { - if (c == '\'') - { - if (quoted) - { - quoted[len] = '\''; - quoted[len + 1] = '\\'; - quoted[len + 2] = '\''; - } - len += 3; - } - if (quoted) - quoted[len] = c; - len++; - } - - if (quoted) - quoted[len] = '\''; - return len + 1; - } - } - - if (quoted) - quoted[len] = c; - len++; - } -} Property changes on: vendor/misc-GNU/patch/2.4/quotearg.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/version.h =================================================================== --- vendor/misc-GNU/patch/2.4/version.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/version.h (nonexistent) @@ -1,5 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.h,v 1.3 1997/04/07 01:07:00 eggert Exp $ */ - -void version PARAMS ((void)); Property changes on: vendor/misc-GNU/patch/2.4/version.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/quotearg.h =================================================================== --- vendor/misc-GNU/patch/2.4/quotearg.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/quotearg.h (nonexistent) @@ -1,9 +0,0 @@ -/* quote.h -- declarations for quoting system arguments */ - -#if defined __STDC__ || __GNUC__ -# define __QUOTEARG_P(args) args -#else -# define __QUOTEARG_P(args) () -#endif - -size_t quote_system_arg __QUOTEARG_P ((char *, char const *)); Property changes on: vendor/misc-GNU/patch/2.4/quotearg.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/maketime.c =================================================================== --- vendor/misc-GNU/patch/2.4/maketime.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/maketime.c (nonexistent) @@ -1,391 +0,0 @@ -/* Convert struct partime into time_t. */ - -/* Copyright 1992, 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif - /* MIPS RISCOS4.52 defines time_t in not . */ -# include -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#include - -char const maketId[] = - "$Id: maketime.c,v 5.15 1997/06/17 16:54:36 eggert Exp $"; - -static int isleap P ((int)); -static int month_days P ((struct tm const *)); -static time_t maketime P ((struct partime const *, time_t)); - -/* For maximum portability, use only localtime and gmtime. - Make no assumptions about the time_t epoch or the range of time_t values. - Avoid mktime because it's not universal and because there's no easy, - portable way for mktime to yield the inverse of gmtime. */ - -#define TM_YEAR_ORIGIN 1900 - -static int -isleap (y) - int y; -{ - return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); -} - -/* days in year before start of months 0-12 */ -static int const month_yday[] = -{ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 -}; - -/* Yield the number of days in TM's month. */ -static int -month_days (tm) - struct tm const *tm; -{ - int m = tm->tm_mon; - return (month_yday[m + 1] - month_yday[m] - + (m == 1 && isleap (tm->tm_year + TM_YEAR_ORIGIN))); -} - -/* Convert UNIXTIME to struct tm form. - Use gmtime if available and if !LOCALZONE, localtime otherwise. */ -struct tm * -time2tm (unixtime, localzone) - time_t unixtime; - int localzone; -{ - struct tm *tm; -#ifdef TZ_is_unset - static char const *TZ; - if (!TZ && !(TZ = getenv ("TZ"))) - TZ_is_unset ("The TZ environment variable is not set; please set it to your timezone"); -#endif - if (localzone || !(tm = gmtime (&unixtime))) - tm = localtime (&unixtime); - return tm; -} - -/* Yield A - B, measured in seconds. */ -time_t -difftm (a, b) - struct tm const *a; - struct tm const *b; -{ - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); - int ac = ay / 100 - (ay % 100 < 0); - int bc = by / 100 - (by % 100 < 0); - int difference_in_day_of_year = a->tm_yday - b->tm_yday; - int intervening_leap_days = (((ay >> 2) - (by >> 2)) - - (ac - bc) - + ((ac >> 2) - (bc >> 2))); - time_t difference_in_years = ay - by; - time_t difference_in_days - = (difference_in_years * 365 - + (intervening_leap_days + difference_in_day_of_year)); - return (((((difference_in_days * 24 - + (a->tm_hour - b->tm_hour)) - * 60) - + (a->tm_min - b->tm_min)) - * 60) - + (a->tm_sec - b->tm_sec)); -} - -/* - * Adjust time T by adding SECONDS. SECONDS must be at most 24 hours' worth. - * Adjust only T's year, mon, mday, hour, min and sec members; - * plus adjust wday if it is defined. - */ -void -adjzone (t, seconds) - register struct tm *t; - long seconds; -{ - /* - * This code can be off by a second if SECONDS is not a multiple of 60, - * if T is local time, and if a leap second happens during this minute. - * But this bug has never occurred, and most likely will not ever occur. - * Liberia, the last country for which SECONDS % 60 was nonzero, - * switched to UTC in May 1972; the first leap second was in June 1972. - */ - int leap_second = t->tm_sec == 60; - long sec = seconds + (t->tm_sec - leap_second); - if (sec < 0) - { - if ((t->tm_min -= (59 - sec) / 60) < 0) - { - if ((t->tm_hour -= (59 - t->tm_min) / 60) < 0) - { - t->tm_hour += 24; - if (TM_DEFINED (t->tm_wday) && --t->tm_wday < 0) - t->tm_wday = 6; - if (--t->tm_mday <= 0) - { - if (--t->tm_mon < 0) - { - --t->tm_year; - t->tm_mon = 11; - } - t->tm_mday = month_days (t); - } - } - t->tm_min += 24 * 60; - } - sec += 24L * 60 * 60; - } - else if (60 <= (t->tm_min += sec / 60)) - if (24 <= (t->tm_hour += t->tm_min / 60)) - { - t->tm_hour -= 24; - if (TM_DEFINED (t->tm_wday) && ++t->tm_wday == 7) - t->tm_wday = 0; - if (month_days (t) < ++t->tm_mday) - { - if (11 < ++t->tm_mon) - { - ++t->tm_year; - t->tm_mon = 0; - } - t->tm_mday = 1; - } - } - t->tm_min %= 60; - t->tm_sec = (int) (sec % 60) + leap_second; -} - -/* - * Convert TM to time_t, using localtime if LOCALZONE and gmtime otherwise. - * Use only TM's year, mon, mday, hour, min, and sec members. - * Ignore TM's old tm_yday and tm_wday, but fill in their correct values. - * Yield -1 on failure (e.g. a member out of range). - * Posix 1003.1-1990 doesn't allow leap seconds, but some implementations - * have them anyway, so allow them if localtime/gmtime does. - */ -time_t -tm2time (tm, localzone) - struct tm *tm; - int localzone; -{ - /* Cache the most recent t,tm pairs; 1 for gmtime, 1 for localtime. */ - static time_t t_cache[2]; - static struct tm tm_cache[2]; - - time_t d, gt; - struct tm const *gtm; - /* - * The maximum number of iterations should be enough to handle any - * combinations of leap seconds, time zone rule changes, and solar time. - * 4 is probably enough; we use a bigger number just to be safe. - */ - int remaining_tries = 8; - - /* Avoid subscript errors. */ - if (12 <= (unsigned) tm->tm_mon) - return -1; - - tm->tm_yday = month_yday[tm->tm_mon] + tm->tm_mday - - (tm->tm_mon < 2 || !isleap (tm->tm_year + TM_YEAR_ORIGIN)); - - /* Make a first guess. */ - gt = t_cache[localzone]; - gtm = gt ? &tm_cache[localzone] : time2tm (gt, localzone); - - /* Repeatedly use the error from the guess to improve the guess. */ - while ((d = difftm (tm, gtm)) != 0) - { - if (--remaining_tries == 0) - return -1; - gt += d; - gtm = time2tm (gt, localzone); - } - - /* - * Check that the guess actually matches; - * overflow can cause difftm to yield 0 even on differing times, - * or tm may have members out of range (e.g. bad leap seconds). - */ -#define TM_DIFFER(a,b) \ - ( \ - ((a)->tm_year ^ (b)->tm_year) | \ - ((a)->tm_mon ^ (b)->tm_mon) | \ - ((a)->tm_mday ^ (b)->tm_mday) | \ - ((a)->tm_hour ^ (b)->tm_hour) | \ - ((a)->tm_min ^ (b)->tm_min) | \ - ((a)->tm_sec ^ (b)->tm_sec) \ - ) - if (TM_DIFFER (tm, gtm)) - { - /* - * If gt is a leap second, try gt+1; if it is one greater than - * a leap second, try gt-1; otherwise, it doesn't matter. - * Leap seconds always fall at month end. - */ - int yd = tm->tm_year - gtm->tm_year; - gt += yd + (yd ? 0 : tm->tm_mon - gtm->tm_mon); - gtm = time2tm (gt, localzone); - if (TM_DIFFER (tm, gtm)) - return -1; - } - t_cache[localzone] = gt; - tm_cache[localzone] = *gtm; - - tm->tm_wday = gtm->tm_wday; - return gt; -} - -/* - * Check *PT and convert it to time_t. - * If it is incompletely specified, use DEFAULT_TIME to fill it out. - * Use localtime if PT->zone is the special value TM_LOCAL_ZONE. - * Yield -1 on failure. - * ISO 8601 day-of-year and week numbers are not yet supported. - */ -static time_t -maketime (pt, default_time) - struct partime const *pt; - time_t default_time; -{ - int localzone, wday; - struct tm tm; - struct tm *tm0 = 0; - time_t r; - - tm0 = 0; /* Keep gcc -Wall happy. */ - localzone = pt->zone == TM_LOCAL_ZONE; - - tm = pt->tm; - - if (TM_DEFINED (pt->ymodulus) || !TM_DEFINED (tm.tm_year)) - { - /* Get tm corresponding to default time. */ - tm0 = time2tm (default_time, localzone); - if (!localzone) - adjzone (tm0, pt->zone); - } - - if (TM_DEFINED (pt->ymodulus)) - tm.tm_year += - (tm0->tm_year + TM_YEAR_ORIGIN) / pt->ymodulus * pt->ymodulus; - else if (!TM_DEFINED (tm.tm_year)) - { - /* Set default year, month, day from current time. */ - tm.tm_year = tm0->tm_year + TM_YEAR_ORIGIN; - if (!TM_DEFINED (tm.tm_mon)) - { - tm.tm_mon = tm0->tm_mon; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = tm0->tm_mday; - } - } - - /* Convert from partime year (Gregorian) to Posix year. */ - tm.tm_year -= TM_YEAR_ORIGIN; - - /* Set remaining default fields to be their minimum values. */ - if (!TM_DEFINED (tm.tm_mon)) - tm.tm_mon = 0; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = 1; - if (!TM_DEFINED (tm.tm_hour)) - tm.tm_hour = 0; - if (!TM_DEFINED (tm.tm_min)) - tm.tm_min = 0; - if (!TM_DEFINED (tm.tm_sec)) - tm.tm_sec = 0; - - if (!localzone) - adjzone (&tm, -pt->zone); - wday = tm.tm_wday; - - /* Convert and fill in the rest of the tm. */ - r = tm2time (&tm, localzone); - - /* Check weekday. */ - if (r != -1 && TM_DEFINED (wday) && wday != tm.tm_wday) - return -1; - - return r; -} - -/* Parse a free-format date in SOURCE, yielding a Unix format time. */ -time_t -str2time (source, default_time, default_zone) - char const *source; - time_t default_time; - long default_zone; -{ - struct partime pt; - - if (*partime (source, &pt)) - return -1; - if (pt.zone == TM_UNDEFINED_ZONE) - pt.zone = default_zone; - return maketime (&pt, default_time); -} - -#if TEST -#include -int -main (argc, argv) - int argc; - char **argv; -{ - time_t default_time = time ((time_t *) 0); - long default_zone = argv[1] ? atol (argv[1]) : 0; - char buf[1000]; - while (fgets (buf, sizeof (buf), stdin)) - { - time_t t = str2time (buf, default_time, default_zone); - printf ("%s", asctime (gmtime (&t))); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/2.4/maketime.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/common.h =================================================================== --- vendor/misc-GNU/patch/2.4/common.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/common.h (nonexistent) @@ -1,307 +0,0 @@ -/* common definitions for `patch' */ - -/* $Id: common.h,v 1.18 1997/06/13 06:28:37 eggert Exp $ */ - -/* -Copyright 1986, 1988 Larry Wall -Copyright 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef DEBUGGING -#define DEBUGGING 1 -#endif - -/* We must define `volatile' and `const' first (the latter inside config.h), - so that they're used consistently in all system includes. */ -#ifndef __STDC__ -# ifndef volatile -# define volatile -# endif -#endif - -/* Enable support for fseeko and ftello on hosts - where it is available but is turned off by default. - This must be defined before any system file is included. */ -#define _LARGEFILE_SOURCE 1 - -#include - -#include -#include -#include -#include - -#include -#if ! defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if ! defined S_ISREG && defined S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#ifndef S_IXOTH -#define S_IXOTH 1 -#endif -#ifndef S_IWOTH -#define S_IWOTH 2 -#endif -#ifndef S_IROTH -#define S_IROTH 4 -#endif -#ifndef S_IXGRP -#define S_IXGRP (S_IXOTH << 3) -#endif -#ifndef S_IWGRP -#define S_IWGRP (S_IWOTH << 3) -#endif -#ifndef S_IRGRP -#define S_IRGRP (S_IROTH << 3) -#endif -#ifndef S_IXUSR -#define S_IXUSR (S_IXOTH << 6) -#endif -#ifndef S_IWUSR -#define S_IWUSR (S_IWOTH << 6) -#endif -#ifndef S_IRUSR -#define S_IRUSR (S_IROTH << 6) -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif -#ifndef LONG_MIN -#define LONG_MIN (-1-2147483647L) -#endif - -#include -/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to macros like `isspace'. */ -#if STDC_HEADERS -#define CTYPE_DOMAIN(c) 1 -#else -#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#ifndef ISSPACE -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#endif - -#ifndef ISDIGIT -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#endif - - -#ifndef FILESYSTEM_PREFIX_LEN -#define FILESYSTEM_PREFIX_LEN(f) 0 -#endif - -#ifndef ISSLASH -#define ISSLASH(c) ((c) == '/') -#endif - - -/* constants */ - -/* AIX predefines these. */ -#ifdef TRUE -#undef TRUE -#endif -#ifdef FALSE -#undef FALSE -#endif -#define TRUE 1 -#define FALSE 0 - -/* handy definitions */ - -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) - -/* typedefs */ - -typedef int bool; /* must promote to itself */ -typedef long LINENUM; /* must be signed */ - -/* globals */ - -extern char const program_name[]; - -XTERN char *buf; /* general purpose buffer */ -XTERN size_t bufsize; /* allocated size of buf */ - -XTERN bool using_plan_a; /* try to keep everything in memory */ - -XTERN char *inname; -XTERN char *outfile; -XTERN int inerrno; -XTERN int invc; -XTERN struct stat instat; -XTERN bool dry_run; -XTERN bool posixly_correct; - -XTERN char const *origprae; -XTERN char const *origbase; - -XTERN char const * volatile TMPOUTNAME; -XTERN char const * volatile TMPINNAME; -XTERN char const * volatile TMPPATNAME; - -#ifdef DEBUGGING -XTERN int debug; -#else -# define debug 0 -#endif -XTERN bool force; -XTERN bool batch; -XTERN bool noreverse; -XTERN int reverse; -XTERN enum { DEFAULT_VERBOSITY, SILENT, VERBOSE } verbosity; -XTERN bool skip_rest_of_patch; -XTERN int strippath; -XTERN bool canonicalize; -XTERN int patch_get; -XTERN int set_time; -XTERN int set_utc; - -enum diff - { - NO_DIFF, - CONTEXT_DIFF, - NORMAL_DIFF, - ED_DIFF, - NEW_CONTEXT_DIFF, - UNI_DIFF - }; - -XTERN enum diff diff_type; - -XTERN char *revision; /* prerequisite revision, if any */ - -#ifdef __STDC__ -# define GENERIC_OBJECT void -#else -# define GENERIC_OBJECT char -#endif - -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ -# define __attribute__(x) -#endif - -#ifndef PARAMS -# ifdef __STDC__ -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -GENERIC_OBJECT *xmalloc PARAMS ((size_t)); -void fatal_exit PARAMS ((int)) __attribute__ ((noreturn)); - -#include -#if !STDC_HEADERS && !defined errno -extern int errno; -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#else -# if !HAVE_MEMCHR -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# define memcpy(d, s, n) bcopy (s, d, n) -GENERIC_OBJECT *memchr (); -# endif -#endif - -#if STDC_HEADERS -# include -#else -long atol (); -char *getenv (); -GENERIC_OBJECT *malloc (); -GENERIC_OBJECT *realloc (); -#endif - -#if HAVE_UNISTD_H -# include -#endif -#ifndef lseek -off_t lseek (); -#endif -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif -#if _LFS_LARGEFILE - typedef off_t file_offset; -# define file_seek fseeko -# define file_tell ftello -#else - typedef long file_offset; -# define file_seek fseek -# define file_tell ftell -#endif - -#if HAVE_FCNTL_H -# include -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif -#ifndef O_WRONLY -#define O_WRONLY 1 -#endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif -#ifndef _O_BINARY -#define _O_BINARY 0 -#endif -#ifndef O_BINARY -#define O_BINARY _O_BINARY -#endif -#ifndef O_CREAT -#define O_CREAT 0 -#endif -#ifndef O_TRUNC -#define O_TRUNC 0 -#endif - -#if HAVE_SETMODE - XTERN int binary_transput; /* O_BINARY if binary i/o is desired */ -#else -# define binary_transput 0 -#endif - -#ifndef NULL_DEVICE -#define NULL_DEVICE "/dev/null" -#endif - -#ifndef TTY_DEVICE -#define TTY_DEVICE "/dev/tty" -#endif Property changes on: vendor/misc-GNU/patch/2.4/common.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/memchr.c =================================================================== --- vendor/misc-GNU/patch/2.4/memchr.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/memchr.c (nonexistent) @@ -1,199 +0,0 @@ -/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. - Based on strlen implementation by Torbjorn Granlund (tege@sics.se), - with help from Dan Sahlin (dan@sics.se) and - commentary by Jim Blandy (jimb@ai.mit.edu); - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), - and implemented by Roland McGrath (roland@ai.mit.edu). - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#undef __ptr_t -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -# define __ptr_t void * -#else /* Not C++ or ANSI C. */ -# define __ptr_t char * -#endif /* C++ or ANSI C. */ - -#if defined (_LIBC) -# include -#endif - -#if defined (HAVE_LIMITS_H) || defined (_LIBC) -# include -#endif - -#define LONG_MAX_32_BITS 2147483647 - -#ifndef LONG_MAX -#define LONG_MAX LONG_MAX_32_BITS -#endif - -#include - - -/* Search no more than N bytes of S for C. */ - -__ptr_t -memchr (s, c, n) - const __ptr_t s; - int c; - size_t n; -{ - const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; - - c = (unsigned char) c; - - /* Handle the first few characters by reading one character at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && ((unsigned long int) char_ptr - & (sizeof (longword) - 1)) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (__ptr_t) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to 8-byte longwords. */ - - longword_ptr = (unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - if (sizeof (longword) != 4 && sizeof (longword) != 8) - abort (); - -#if LONG_MAX <= LONG_MAX_32_BITS - magic_bits = 0x7efefeff; -#else - magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; -#endif - - /* Set up a longword, each of whose bytes is C. */ - charmask = c | (c << 8); - charmask |= charmask << 16; -#if LONG_MAX > LONG_MAX_32_BITS - charmask |= charmask << 32; -#endif - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof (longword)) - { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) - { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ - - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (__ptr_t) cp; - if (cp[1] == c) - return (__ptr_t) &cp[1]; - if (cp[2] == c) - return (__ptr_t) &cp[2]; - if (cp[3] == c) - return (__ptr_t) &cp[3]; -#if LONG_MAX > 2147483647 - if (cp[4] == c) - return (__ptr_t) &cp[4]; - if (cp[5] == c) - return (__ptr_t) &cp[5]; - if (cp[6] == c) - return (__ptr_t) &cp[6]; - if (cp[7] == c) - return (__ptr_t) &cp[7]; -#endif - } - - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - while (n-- > 0) - { - if (*char_ptr == c) - return (__ptr_t) char_ptr; - else - ++char_ptr; - } - - return 0; -} Property changes on: vendor/misc-GNU/patch/2.4/memchr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/maketime.h =================================================================== --- vendor/misc-GNU/patch/2.4/maketime.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/maketime.h (nonexistent) @@ -1,39 +0,0 @@ -/* Yield time_t from struct partime yielded by partime. */ - -/* Copyright 1993, 1994, 1995 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if defined __STDC__ || has_prototypes -# define __MAKETIME_P(x) x -#else -# define __MAKETIME_P(x) () -#endif - -struct tm *time2tm __MAKETIME_P ((time_t, int)); -time_t difftm __MAKETIME_P ((struct tm const *, struct tm const *)); -time_t str2time __MAKETIME_P ((char const *, time_t, long)); -time_t tm2time __MAKETIME_P ((struct tm *, int)); -void adjzone __MAKETIME_P ((struct tm *, long)); Property changes on: vendor/misc-GNU/patch/2.4/maketime.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/addext.c =================================================================== --- vendor/misc-GNU/patch/2.4/addext.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/addext.c (nonexistent) @@ -1,106 +0,0 @@ -/* addext.c -- add an extension to a file name - Copyright (C) 1990, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie and Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifndef HAVE_DOS_FILE_NAMES -#define HAVE_DOS_FILE_NAMES 0 -#endif -#ifndef HAVE_LONG_FILE_NAMES -#define HAVE_LONG_FILE_NAMES 0 -#endif - -#include - -#if HAVE_LIMITS_H -# include -#endif -#ifndef _POSIX_NAME_MAX -#define _POSIX_NAME_MAX 14 -#endif - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - -/* Append to FILENAME the extension EXT, unless the result would be too long, - in which case just append the character E. */ - -void -addext (filename, ext, e) - char *filename; - char const *ext; - int e; -{ - char *s = base_name (filename); - size_t slen = strlen (s), extlen = strlen (ext); - long slen_max = -1; - -#if HAVE_PATHCONF && defined _PC_NAME_MAX - if (slen + extlen <= _POSIX_NAME_MAX && ! HAVE_DOS_FILE_NAMES) - /* The file name is so short there's no need to call pathconf. */ - slen_max = _POSIX_NAME_MAX; - else if (s == filename) - slen_max = pathconf (".", _PC_NAME_MAX); - else - { - char c = *s; - *s = 0; - slen_max = pathconf (filename, _PC_NAME_MAX); - *s = c; - } -#endif - if (slen_max < 0) - slen_max = HAVE_LONG_FILE_NAMES ? 255 : 14; - - if (HAVE_DOS_FILE_NAMES && slen_max <= 12) - { - /* Live within DOS's 8.3 limit. */ - char *dot = strchr (s, '.'); - if (dot) - { - slen -= dot + 1 - s; - s = dot + 1; - slen_max = 3; - } - else - slen_max = 8; - extlen = 9; /* Don't use EXT. */ - } - - if (slen + extlen <= slen_max) - strcpy (s + slen, ext); - else - { - if (slen_max <= slen) - slen = slen_max - 1; - s[slen] = e; - s[slen + 1] = 0; - } -} Property changes on: vendor/misc-GNU/patch/2.4/addext.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/patch.c =================================================================== --- vendor/misc-GNU/patch/2.4/patch.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/patch.c (nonexistent) @@ -1,1293 +0,0 @@ -/* patch - a program to apply diffs to original files */ - -/* $Id: patch.c,v 1.22 1997/06/17 22:32:49 eggert Exp $ */ - -/* -Copyright 1984, 1985, 1986, 1987, 1988 Larry Wall -Copyright 1989, 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN -#include -#undef XTERN -#define XTERN extern -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_UTIME_H -# include -#endif -/* Some nonstandard hosts don't declare this structure even in . */ -#if ! HAVE_STRUCT_UTIMBUF -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif - -/* Output stream state. */ -struct outstate -{ - FILE *ofp; - int after_newline; - int zero_output; -}; - -/* procedures */ - -static FILE *create_output_file PARAMS ((char const *)); -static LINENUM locate_hunk PARAMS ((LINENUM)); -static bool apply_hunk PARAMS ((struct outstate *, LINENUM)); -static bool copy_till PARAMS ((struct outstate *, LINENUM)); -static bool patch_match PARAMS ((LINENUM, LINENUM, LINENUM, LINENUM)); -static bool similar PARAMS ((char const *, size_t, char const *, size_t)); -static bool spew_output PARAMS ((struct outstate *)); -static char const *make_temp PARAMS ((int)); -static int numeric_string PARAMS ((char const *, int, char const *)); -static void abort_hunk PARAMS ((void)); -static void cleanup PARAMS ((void)); -static void get_some_switches PARAMS ((void)); -static void init_output PARAMS ((char const *, struct outstate *)); -static void init_reject PARAMS ((char const *)); -static void reinitialize_almost_everything PARAMS ((void)); -static void usage PARAMS ((FILE *, int)) __attribute__((noreturn)); - -static int backup_if_mismatch; -static int remove_empty_files; - -/* TRUE if -R was specified on command line. */ -static int reverse_flag_specified; - -/* how many input lines have been irretractably output */ -static LINENUM last_frozen_line; - -static char const *do_defines; /* symbol to patch using ifdef, ifndef, etc. */ -static char const if_defined[] = "\n#ifdef %s\n"; -static char const not_defined[] = "#ifndef %s\n"; -static char const else_defined[] = "\n#else\n"; -static char const end_defined[] = "\n#endif /* %s */\n"; - -static int Argc; -static char * const *Argv; - -static FILE *rejfp; /* reject file pointer */ - -static char const *patchname; -static char *rejname; -static char const * volatile TMPREJNAME; - -static LINENUM last_offset; -static LINENUM maxfuzz = 2; - -static char serrbuf[BUFSIZ]; - -char const program_name[] = "patch"; - -/* Apply a set of diffs as appropriate. */ - -int main PARAMS ((int, char **)); - -int -main(argc,argv) -int argc; -char **argv; -{ - char const *val; - bool somefailed = FALSE; - struct outstate outstate; - - init_time (); - - setbuf(stderr, serrbuf); - - bufsize = 8 * 1024; - buf = xmalloc (bufsize); - - strippath = INT_MAX; - - posixly_correct = getenv ("POSIXLY_CORRECT") != 0; - backup_if_mismatch = ! posixly_correct; - patch_get = ((val = getenv ("PATCH_GET")) - ? numeric_string (val, 1, "PATCH_GET value") - : posixly_correct - 1); - - { - char const *v; - - v = getenv ("SIMPLE_BACKUP_SUFFIX"); - if (v && *v) - simple_backup_suffix = v; - - v = getenv ("PATCH_VERSION_CONTROL"); - if (! v) - v = getenv ("VERSION_CONTROL"); - if (v && *v) - backup_type = get_version (v); - } - - /* Cons up the names of the global temporary files. - Do this before `cleanup' can possibly be called (e.g. by `pfatal'). */ - TMPOUTNAME = make_temp ('o'); - TMPINNAME = make_temp ('i'); - TMPREJNAME = make_temp ('r'); - TMPPATNAME = make_temp ('p'); - - /* parse switches */ - Argc = argc; - Argv = argv; - get_some_switches(); - - init_output (outfile, &outstate); - - /* Make sure we clean up in case of disaster. */ - set_signals(0); - - for ( - open_patch_file (patchname); - there_is_another_patch(); - reinitialize_almost_everything() - ) { /* for each patch in patch file */ - int hunk = 0; - int failed = 0; - int mismatch = 0; - char *outname = outfile ? outfile : inname; - - if (!skip_rest_of_patch) - get_input_file (inname, outname); - - if (diff_type == ED_DIFF) { - outstate.zero_output = 0; - if (! dry_run) - { - do_ed_script (outstate.ofp); - if (! outfile) - { - struct stat statbuf; - if (stat (TMPOUTNAME, &statbuf) != 0) - pfatal ("%s", TMPOUTNAME); - outstate.zero_output = statbuf.st_size == 0; - } - } - } else { - int got_hunk; - int apply_anyway = 0; - - /* initialize the patched file */ - if (! skip_rest_of_patch && ! outfile) - init_output (TMPOUTNAME, &outstate); - - /* initialize reject file */ - init_reject(TMPREJNAME); - - /* find out where all the lines are */ - if (!skip_rest_of_patch) - scan_input (inname); - - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ - - /* apply each hunk of patch */ - while (0 < (got_hunk = another_hunk (diff_type, reverse))) { - LINENUM where = 0; /* Pacify `gcc -Wall'. */ - LINENUM newwhere; - LINENUM fuzz = 0; - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM mymaxfuzz = (maxfuzz < context ? maxfuzz : context); - hunk++; - if (!skip_rest_of_patch) { - do { - where = locate_hunk(fuzz); - if (! where || fuzz || last_offset) - mismatch = 1; - if (hunk == 1 && ! where && ! (force | apply_anyway) - && reverse == reverse_flag_specified) { - /* dwim for reversed patch? */ - if (!pch_swap()) { - say ( -"Not enough memory to try swapped hunk! Assuming unswapped.\n"); - continue; - } - /* Try again. */ - where = locate_hunk (fuzz); - if (where - && (ok_to_reverse - ("%s patch detected!", - (reverse - ? "Unreversed" - : "Reversed (or previously applied)")))) - reverse ^= 1; - else - { - /* Put it back to normal. */ - if (! pch_swap ()) - fatal ("lost hunk on alloc error!"); - if (where) - { - apply_anyway = 1; - fuzz--; /* Undo `++fuzz' below. */ - where = 0; - } - } - } - } while (!skip_rest_of_patch && !where - && ++fuzz <= mymaxfuzz); - - if (skip_rest_of_patch) { /* just got decided */ - if (outstate.ofp && ! outfile) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - } - } - - newwhere = pch_newfirst() + last_offset; - if (skip_rest_of_patch) { - abort_hunk(); - failed++; - if (verbosity == VERBOSE) - say ("Hunk #%d ignored at %ld.\n", hunk, newwhere); - } - else if (!where - || (where == 1 && pch_says_nonexistent (reverse) - && instat.st_size)) { - if (where) - say ("Patch attempted to create file `%s', which already exists.\n", inname); - abort_hunk(); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %ld.\n", hunk, newwhere); - } - else if (! apply_hunk (&outstate, where)) { - abort_hunk (); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %ld.\n", hunk, newwhere); - } else { - if (verbosity == VERBOSE - || (verbosity != SILENT && (fuzz || last_offset))) { - say ("Hunk #%d succeeded at %ld", hunk, newwhere); - if (fuzz) - say (" with fuzz %ld", fuzz); - if (last_offset) - say (" (offset %ld line%s)", - last_offset, last_offset==1?"":"s"); - say (".\n"); - } - } - } - - if (got_hunk < 0 && using_plan_a) { - if (outfile) - fatal ("out of memory using Plan A"); - say ("\n\nRan out of memory using Plan A -- trying again...\n\n"); - if (outstate.ofp) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - fclose (rejfp); - continue; - } - - /* finish spewing out the new file */ - if (!skip_rest_of_patch) - { - assert (hunk); - if (! spew_output (&outstate)) - { - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - } - } - } - - /* and put the output where desired */ - ignore_signals (); - if (! skip_rest_of_patch && ! outfile) { - if (outstate.zero_output - && (remove_empty_files - || (pch_says_nonexistent (reverse ^ 1) == 2 - && ! posixly_correct))) - { - if (verbosity == VERBOSE) - say ("Removing file `%s'%s.\n", outname, - dry_run ? " and any empty ancestor directories" : ""); - if (! dry_run) - { - move_file ((char *) 0, outname, (mode_t) 0, - (backup_type != none - || (backup_if_mismatch && (mismatch | failed)))); - removedirs (outname); - } - } - else - { - if (! outstate.zero_output - && pch_says_nonexistent (reverse ^ 1)) - { - mismatch = 1; - if (verbosity != SILENT) - say ("File `%s' is not empty after patch, as expected.\n", - outname); - } - - if (! dry_run) - { - time_t t; - - move_file (TMPOUTNAME, outname, instat.st_mode, - (backup_type != none - || (backup_if_mismatch && (mismatch | failed)))); - - if ((set_time | set_utc) - && (t = pch_timestamp (reverse ^ 1)) != (time_t) -1) - { - struct utimbuf utimbuf; - utimbuf.actime = utimbuf.modtime = t; - - if (! force && ! inerrno - && ! pch_says_nonexistent (reverse) - && (t = pch_timestamp (reverse)) != (time_t) -1 - && t != instat.st_mtime) - say ("not setting time of file `%s' (time mismatch)\n", - outname); - else if (! force && (mismatch | failed)) - say ("not setting time of file `%s' (contents mismatch)\n", - outname); - else if (utime (outname, &utimbuf) != 0) - pfatal ("can't set timestamp on file `%s'", outname); - } - - if (! inerrno && chmod (outname, instat.st_mode) != 0) - pfatal ("can't set permissions on file `%s'", outname); - } - } - } - if (diff_type != ED_DIFF) { - if (fclose (rejfp) != 0) - write_fatal (); - if (failed) { - somefailed = TRUE; - say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1), - skip_rest_of_patch ? "ignored" : "FAILED"); - if (outname) { - char *rej = rejname; - if (!rejname) { - rej = xmalloc (strlen (outname) + 5); - strcpy (rej, outname); - addext (rej, ".rej", '#'); - } - say (" -- saving rejects to %s", rej); - if (! dry_run) - { - move_file (TMPREJNAME, rej, instat.st_mode, FALSE); - if (! inerrno - && (chmod (rej, (instat.st_mode - & ~(S_IXUSR|S_IXGRP|S_IXOTH))) - != 0)) - pfatal ("can't set permissions on file `%s'", rej); - } - if (!rejname) - free (rej); - } - say ("\n"); - } - } - set_signals (1); - } - if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) - write_fatal (); - cleanup (); - if (somefailed) - exit (1); - return 0; -} - -/* Prepare to find the next patch to do in the patch file. */ - -static void -reinitialize_almost_everything() -{ - re_patch(); - re_input(); - - input_lines = 0; - last_frozen_line = 0; - - if (inname) { - free (inname); - inname = 0; - } - - last_offset = 0; - - diff_type = NO_DIFF; - - if (revision) { - free(revision); - revision = 0; - } - - reverse = reverse_flag_specified; - skip_rest_of_patch = FALSE; -} - -static char const shortopts[] = "bB:cd:D:eEfF:g:i:lnNo:p:r:RstTuvV:x:Y:z:Z"; -static struct option const longopts[] = -{ - {"backup", no_argument, NULL, 'b'}, - {"prefix", required_argument, NULL, 'B'}, - {"context", no_argument, NULL, 'c'}, - {"directory", required_argument, NULL, 'd'}, - {"ifdef", required_argument, NULL, 'D'}, - {"ed", no_argument, NULL, 'e'}, - {"remove-empty-files", no_argument, NULL, 'E'}, - {"force", no_argument, NULL, 'f'}, - {"fuzz", required_argument, NULL, 'F'}, - {"get", no_argument, NULL, 'g'}, - {"input", required_argument, NULL, 'i'}, - {"ignore-whitespace", no_argument, NULL, 'l'}, - {"normal", no_argument, NULL, 'n'}, - {"forward", no_argument, NULL, 'N'}, - {"output", required_argument, NULL, 'o'}, - {"strip", required_argument, NULL, 'p'}, - {"reject-file", required_argument, NULL, 'r'}, - {"reverse", no_argument, NULL, 'R'}, - {"quiet", no_argument, NULL, 's'}, - {"silent", no_argument, NULL, 's'}, - {"batch", no_argument, NULL, 't'}, - {"set-time", no_argument, NULL, 'T'}, - {"unified", no_argument, NULL, 'u'}, - {"version", no_argument, NULL, 'v'}, - {"version-control", required_argument, NULL, 'V'}, - {"debug", required_argument, NULL, 'x'}, - {"basename-prefix", required_argument, NULL, 'Y'}, - {"suffix", required_argument, NULL, 'z'}, - {"set-utc", no_argument, NULL, 'Z'}, - {"dry-run", no_argument, NULL, 129}, - {"verbose", no_argument, NULL, 130}, - {"binary", no_argument, NULL, 131}, - {"help", no_argument, NULL, 132}, - {"backup-if-mismatch", no_argument, NULL, 133}, - {"no-backup-if-mismatch", no_argument, NULL, 134}, - {NULL, no_argument, NULL, 0} -}; - -static char const *const option_help[] = -{ -"Input options:", -"", -" -p NUM --strip=NUM Strip NUM leading components from file names.", -" -F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.", -" -l --ignore-whitespace Ignore white space changes between patch and input.", -"", -" -c --context Interpret the patch as a context difference.", -" -e --ed Interpret the patch as an ed script.", -" -n --normal Interpret the patch as a normal difference.", -" -u --unified Interpret the patch as a unified difference.", -"", -" -N --forward Ignore patches that appear to be reversed or already applied.", -" -R --reverse Assume patches were created with old and new files swapped.", -"", -" -i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.", -"", -"Output options:", -"", -" -o FILE --output=FILE Output patched files to FILE.", -" -r FILE --reject-file=FILE Output rejects to FILE.", -"", -" -D NAME --ifdef=NAME Make merged if-then-else output using NAME.", -" -E --remove-empty-files Remove output files that are empty after patching.", -"", -" -Z --set-utc Set times of patched files, assuming diff uses UTC (GMT).", -" -T --set-time Likewise, assuming local time.", -"", -"Backup and version control options:", -"", -" -V STYLE --version-control=STYLE Use STYLE version control.", -" STYLE is either 'simple', 'numbered', or 'existing'.", -"", -" -b --backup Back up the original contents of each file.", -" --backup-if-mismatch Back up if the patch does not match exactly.", -" --no-backup-if-mismatch Back up mismatches only if otherwise requested.", -" -B PREFIX --prefix=PREFIX Prepend PREFIX to backup file names.", -" -Y PREFIX --basename-prefix=PREFIX Prepend PREFIX to backup file basenames.", -" -z SUFFIX --suffix=SUFFIX Append SUFFIX to backup file names.", -"", -" -g NUM --get=NUM Get files from RCS or SCCS if positive; ask if negative.", -"", -"Miscellaneous options:", -"", -" -t --batch Ask no questions; skip bad-Prereq patches; assume reversed.", -" -f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.", -" -s --quiet --silent Work silently unless an error occurs.", -" --verbose Output extra information about the work being done.", -" --dry-run Do not actually change any files; just print what would happen.", -"", -" -d DIR --directory=DIR Change the working directory to DIR first.", -#if HAVE_SETMODE -" --binary Read and write data in binary mode.", -#else -" --binary Read and write data in binary mode (no effect on this platform).", -#endif -"", -" -v --version Output version info.", -" --help Output this help.", -"", -"Report bugs to .", -0 -}; - -static void -usage (stream, status) - FILE *stream; - int status; -{ - char const * const *p; - - if (status != 0) - { - fprintf (stream, "%s: Try `%s --help' for more information.\n", - program_name, Argv[0]); - } - else - { - fprintf (stream, "Usage: %s [OPTION]... [ORIGFILE [PATCHFILE]]\n\n", - Argv[0]); - for (p = option_help; *p; p++) - fprintf (stream, "%s\n", *p); - } - - exit (status); -} - -/* Process switches and filenames. */ - -static void -get_some_switches() -{ - register int optc; - - if (rejname) - free (rejname); - rejname = 0; - if (optind == Argc) - return; - while ((optc = getopt_long (Argc, Argv, shortopts, longopts, (int *) 0)) - != -1) { - switch (optc) { - case 'b': - /* Special hack for backward compatibility with CVS 1.9. - If the last 4 args are `-b SUFFIX ORIGFILE PATCHFILE', - treat `-b' as if it were `-z'. */ - if (Argc - optind == 3 - && strcmp (Argv[optind - 1], "-b") == 0 - && ! (Argv[optind + 0][0] == '-' && Argv[optind + 0][1]) - && ! (Argv[optind + 1][0] == '-' && Argv[optind + 1][1]) - && ! (Argv[optind + 2][0] == '-' && Argv[optind + 2][1])) - { - optarg = Argv[optind++]; - if (verbosity != SILENT) - say ("warning: the `-b %s' option is obsolete; use `-z %s' instead\n", - optarg, optarg); - goto case_z; - } - backup_type = simple; - break; - case 'B': - if (!*optarg) - fatal ("backup prefix is empty"); - origprae = savestr (optarg); - break; - case 'c': - diff_type = CONTEXT_DIFF; - break; - case 'd': - if (chdir(optarg) < 0) - pfatal ("can't change directory to `%s'", optarg); - break; - case 'D': - do_defines = savestr (optarg); - break; - case 'e': - diff_type = ED_DIFF; - break; - case 'E': - remove_empty_files = TRUE; - break; - case 'f': - force = TRUE; - break; - case 'F': - maxfuzz = numeric_string (optarg, 0, "fuzz factor"); - break; - case 'g': - patch_get = numeric_string (optarg, 1, "get option value"); - break; - case 'i': - patchname = savestr (optarg); - break; - case 'l': - canonicalize = TRUE; - break; - case 'n': - diff_type = NORMAL_DIFF; - break; - case 'N': - noreverse = TRUE; - break; - case 'o': - if (strcmp (optarg, "-") == 0) - fatal ("can't output patches to standard output"); - outfile = savestr (optarg); - break; - case 'p': - strippath = numeric_string (optarg, 0, "strip count"); - break; - case 'r': - rejname = savestr (optarg); - break; - case 'R': - reverse = 1; - reverse_flag_specified = 1; - break; - case 's': - verbosity = SILENT; - break; - case 't': - batch = TRUE; - break; - case 'T': - set_time = 1; - break; - case 'u': - diff_type = UNI_DIFF; - break; - case 'v': - version(); - exit (0); - break; - case 'V': - backup_type = get_version (optarg); - break; -#if DEBUGGING - case 'x': - debug = numeric_string (optarg, 1, "debugging option"); - break; -#endif - case 'Y': - if (!*optarg) - fatal ("backup basename prefix is empty"); - origbase = savestr (optarg); - break; - case 'z': - case_z: - if (!*optarg) - fatal ("backup suffix is empty"); - simple_backup_suffix = savestr (optarg); - break; - case 'Z': - set_utc = 1; - break; - case 129: - dry_run = TRUE; - break; - case 130: - verbosity = VERBOSE; - break; - case 131: -#if HAVE_SETMODE - binary_transput = O_BINARY; -#endif - break; - case 132: - usage (stdout, 0); - case 133: - backup_if_mismatch = 1; - break; - case 134: - backup_if_mismatch = 0; - break; - default: - usage (stderr, 2); - } - } - - /* Process any filename args. */ - if (optind < Argc) - { - inname = savestr (Argv[optind++]); - invc = -1; - if (optind < Argc) - { - patchname = savestr (Argv[optind++]); - if (optind < Argc) - { - fprintf (stderr, "%s: extra operand `%s'\n", - program_name, Argv[optind]); - usage (stderr, 2); - } - } - } -} - -/* Handle STRING (possibly negative if NEGATIVE_ALLOWED is nonzero) - of type ARGTYPE_MSGID by converting it to an integer, - returning the result. */ -static int -numeric_string (string, negative_allowed, argtype_msgid) - char const *string; - int negative_allowed; - char const *argtype_msgid; -{ - int value = 0; - char const *p = string; - int sign = *p == '-' ? -1 : 1; - - p += *p == '-' || *p == '+'; - - do - { - int v10 = value * 10; - int digit = *p - '0'; - int signed_digit = sign * digit; - int next_value = v10 + signed_digit; - - if (9 < (unsigned) digit) - fatal ("%s `%s' is not a number", argtype_msgid, string); - - if (v10 / 10 != value || (next_value < v10) != (signed_digit < 0)) - fatal ("%s `%s' is too large", argtype_msgid, string); - - value = next_value; - } - while (*++p); - - if (value < 0 && ! negative_allowed) - fatal ("%s `%s' is negative", argtype_msgid, string); - - return value; -} - -/* Attempt to find the right place to apply this hunk of patch. */ - -static LINENUM -locate_hunk(fuzz) -LINENUM fuzz; -{ - register LINENUM first_guess = pch_first () + last_offset; - register LINENUM offset; - LINENUM pat_lines = pch_ptrn_lines(); - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM prefix_fuzz = fuzz + prefix_context - context; - LINENUM suffix_fuzz = fuzz + suffix_context - context; - LINENUM max_where = input_lines - (pat_lines - suffix_fuzz) + 1; - LINENUM min_where = last_frozen_line + 1 - (prefix_context - prefix_fuzz); - LINENUM max_pos_offset = max_where - first_guess; - LINENUM max_neg_offset = first_guess - min_where; - LINENUM max_offset = (max_pos_offset < max_neg_offset - ? max_neg_offset : max_pos_offset); - - if (!pat_lines) /* null range matches always */ - return first_guess; - - /* Do not try lines <= 0. */ - if (first_guess <= max_neg_offset) - max_neg_offset = first_guess - 1; - - if (prefix_fuzz < 0) - { - /* Can only match start of file. */ - - if (suffix_fuzz < 0) - /* Can only match entire file. */ - if (pat_lines != input_lines || prefix_context < last_frozen_line) - return 0; - - offset = 1 - first_guess; - return - ((last_frozen_line <= prefix_context - && offset <= max_pos_offset - && patch_match (first_guess, offset, (LINENUM) 0, suffix_fuzz)) - ? first_guess : 0); - } - - if (suffix_fuzz < 0) - { - /* Can only match end of file. */ - offset = first_guess - (input_lines - pat_lines + 1); - return - ((offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, (LINENUM) 0)) - ? first_guess : 0); - } - - for (offset = 0; offset <= max_offset; offset++) { - if (offset <= max_pos_offset - && patch_match (first_guess, offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %ld to %ld\n", last_offset, offset); - last_offset = offset; - return first_guess+offset; - } - if (0 < offset && offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %ld to %ld\n", last_offset, -offset); - last_offset = -offset; - return first_guess-offset; - } - } - return 0; -} - -/* We did not find the pattern, dump out the hunk so they can handle it. */ - -static void -abort_hunk() -{ - register LINENUM i; - register LINENUM pat_end = pch_end (); - /* add in last_offset to guess the same as the previous successful hunk */ - LINENUM oldfirst = pch_first() + last_offset; - LINENUM newfirst = pch_newfirst() + last_offset; - LINENUM oldlast = oldfirst + pch_ptrn_lines() - 1; - LINENUM newlast = newfirst + pch_repl_lines() - 1; - char const *stars = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : ""; - char const *minuses = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----"; - - fprintf(rejfp, "***************\n"); - for (i=0; i<=pat_end; i++) { - switch (pch_char(i)) { - case '*': - if (oldlast < oldfirst) - fprintf(rejfp, "*** 0%s\n", stars); - else if (oldlast == oldfirst) - fprintf(rejfp, "*** %ld%s\n", oldfirst, stars); - else - fprintf(rejfp, "*** %ld,%ld%s\n", oldfirst, oldlast, stars); - break; - case '=': - if (newlast < newfirst) - fprintf(rejfp, "--- 0%s\n", minuses); - else if (newlast == newfirst) - fprintf(rejfp, "--- %ld%s\n", newfirst, minuses); - else - fprintf(rejfp, "--- %ld,%ld%s\n", newfirst, newlast, minuses); - break; - case ' ': case '-': case '+': case '!': - fprintf (rejfp, "%c ", pch_char (i)); - /* fall into */ - case '\n': - pch_write_line (i, rejfp); - break; - default: - fatal ("fatal internal error in abort_hunk"); - } - if (ferror (rejfp)) - write_fatal (); - } -} - -/* We found where to apply it (we hope), so do it. */ - -static bool -apply_hunk (outstate, where) - struct outstate *outstate; - LINENUM where; -{ - register LINENUM old = 1; - register LINENUM lastline = pch_ptrn_lines (); - register LINENUM new = lastline+1; - register enum {OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE} def_state = OUTSIDE; - register char const *R_do_defines = do_defines; - register LINENUM pat_end = pch_end (); - register FILE *fp = outstate->ofp; - - where--; - while (pch_char(new) == '=' || pch_char(new) == '\n') - new++; - - while (old <= lastline) { - if (pch_char(old) == '-') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFNDEF; - } - else if (def_state == IN_IFDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->after_newline = pch_write_line (old, fp); - outstate->zero_output = 0; - } - last_frozen_line++; - old++; - } - else if (new > pat_end) { - break; - } - else if (pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - else if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - if (ferror (fp)) - write_fatal (); - } - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = 0; - new++; - } - else if (pch_char(new) != pch_char(old)) { - if (debug & 1) - say ("oldchar = '%c', newchar = '%c'\n", - pch_char (old), pch_char (new)); - fatal ("Out-of-sync patch, lines %ld,%ld -- mangled text or line numbers, maybe?", - pch_hunk_beg() + old, - pch_hunk_beg() + new); - } - else if (pch_char(new) == '!') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return FALSE; - assert (outstate->after_newline); - if (R_do_defines) { - fprintf (fp, not_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_IFNDEF; - } - - do - { - if (R_do_defines) { - outstate->after_newline = pch_write_line (old, fp); - } - last_frozen_line++; - old++; - } - while (pch_char (old) == '!'); - - if (R_do_defines) { - fprintf (fp, outstate->after_newline + else_defined); - if (ferror (fp)) - write_fatal (); - def_state = IN_ELSE; - } - - do - { - outstate->after_newline = pch_write_line (new, fp); - new++; - } - while (pch_char (new) == '!'); - outstate->zero_output = 0; - } - else { - assert(pch_char(new) == ' '); - old++; - new++; - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined, - R_do_defines); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = 1; - def_state = OUTSIDE; - } - } - } - if (new <= pat_end && pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - else if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->zero_output = 0; - } - - do - { - if (! outstate->after_newline && putc ('\n', fp) == EOF) - write_fatal (); - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = 0; - new++; - } - while (new <= pat_end && pch_char (new) == '+'); - } - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = 1; - } - return TRUE; -} - -/* Create an output file. */ - -static FILE * -create_output_file (name) - char const *name; -{ - int fd = create_file (name, O_WRONLY | binary_transput, instat.st_mode); - FILE *f = fdopen (fd, binary_transput ? "wb" : "w"); - if (! f) - pfatal ("can't create `%s'", name); - return f; -} - -/* Open the new file. */ - -static void -init_output (name, outstate) - char const *name; - struct outstate *outstate; -{ - outstate->ofp = name ? create_output_file (name) : (FILE *) 0; - outstate->after_newline = 1; - outstate->zero_output = 1; -} - -/* Open a file to put hunks we can't locate. */ - -static void -init_reject(name) - char const *name; -{ - rejfp = create_output_file (name); -} - -/* Copy input file to output, up to wherever hunk is to be applied. */ - -static bool -copy_till (outstate, lastline) - register struct outstate *outstate; - register LINENUM lastline; -{ - register LINENUM R_last_frozen_line = last_frozen_line; - register FILE *fp = outstate->ofp; - register char const *s; - size_t size; - - if (R_last_frozen_line > lastline) - { - say ("misordered hunks! output would be garbled\n"); - return FALSE; - } - while (R_last_frozen_line < lastline) - { - s = ifetch (++R_last_frozen_line, 0, &size); - if (size) - { - if ((! outstate->after_newline && putc ('\n', fp) == EOF) - || ! fwrite (s, sizeof *s, size, fp)) - write_fatal (); - outstate->after_newline = s[size - 1] == '\n'; - outstate->zero_output = 0; - } - } - last_frozen_line = R_last_frozen_line; - return TRUE; -} - -/* Finish copying the input file to the output file. */ - -static bool -spew_output (outstate) - struct outstate *outstate; -{ - if (debug & 256) - say ("il=%ld lfl=%ld\n", input_lines, last_frozen_line); - - if (last_frozen_line < input_lines) - if (! copy_till (outstate, input_lines)) - return FALSE; - - if (outstate->ofp && ! outfile) - { - if (fclose (outstate->ofp) != 0) - write_fatal (); - outstate->ofp = 0; - } - - return TRUE; -} - -/* Does the patch pattern match at line base+offset? */ - -static bool -patch_match (base, offset, prefix_fuzz, suffix_fuzz) -LINENUM base; -LINENUM offset; -LINENUM prefix_fuzz; -LINENUM suffix_fuzz; -{ - register LINENUM pline = 1 + prefix_fuzz; - register LINENUM iline; - register LINENUM pat_lines = pch_ptrn_lines () - suffix_fuzz; - size_t size; - register char const *p; - - for (iline=base+offset+prefix_fuzz; pline <= pat_lines; pline++,iline++) { - p = ifetch (iline, offset >= 0, &size); - if (canonicalize) { - if (!similar(p, size, - pfetch(pline), - pch_line_len(pline) )) - return FALSE; - } - else if (size != pch_line_len (pline) - || memcmp (p, pfetch (pline), size) != 0) - return FALSE; - } - return TRUE; -} - -/* Do two lines match with canonicalized white space? */ - -static bool -similar (a, alen, b, blen) - register char const *a; - register size_t alen; - register char const *b; - register size_t blen; -{ - /* Ignore presence or absence of trailing newlines. */ - alen -= alen && a[alen - 1] == '\n'; - blen -= blen && b[blen - 1] == '\n'; - - for (;;) - { - if (!blen || (*b == ' ' || *b == '\t')) - { - while (blen && (*b == ' ' || *b == '\t')) - b++, blen--; - if (alen) - { - if (!(*a == ' ' || *a == '\t')) - return FALSE; - do a++, alen--; - while (alen && (*a == ' ' || *a == '\t')); - } - if (!alen || !blen) - return alen == blen; - } - else if (!alen || *a++ != *b++) - return FALSE; - else - alen--, blen--; - } -} - -/* Make a temporary file. */ - -#if HAVE_MKTEMP -char *mktemp PARAMS ((char *)); -#endif - -#ifndef TMPDIR -#define TMPDIR "/tmp" -#endif - -static char const * -make_temp (letter) - int letter; -{ - char *r; -#if HAVE_MKTEMP - char const *tmpdir = getenv ("TMPDIR"); /* Unix tradition */ - if (!tmpdir) tmpdir = getenv ("TMP"); /* DOS tradition */ - if (!tmpdir) tmpdir = getenv ("TEMP"); /* another DOS tradition */ - if (!tmpdir) tmpdir = TMPDIR; - r = xmalloc (strlen (tmpdir) + 10); - sprintf (r, "%s/p%cXXXXXX", tmpdir, letter); - mktemp (r); - if (!*r) - pfatal ("mktemp"); -#else - r = xmalloc (L_tmpnam); - if (! (tmpnam (r) == r && *r)) - pfatal ("tmpnam"); -#endif - return r; -} - -/* Fatal exit with cleanup. */ - -void -fatal_exit (sig) - int sig; -{ - cleanup (); - - if (sig) - exit_with_signal (sig); - - exit (2); -} - -static void -cleanup () -{ - unlink (TMPINNAME); - unlink (TMPOUTNAME); - unlink (TMPPATNAME); - unlink (TMPREJNAME); -} Property changes on: vendor/misc-GNU/patch/2.4/patch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/README =================================================================== --- vendor/misc-GNU/patch/2.4/README (revision 358868) +++ vendor/misc-GNU/patch/2.4/README (nonexistent) @@ -1,52 +0,0 @@ -This version of `patch' has many changes made by the Free Software Foundation. -They add support for: - * handling arbitrary binary data and large files - * the unified context diff format that GNU diff can produce - * making GNU Emacs-style backup files - * improved interaction with RCS and SCCS - * the GNU conventions for option parsing and configuring and compilation. - * better POSIX.2 compliance -They also fix some bugs. See the NEWS and ChangeLog files for details. - -Tutorial-style documentation for patch is included in the GNU -diffutils package. Unfortunately, the diffutils 2.7 documentation -for `patch' is obsolete; this should be fixed in diffutils 2.8. -In the mean time, see `patch --help', or consult the man page -in this distribution. - -For GNU and Unix build and installation instructions, see the file INSTALL. -For MS-DOS using DJGPP tools, see the file pc/djgpp/README. -For other systems, copy config.hin to config.h and change -#undef statements in it to #define as appropriate for your system, -and copy Makefile.in to Makefile and set the variables that are -enclosed in @ signs as appropriate for your system. - -Please send bug reports for this version of patch to -bug-gnu-utils@prep.ai.mit.edu. - -The Free Software Foundation is distributing this version of patch -independently because as of this writing, Larry Wall has not released a -new version of patch since mid-1988. We have heard that he has been -too busy working on other things, like Perl. He has graciously agreed -to let GNU `patch' be distributed under the terms of the GNU General -Public License. - ------- - -Copyright 1984, 1985, 1986, 1987, 1988 Larry Wall -Copyright 1989, 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this file; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/2.4/README ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/inp.c =================================================================== --- vendor/misc-GNU/patch/2.4/inp.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/inp.c (nonexistent) @@ -1,442 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.c,v 1.16 1997/06/13 06:28:37 eggert Exp $ */ - -/* -Copyright 1986, 1988 Larry Wall -Copyright 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -/* Input-file-with-indexable-lines abstract type */ - -static char const **i_ptr; /* pointers to lines in plan A buffer */ - -static size_t tibufsize; /* size of plan b buffers */ -#ifndef TIBUFSIZE_MINIMUM -#define TIBUFSIZE_MINIMUM (8 * 1024) /* minimum value for tibufsize */ -#endif -static int tifd = -1; /* plan b virtual string array */ -static char *tibuf[2]; /* plan b buffers */ -static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ -static LINENUM lines_per_buf; /* how many lines per buffer */ -static size_t tireclen; /* length of records in tmp file */ -static size_t last_line_size; /* size of last input line */ - -static bool plan_a PARAMS ((char const *));/* yield FALSE if memory runs out */ -static void plan_b PARAMS ((char const *)); -static void report_revision PARAMS ((int)); - -/* New patch--prepare to edit another file. */ - -void -re_input() -{ - if (using_plan_a) { - if (i_ptr) { - free (i_ptr); - i_ptr = 0; - } - } - else { - close (tifd); - tifd = -1; - free(tibuf[0]); - tibuf[0] = 0; - tiline[0] = tiline[1] = -1; - tireclen = 0; - } -} - -/* Construct the line index, somehow or other. */ - -void -scan_input(filename) -char *filename; -{ - using_plan_a = ! (debug & 16) && plan_a (filename); - if (!using_plan_a) - plan_b(filename); - switch (verbosity) - { - case SILENT: - break; - - case VERBOSE: - say ("Patching file `%s' using Plan %s...\n", - filename, using_plan_a ? "A" : "B"); - break; - - case DEFAULT_VERBOSITY: - say ("patching file `%s'\n", filename); - break; - } -} - -/* Report whether a desired revision was found. */ - -static void -report_revision (found_revision) - int found_revision; -{ - if (found_revision) - { - if (verbosity == VERBOSE) - say ("Good. This file appears to be the %s version.\n", revision); - } - else if (force) - { - if (verbosity != SILENT) - say ("Warning: this file doesn't appear to be the %s version -- patching anyway.\n", - revision); - } - else if (batch) - { - fatal ("This file doesn't appear to be the %s version -- aborting.", - revision); - } - else - { - ask ("This file doesn't appear to be the %s version -- patch anyway? [n] ", - revision); - if (*buf != 'y') - fatal ("aborted"); - } -} - - -void -get_input_file (filename, outname) - char const *filename; - char const *outname; -{ - int elsewhere = strcmp (filename, outname); - char const *cs; - char *diffbuf; - char *getbuf; - - if (inerrno == -1) - inerrno = stat (inname, &instat) == 0 ? 0 : errno; - - /* Perhaps look for RCS or SCCS versions. */ - if (patch_get - && invc != 0 - && (inerrno - || (! elsewhere - && (/* No one can write to it. */ - (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0 - /* Only the owner (who's not me) can write to it. */ - || ((instat.st_mode & (S_IWGRP|S_IWOTH)) == 0 - && instat.st_uid != geteuid ())))) - && (invc = !! (cs = (version_controller - (filename, elsewhere, - inerrno ? (struct stat *) 0 : &instat, - &getbuf, &diffbuf))))) { - - if (!inerrno) { - if (!elsewhere - && (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) != 0) - /* Somebody can write to it. */ - fatal ("file `%s' seems to be locked by somebody else under %s", - filename, cs); - /* It might be checked out unlocked. See if it's safe to - check out the default version locked. */ - if (verbosity == VERBOSE) - say ("Comparing file `%s' to default %s version...\n", - filename, cs); - if (systemic (diffbuf) != 0) - { - say ("warning: patching file `%s', which does not match default %s version\n", - filename, cs); - cs = 0; - } - } - - if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, - &instat)) - inerrno = 0; - - free (getbuf); - free (diffbuf); - - } else if (inerrno && !pch_says_nonexistent (reverse)) - { - errno = inerrno; - pfatal ("can't find file `%s'", filename); - } - - if (inerrno) - { - instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; - instat.st_size = 0; - } - else if (! S_ISREG (instat.st_mode)) - fatal ("`%s' is not a regular file -- can't patch", filename); -} - - -/* Try keeping everything in memory. */ - -static bool -plan_a(filename) - char const *filename; -{ - register char const *s; - register char const *lim; - register char const **ptr; - register char *buffer; - register LINENUM iline; - size_t size = instat.st_size; - size_t allocated_bytes_per_input_byte = sizeof *i_ptr + sizeof (char); - size_t allocated_bytes = (size + 2) * allocated_bytes_per_input_byte; - - /* Fail if arithmetic overflow occurs during size calculations, - or if storage isn't available. */ - if (size != instat.st_size - || size + 2 < 2 - || allocated_bytes / allocated_bytes_per_input_byte != size + 2 - || ! (ptr = (char const **) malloc (allocated_bytes))) - return FALSE; - - buffer = (char *) (ptr + (size + 2)); - - /* Read the input file, but don't bother reading it if it's empty. - When creating files, the files do not actually exist. */ - if (size) - { - int ifd = open (filename, O_RDONLY|binary_transput); - size_t buffered = 0, n; - if (ifd < 0) - pfatal ("can't open file `%s'", filename); - while (size - buffered != 0 - && (n = read (ifd, buffer + buffered, size - buffered)) != 0) - { - if (n == -1) - { - /* Perhaps size is too large for this host. */ - close (ifd); - free (ptr); - return FALSE; - } - buffered += n; - } - - /* Some non-POSIX hosts exaggerate st_size in text mode; - or the file may have shrunk! */ - size = buffered; - - if (close (ifd) != 0) - read_fatal (); - } - - /* Scan the buffer and build array of pointers to lines. */ - iline = 0; - lim = buffer + size; - for (s = buffer; ; s++) - { - ptr[++iline] = s; - if (! (s = (char *) memchr (s, '\n', lim - s))) - break; - } - if (size && lim[-1] != '\n') - ptr[++iline] = lim; - input_lines = iline - 1; - - if (revision) - { - char const *rev = revision; - int rev0 = rev[0]; - int found_revision = 0; - size_t revlen = strlen (rev); - - if (revlen <= size) - { - char const *limrev = lim - revlen; - - for (s = buffer; (s = (char *) memchr (s, rev0, limrev - s)); s++) - if (memcmp (s, rev, revlen) == 0 - && (s == buffer || ISSPACE ((unsigned char) s[-1])) - && (s + 1 == limrev || ISSPACE ((unsigned char) s[revlen]))) - { - found_revision = 1; - break; - } - } - - report_revision (found_revision); - } - - /* Plan A will work. */ - i_ptr = ptr; - return TRUE; -} - -/* Keep (virtually) nothing in memory. */ - -static void -plan_b(filename) - char const *filename; -{ - register FILE *ifp; - register int c; - register size_t len; - register size_t maxlen; - register int found_revision; - register size_t i; - register char const *rev; - register size_t revlen; - register LINENUM line; - - if (instat.st_size == 0) - filename = NULL_DEVICE; - if (! (ifp = fopen (filename, binary_transput ? "rb" : "r"))) - pfatal ("can't open file `%s'", filename); - tifd = create_file (TMPINNAME, O_RDWR | O_BINARY, (mode_t) 0); - i = 0; - len = 0; - maxlen = 1; - rev = revision; - found_revision = !rev; - revlen = rev ? strlen (rev) : 0; - - while ((c = getc (ifp)) != EOF) - { - len++; - - if (c == '\n') - { - if (maxlen < len) - maxlen = len; - len = 0; - } - - if (!found_revision) - { - if (i == revlen) - { - found_revision = ISSPACE ((unsigned char) c); - i = (size_t) -1; - } - else if (i != (size_t) -1) - i = rev[i]==c ? i + 1 : (size_t) -1; - - if (i == (size_t) -1 && ISSPACE ((unsigned char) c)) - i = 0; - } - } - - if (revision) - report_revision (found_revision); - Fseek (ifp, (off_t) 0, SEEK_SET); /* rewind file */ - for (tibufsize = TIBUFSIZE_MINIMUM; tibufsize < maxlen; tibufsize <<= 1) - continue; - lines_per_buf = tibufsize / maxlen; - tireclen = maxlen; - tibuf[0] = xmalloc (2 * tibufsize); - tibuf[1] = tibuf[0] + tibufsize; - - for (line = 1; ; line++) - { - char *p = tibuf[0] + maxlen * (line % lines_per_buf); - char const *p0 = p; - if (! (line % lines_per_buf)) /* new block */ - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - if ((c = getc (ifp)) == EOF) - break; - - for (;;) - { - *p++ = c; - if (c == '\n') - { - last_line_size = p - p0; - break; - } - - if ((c = getc (ifp)) == EOF) - { - last_line_size = p - p0; - line++; - goto EOF_reached; - } - } - } - EOF_reached: - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - - if (line % lines_per_buf != 0) - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - input_lines = line - 1; -} - -/* Fetch a line from the input file. */ - -char const * -ifetch (line, whichbuf, psize) -register LINENUM line; -int whichbuf; /* ignored when file in memory */ -size_t *psize; -{ - register char const *q; - register char const *p; - - if (line < 1 || line > input_lines) { - *psize = 0; - return ""; - } - if (using_plan_a) { - p = i_ptr[line]; - *psize = i_ptr[line + 1] - p; - return p; - } else { - LINENUM offline = line % lines_per_buf; - LINENUM baseline = line - offline; - - if (tiline[0] == baseline) - whichbuf = 0; - else if (tiline[1] == baseline) - whichbuf = 1; - else { - tiline[whichbuf] = baseline; - if (lseek (tifd, (off_t) (baseline/lines_per_buf * tibufsize), - SEEK_SET) == -1 - || read (tifd, tibuf[whichbuf], tibufsize) < 0) - read_fatal (); - } - p = tibuf[whichbuf] + (tireclen*offline); - if (line == input_lines) - *psize = last_line_size; - else { - for (q = p; *q++ != '\n'; ) - continue; - *psize = q - p; - } - return p; - } -} Property changes on: vendor/misc-GNU/patch/2.4/inp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/ChangeLog =================================================================== --- vendor/misc-GNU/patch/2.4/ChangeLog (revision 358868) +++ vendor/misc-GNU/patch/2.4/ChangeLog (nonexistent) @@ -1,1627 +0,0 @@ -1997-06-19 Paul Eggert - - * configure.in (VERSION): Version 2.4 released. - * NEWS: Patch is now verbose when patches do not match exactly. - -1997-06-17 Paul Eggert - - * pc/djgpp/configure.sed (config.h): Remove redundant $(srcdir). - - * configure.in (VERSION): Bump to 2.3.9. - * patch.c (main): By default, warn about hunks that succeed - with nonzero offset. - * patch.man: Add LC_ALL=C advice for making patches. - * pc/djgpp/configure.sed (config.h): Fix paths to dependent files. - -1997-06-17 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.8. - - * pch.c (open_patch_file): Test stdin for fseekability. - (intuit_diff_type): Missing context diff headers are now warnings, - not errors; some people use patches with them (e.g. when retrying - rejects). - - * patch.c (struct outstate): - New type, collecting together some output state vars. - (apply_hunk, copy_till, spew_output, init_output): Use it. - Keep track of whether some output has been generated. - (backup_if_mismatch): New var. - (ofp): Remove, in favor of local struct outstate vars. - (main): Use struct outstate. Initialize backup_if_mismatch to - be the inverse of posixly_correct. Keep track of whether mismatches - occur, and use this to implement backup_if_mismatch. - Report files that are not empty after patching, but should be. - (longopts, option_help, get_some_switches): New options - --backup-if-mismatch, --no-backup-if-mismatch. - (get_some_switches): -B, -Y, -z no longer set backup_type. - * backupfile.c (find_backup_file_name): - Treat backup_type == none like simple. - - * Makefile.in (CONFIG_HDRS): - Remove var; no longer needed by djgpp port. - (DISTFILES_PC_DJGPP): Rename pc/djgpp/config.sed to - pc/djgpp/configure.sed; remove pc/djgpp/config.h in favor of - new file that edits it, called pc/djgpp/config.sed. - * pc/djgpp/configure.bat: Rename config.sed to configure.sed. - * pc/djgpp/configure.sed (CONFIG_HDRS): Remove. - (config.h): Add rule to build this from config.hin and - pc/djgpp/config.sed. - * pc/djgpp/config.sed: - Convert from .h file to .sed script that generates .h file. - - * NEWS: Describe --backup-if-mismatch, --no-backup-if-mismatch. - * patch.man: - Describe new options --backup-if-mismatch, --no-backup-if-mismatch - and their ramifications. Use unreadable backup to represent - nonexistent file. - -1997-06-12 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.7. - (AC_CHECK_FUNCS): Add `raise'. - - * Makefile.in (inp.o): No longer depends on quotearg.h. - - * common.h (outfile): New decl (was private var named `output'). - (invc): New decl. - (GENERIC_OBJECT): Renamed from VOID. - (NULL_DEVICE, TTY_DEVICE): New macros. - - * patch.c (output): Remove; renamed to `outfile' and moved to common.h. - (main): `failed' is count, not boolean. - Say "Skipping patch." when deciding to skip patch. - (get_some_switches): Set invc when setting inname. - - * inp.c: Do not include . - (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF1, SCCSDIFF2, SCCSDIFF3, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1, RCSDIFF2): - Move to util.c. - (get_input_file): Invoke new functions version_controller and - version_get to simplify this code. - (plan_b): "/dev/tty" -> NULL_DEVICE - - * pch.h (pch_timestamp): New decl. - * pch.c (p_timestamp): New var; takes over from global timestamp array. - (pch_timestamp): New function to export p_timestamp. - (there_is_another_patch): Use blander wording when you can't intuit - the file name. - Say "Skipping patch." when deciding to skip patch. - (intuit_diff_type): Look for version-controlled but nonexistent files - when intuiting file names; set invc accordingly. - Ignore Index: line if either old or new line is present, and if - POSIXLY_CORRECT is not set. - (do_ed_script): Flush stdout before invoking popen, since it may - send output to stdout. - - * util.h (version_controller, version_get): New decls. - * util.c: Include earlier. - (raise): New macro, if ! HAVE_RAISE. - (move_file): Create empty unreadable file when backing up a nonexistent - file. - (DEV_NULL): New constant. - (SCCSPREFIX, GET. GET_LOCKED, SCCSDIFF1, SCCSDIFF2, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c. - (version_controller, version_get): New functions. - (ask): Look only at /dev/tty for answers; and when standard output is - not a terminal and ! posixly_correct, don't even look there. - Remove unnecessary fflushes of stdout. - (ok_to_reverse): Say "Skipping patch." when deciding to skip patch.. - (sigs): SIGPIPE might not be defined. - (exit_with_signal): Use `raise' instead of `kill'. - (systemic): fflush stdout before invoking subsidiary command. - - * patch.man: Document recent changes. - Add "COMPATIBILITY ISSUES" section. - - * NEWS: New COMPATIBILITY ISSUES for man page. - Changed verbosity when fuzz is found. - File name intuition is changed, again. - Backups are made unreadable when the file did not exist. - - * pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): Define. - (HAVE_RAISE): New macro. - (HAVE_UTIME_H): Define. - (TZ_is_unset): Do not define; it's not a serious problem with `patch' - to have TZ be unset in DOS. - -1997-06-08 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.6. - (AC_CHECK_HEADERS): Add utime.h. - * acconfig.h, configure.in, pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): - New macro. - * pc/djgpp/config.h (HAVE_UTIME_H, TZ_is_unset): New macros. - - * NEWS, patch.man: Describe new -Z, -T options, new numeric - option for -G, retired -G, and more verbose default behavior - with fuzz. - - * pch.c (intuit_diff_type): Record times reported for files in headers. - Remove head_says_nonexistent[x], since it's now equivalent to - !timestamp[x]. - * util.h (fetchname): Change argument head_says_nonexistent to - timestamp. - * util.c: #include for TM_LOCAL_ZONE. - Don't include since common.h now includes it. - (ok_to_reverse): noreverse and batch cases now output regardless of - verbosity. - (fetchname): Change argument head_says_nonexistent to pstamp, and - store header timestamp into *pstamp. - If -T or -Z option is given, match time stamps more precisely. - (ask): Remove unnecessary close of ttyfd. - When there is no terminal at all, output a newline to make the - output look nicer. After reporting EOF, flush stdout; - when an input error, report the error type. - - * inp.c (get_input_file): - Ask user whether to get file if patch_get is negative. - - * Makefile.in (clean): Don't clean */*.o; clean core* and *core. - -1997-06-04 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.5. - - * util.c (ok_to_reverse): - Be less chatty if verbosity is SILENT and we don't - have to ask the user. If force is nonzero, apply the patch anyway. - - * pch.c (there_is_another_patch): - Before skipping rest of patch, skip to - the patch start, so that another_hunk can skip it properly. - (intuit_diff_type): Slight wording change for missing headers, to - regularize with other diagnostics. Fix off-by-one error when setting - p_input_line when scanning the first hunk to check for deleted files. - -1997-06-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.4. - - * NEWS: Now matches more generously against nonexistent or empty files. - - * pch.c (there_is_another_patch): Move warning about not being - able to intuit file names here from skip_to. - (intuit_diff_type): Fatal error if we find a headless unified - or context diff. - - * util.c (ask): Null-terminate buffer properly even if it grew. - (fetchname): No need to test for null first argument. - -1997-06-02 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.3. - * pch.c (p_says_nonexistent, pch_says_nonexistent): Is now 1 for empty, - 2 for nonexistent. - (intuit_diff_type): Set p_says_nonexistent according to new meaning. - Treat empty files like nonexistent files when reversing. - (skip_to): Output better diagnostic when we can't intuit a file name. - * patch.c (main): - Count bytes, not lines, when testing whether a file is empty, - since it may contain only non-newline chars. - pch_says_nonexistent now returns 2 for nonexistent files. - -1997-06-01 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.2. - * pch.c (open_patch_file): - Fix bug when computing size of patch read from a pipe. - -1997-05-30 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.1. - - * Makefile.in (transform, patch_name): New vars, - for proper implementation of AC_ARG_PROGRAM. - (install, uninstall): Use them. - (install-strip): New rule. - * pc/djgpp/config.sed (program_transform_name): Set to empty. - -1997-05-30 Paul Eggert - - * configure.in (VERSION), NEWS: Version 2.3 released. - * patch.man: Fix two font typos. - * util.c (doprogram): Fix misspelled decl. - -1997-05-26 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.93. - - * pch.c (open_patch_file): - Fatal error if binary_transput and stdin is a tty. - - * pc/djgpp/config.sed (chdirsaf.c): - Use sed instead of cp, since cp might not be installed. - * pc/djgpp/configure.bat: - Prepend %srcdir% to pathname of config.sed, for crosscompiles. - -1997-05-25 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.92. - (D_INO_IN_DIRENT): New macro. - * pc/djgpp/config.h, acconfig.h (D_INO_IN_DIRENT): New macro. - * backupfile.c (REAL_DIR_ENTRY): - Depend on D_INO_IN_DIRENT, not _POSIX_VERSION. - - * addext.c (addext): Adjust slen when adjusting s for DOS 8.3 limit. - Do not use xxx.h -> xxxh~ hack. - - * util.c: (move_file): Avoid makedirs test when possible even - if FILESYSTEM_PREFIX_LEN (p) is nonzero. Don't play - case-changing tricks to come up with backup file name; it's - not portable to case-insensitive file systems. - * common.h (ISLOWER): Remove. - - * inp.c (scan_input): Don't use Plan A if (debug & 16). - - * patch.c (shortopts): Add -g, -G. - (longopts): --help now maps to 132, not 'h', to avoid confusion. - (get_some_switches): Likewise. - Don't invoke setmode on input if --binary; wait until needed. - Don't ever invoke setmode on stdout. - * pch.c (open_patch_file): Setmode stdin to binary if binary_transput. - - * patch.man: Fix documentation of backup file name to match behavior. - Add advice for ordering of patches of derived files. - Add /dev/tty to list of files used. - * README: Adjust instructions for building on DOS. - * pc/djgpp/README: Remove tentative wording. - * NEWS: The DOS port is now tested. - Backup file names are no longer computed by switching case. - - * pc/chdirsaf.c (ERANGE): Include to define it. - (restore_wd): chdir unconditionally. - (chdir_safer): Invoke atexit successfully at most once. - * pc/djgpp/config.sed: Use chdirsaf.o, not pc/chdirsaf.o. - Replace CONFIG_HDRS, don't append. - Use $(srcdir) in CONFIG_STATUS. - Don't apply $(SHELL) to $(CONFIG_STATUS). - Append rules for chdirsaf.o, chdirsaf.c; clean chdirsaf.c at the end. - * pc/djgpp/configure.bat: Append CR to each line; DOS needs this. - Don't use | as sed s delimiter; DOS can't handle it. - -1997-05-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.91. - - * pch.c (another_hunk): - Fix bug with computing size of prefix and suffix context - with ordinary context diffs. Report malformed patch if a unified diff - has nothing but context. - - * inp.c (get_input_file): - Use patch_get, not backup_type, to decide whether to - get from RCS or SCCS. Use the word `get' in diagnostics. - * patch.c (main): Initialize patch_get from PATCH_GET. - Omit DEFAULT_VERSION_CONTROL hook; it just leads to nonstandarization. - (longopts, option_help, get_some_switches): Add support for -g, -G. - (option_help): Add bug report address. - * common.h (patch_get): New decl. - * patch.man: Add -g and -G options; use `get' instead of `check out'. - Add PATCH_GET. Recommend -Naur instead of -raNU2 for diff. - * NEWS: Describe -g, -G, PATCH_GET. - - * version.c (copyright_string): Use only most recent copyright year, - as per GNU standards. - - * Makefile.in (DISTFILES_PC): Remove pc/quotearg.c. - * pc/djgpp/config.sed: Remove unnecessary hooks for quotearg and SHELL. - -1997-05-18 Paul Eggert - - * configure.in (VERSION): Increase to 2.2.9. - (AC_TYPE_MODE_T): Add. - - * pch.h (another_hunk): New parameter REV. - * pch.c (hunkmax): Now of type LINENUM. - (malformed): Add decl. - (there_is_another_patch): Skip inname-detection if skip_rest_of_patch. - (intuit_diff_type): To determine whether file appears to have been - deleted, look at replacement, not pattern. - If there is a mismatch between existence of file and whether the - patch claims to change whether the file exists, ask whether to - reverse the patch. - (another_hunk): New parameter REV specifying whether to reverse the - hunk. All callers changed. - (do_ed_script): Add assertion to ensure input file exists. - - * util.h (create_file): New function. - (copy_file): Now takes mode, not struct stat. - (makedirs): No longer exported. - (move_file): Now takes mode, not struct stat. - * util.c (makedirs): No longer exported. - (move_file): Accept mode of destination, not struct stat. - All callers changed. - Quote file names in diagnostics. - Create parent dir of destination if necessary. - Don't use ENOTDIR. - Don't unlink source; it will be unlinked later. - Unlink destination if FROM is zero. - (create_file): New function. - (copy_file): Accept mode of destination, not struct stat. - All callers changed. - Use create_file to create file. - (ok_to_reverse): Moved here from patch.c. Now accepts format and args; - all callers changed. - (mkdir): 2nd arg is now mode_t, for better compatibility. - (replace_slashes): Ignore slashes at the end of the filename. - - * common.h (noreverse): New decl. - (ok_to_reverse): Remove decl. - - * patch.c (noreverse): Now extern. - (main): New environment var PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - Don't assert(hunk) if we're skipping the patch; we may not have any hunks. - When removing a file, back it up if backups are desired. - Don't chmod output file if input file did not exist. - chmod rej file to input file's mode minus executable bits. - (locate_hunk): Go back to old way of a single fuzz parameter, but - handle it more precisely: context diffs with partial contexts - can only match file ends, since the partial context can occur - only at the start or end of file. - All callers changed. - (create_output_file): Use create_file to create files. - (ok_to_reverse): Move to util.c. - - * inp.c (scan_input, get_input_file): Quote file names in diagnostics. - (get_input_file): Set inerrno if it's not already set. - Don't create file; it's now the caller's responsibility. - (plan_b): Use /dev/null if input size is zero, since it might not exist. - Use create_file to create temporary file. - - * NEWS: Add PATCH_VERSION_CONTROL; DOS port is untested. - - * pc/djgpp/config.h: Add comment for mode_t. - - * pc/djgpp/README: Note that it's not tested. - - * patch.man: PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - -1997-05-15 Paul Eggert - - * configure.in: Add AC_PREREQ(2.12). - (VERSION): Bump to 2.2.8. - (ed_PROGRAM): Rename from ED_PROGRAM. - - * pch.c (prefix_components): Support DOS file names better. - Fix typo that caused fn to almost always yield 0. - - * util.c (, ): Include. - (move_file, copy_file): Add support for DOS filenames. - Preserve mode of input files when creating temp files. - Add binary file support. - (doprogram, rmdir): New functions. - (mkdir): Use doprogram. - (replace_slashes): Add support for DOS filenames. - (removedirs): New function. - (init_time)): New function. - (initial_time): New var. - (fetchname): Add support for deleted files, DOS filenames. - - * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): - New macros, for DOS port. - (base_name): Use them. - - * addext.c (HAVE_DOS_FILE_NAMES): New macro. - : Include if HAVE_LIMITS_H. - (addext): Handle hosts with DOS file name limits. - - * common.h (LONG_MIN): New macro. - (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. - (ok_to_create_file): Remove. - (reverse): Now int. - (ok_to_reverse): New function decl. - (O_WRONLY, _O_BINARY, O_BINARY, O_CREAT, O_TRUNC): New macros. - (binary_transput): New var decl. - - * Makefile.in (ed_PROGRAM): Renamed from ED_PROGRAM. - (CONFIG_HDRS, CONFIG_STATUS): New vars. - (SRCS): Add maketime.c, partime.c. - (OBJS): Likewise. - (HDRS): Add maketime.h, partime.h. - (DISTFILES_PC, DISTFILES_PC_DJGPP): New vars. - (Makefile, config.status): Use CONFIG_STATUS, not config.status. - (clean): Remove */*.o. - (dist): Add pc and pc/djgpp subdirectories. - ($(OBJS)): Depend on $(CONFIG_HDRS) instead of config.h. - (maketime.o, partime.o): New rules. - (util.o): Depend on maketime.h. - - * patch.c (main): - Call init_time. Add DEFAULT_VERSION_CONTROL hook for people who - prefer the old ways. Build temp file names before we might invoke cleanup. - Add support for deleted files and clean up the patch-swapping code a bit. - Delete empty ancestors of deleted files. - When creating temporaries, use file modes of original files. - (longopts, get_some_switches): New option --binary. - (get_some_switches): Report non-errno errors with `fatal', not `pfatal'. - (create_output_file): New function, which preserves modes of original files - and supports binary transput. - (init_output, init_reject): Use it. - (ok_to_reverse): New function. - (TMPDIR): New macro. - (make_temp): Use $TMPDIR, $TMP, $TEMP, or TMPDIR, whichever comes first. - - * pch.c (p_says_nonexistent): New var. - (open_patch_file): Add binary transput support. - Apply stat to file names retrieved from user. - Reject them if they don't exist. - (intuit_diff_type): Add support for deleting files. - Don't treat trivial directories any differently. - Avoid stating the same file twice in common case of context diffs. - (prefix_components): Don't treat trivial directories any differently. - Add support for DOS filenames. - (pch_says_nonexistent): New function. - (do_ed_script): Preserve mode of input files when creating temp files. - Add support for binary transput. - - * pch.h (pch_says_nonexistent): New decl. - - * util.h (replace_slashes): No longer exported. - (fetchname): Add support for deleted files. - (copy_file, move_file): Add support for preserving file modes. - (init_time, removedirs): New functions. - - * argmatch.c: Converge with fileutils. - - * backupfile.c: Converge with fileutils. - (find_backup_file_name): Treat .~N~ suffix just like any other suffix - when handling file names that are too long. - - * inp.c: - In messages, put quotes around file names and spaces around "--". - (get_input_file): Allow files to be deleted. Do the expense of - makedirs only if we can't create the file. - (plan_a, plan_b): Add support for binary transput. - - * pc/chdirsaf.c, pc/djgpp/README, pc/djgpp/config.h, pc/djgpp/config.sed, pc/djgpp/configure.bat, pc/quotearg.c: - New file. - - * NEWS: - New methods for removing files; adjust file name intuition again. - Add description of MS-DOS and MS-Windows ports. - - * patch.man: - Simplify file name intuition slightly (no distinction for trivial dirs). - Add --binary. Describe how files and directories are deleted. - Suggest diff -a. Include caveats about what context diffs cannot represent. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.7. - (CPPFLAGS, LDFLAGS, LIBS): If the user has not set any of these vars, - prefer support for large files if available. - - * common.h (_LARGEFILE_SOURCE): Define. - (file_offset): New typedef. - (file_seek, file_tell): New macros. - - * patch.c (main): - Remove empty files by default unless POSIXLY_CORRECT is set. - - * util.c, util.h (Fseek): - Use file_offset instead of long, for portability to large-file hosts. - - * pch.c: (p_base, p_start, next_intuit_at, skip_to, open_patch_file, - intuit_diff_type, another_hunk, incomplete_line, do_ed_script): - Use file_offset instead of long, for portability to large-file hosts. - (prefix_components): Renamed from path_name_components; count only - nontrivial prefix components, and take a 2nd EXISTING arg. - (existing_prefix_components): Remove; subsumed by prefix_components. - (intuit_diff_type): When creating files, try for the creation of the - fewest directories. - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: - When creating a file, use a name whose existing directory prefix - contains the most nontrivial path name components. - Add advice for creating patches and applying them. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: Describe above change to pch.c. - Add advice for creating patches and applying them. - -1997-05-05 Paul Eggert - - * configure.in (VERSION): Update to 2.2.5. - - * quotearg.h, quotearg.c: New files. - * Makefile.in (SRCS, OBJS, HDRS): Mention new files. - (inp.o, util.o): Now depends on quotearg.h. - (quotearg.o): New makefile rule. - - * common.h (posixly_correct): New var. - * patch.c (main): Initialize it. - If ! posixly_correct, default backup type is now `existing'. - SIMPLE_BACKUP_SUFFIX no longer affects backup type. - (backup): Remove var. - - * util.h: (countdirs): Remove. - (systemic): New decl. - * util.c (move_file): Try making the parent directory of TO - if backup prefix or suffix contain a slash. - (ask): Remove arbitrary limit on size of result. - (systemic): New function. - (mkdir): Work even if arg contains shell metacharacters. - (replace_slashes): Return 0 if none were replaced. - Don't replace slash after . or .. since it's redundant. - (countdirs): Remove. - (makedirs): Ignore mkdir failures. - - * NEWS, patch.man: More POSIXLY_CORRECT adjustments. - Describe new rules for how file names are intuited. - -1997-04-17 Paul Eggert - - * configure.in (VERSION): Version 2.2 released. - - * Makefile.in (config.hin): - Remove before building; we always want the timestamp updated. - - * inp.c (get_input_file): - Look for RCS files only if backup_type == numbered_existing. - - * NEWS, patch.man: - Remove mention of never-implemented -V rcs and -V sccs options. - * patch.man: `pathname' -> `file name' - Correct the description of how file names are found in diff headers. - Clarify the distinction between ordinary and unified context diffs. - -1997-04-13 Paul Eggert - - * configure.in (VERSION): Update to 2.1.7. - - * patch.c (numeric_optarg): New function. - (get_some_switches): Use it. - - * pch.c (intuit_diff_type): When creating a file, prefer a name whose - existing dir prefix is the longest. - - * util.h (countdirs): New function. - * util.c (replace_slashes, countdirs): New functions. - (makedirs): Use replace_slashes, to be more like countdirs. - - * patch.man: Explain -pN vs -p N. Recommend --new-file. - Explain possible incompatibility with strip count. - -1997-04-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.1.6. - (AC_CHECK_HEADERS): Remove stdlib.h (i.e. remove HAVE_STDLIB_H). - - * Makefile.in: (HDRS, patchlevel.h, TAGS, distclean, maintainer-clean): - Don't distribute patchlevel.h; let the user do it. - This works around some obscure (possibly nonexistent?) `make' bugs. - - * common.h (program_name): extern, not XTERN. - (): Include if STDC_HEADERS, not if HAVE_STDLIB_H. - (atol, getenv, malloc, realloc): Don't worry whether they're #defined. - - * patch.c (get_some_switches): - Add special hack for backwards compatibility with CVS 1.9. - (-B, -Y, -z): Now set backup_type = simple. - - * NEWS: Fix misspellings; minor reformatting. - * README: Report POSIX.2 compliance. - -1997-04-06 Paul Eggert - - Move all old RCS $Log entries into ChangeLog. - #include all files with < >, not " ". - - * addext.c, argmatch.c, argmatch.h, memchr.c, install-sh: - New files. - * EXTERN.h, INTERN.h: Removed. - * config.hin: Renamed from config.h.in. - - * acconfig.h (NODIR): Remove. - (HAVE_MEMCHR): Add. - - * configure.in (AC_ARG_PROGRAM, AC_PROG_MAKE_SET, HAVE_MEMCHR): Add. - (AC_CHECK_HEADERS): Replaces obsolescent AC_HAVE_HEADERS. - Add stdlib.h, string.h, unistd.h, varargs.h. - Delete obsolete call to AC_UNISTD_H. - (AC_CONFIG_HEADER): Rename config.h.in to config.hin. - (AC_C_CONST): Replaces obsolescent AC_CONST. - (AC_CHECK_FUNC): Check for getopt_long; define LIBOBJS and substitute - for it accordingly. - (AC_CHECK_FUNCS): Replaces obsolescent AC_HAVE_FUNCS. - Add _doprintf, isascii, mktemp, sigaction, sigprocmask, sigsetmask. - Remove strerror. - (AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VPRINTF): Add. - (AC_HEADER_DIRENT): Replaces obsolescent AC_DIR_HEADER. - (AC_HEADER_STDC): Replaces obsolescent AC_STDC_HEADERS. - (AC_SYS_LONG_FILE_NAMES): Replaces obsolescent AC_LONG_FILE_NAMES. - (AC_TYPE_OFF_T): Replaces obsolescent AC_OFF_T. - (AC_TYPE_SIGNAL): Replaces obsolescent AC_RETSIGTYPE. - (AC_TYPE_SIZE_T): Replaces obsolescent AC_SIZE_T. - (AC_XENIX_DIR): Remove. - (ED_PROGRAM): New var. - (NODIR): Remove. - (PACKAGE, VERSION): New vars; substitute them with AC_SUBST. - - * Makefile.in: Conform to current GNU build standards. - Redo dependencies. Use library getopt_long if available. - Use `&&' instead of `;' inside shell commands where applicable; - GNU make requires this. - Use double-colon rules for actions that do not build files. - (@SET_MAKE@): Added. - (CFLAGS, LDFLAGS, prefix, exec_prefix): Base on @ versions of symbols. - (COMPILE, CPPFLAGS, DEFS, ED_PROGRAM, LIBOBJS, LIBSRCS, PACKAGE, - VERSION): New symbols. - (SRCS, OBJS, HDRS, MISC): Add new files. - (man1dir): Renamed from mandir. - (man1ext): Renamed from manext. - (patch): Put -o first. - (install): Use $(transform) to allow program to be renamed by configure. - (patchlevel.h): Build from $(VERSION). - (dist): Get version number from $(VERSION) and package name from - $(PACKAGE). - (TAGS): Scan $(HDRS). - (maintainer-clean): Renamed from realclean. Remove patchlevel.h. - - * backupfile.h (simple_backup_suffix): Now const *. - (find_backup_file_name, base_name, get_version): Args are now const *. - (base_name): New decl. - * backupfile.c (): Include only if HAVE_CONFIG_H. - (): Include. - (): Include if HAVE_STRING_H, not if STDC_HEADERS. - (): Include if !HAVE_STRING_H. - (): Do not include. - (): Redo include as per current autoconf standards. - (): Include if HAVE_LIMITS_H. Define CHAR_BIT if not defined. - (NLENGTH): Now returns size_t. - (CLOSEDIR, INT_STRLEN_BOUND): New macros. - (ISDIGIT): Use faster method. - (find_backup_file_name): No longer depends on NODIR. - Remove redundant code. - (make_version_name): Remove; do it more portably. - (max_backup_version): Args are now const *. - (version_number): Simplify digit checking. - (basename, concat, dirname): Remove. - (argmatch, invalid_arg): Move to argmatch.c. Simplify test for - ambiguous args. When reporting an error, use program_name not "patch". - (addext): Move to addext.c. Treat all negative values from pathconf - like -1. Always use long extension if it fits, even if the filesystem - does not support long file names. - (backup_types): Now const. - - * common.h, inp.h (XTERN): Renamed from EXT to avoid collision - with errno.h reserved name space. - - * common.h (DEBUGGING): Now an integer; default is 1. - (enum diff): New type. - (diff_type): Use it instead of small integers. - (CONTEXT_DIFF, NORMAL_DIFF, ED_DIFF, NEW_CONTEXT_DIFF, UNI_DIFF): - Now enumerated values instead of macros. - (NO_DIFF): New enumerated value (used instead of 0). - (volatile): Default to the empty string if __STDC__ is not defined. - (): Do not include. - (Chmod, Close, Fclose, Fflush, Fputc, Signal, Sprintf, Strcat, - Strcpy, Unlink, Write): Remove these macros; casts to void are - not needed for GNU coding standards. - (INITHUNKMAX): Move to pch.c. - (malloc, realloc, INT_MIN, MAXLINELEN, strNE, strnNE, - Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, Reg8, Reg9, Reg10, Reg11, - Reg12, Reg13, Reg14, Reg15, Reg16): Remove these macros. - (S_IXOTH, S_IWOTH, S_IROTH, S_IXGRP, S_IWGRP, - S_IRGRP, S_IXUSR, S_IWUSR, S_IRUSR, O_RDONLY, O_RDWR): - Define these macros, if not defined. - (CTYPE_DOMAIN, ISLOWER, ISSPACE, ISDIGIT, PARAMS): New macros. - (instat): Renamed from filestat; used for input file now. - (bufsize, using_plan_a, debug, strippath): Not statically initialized. - (debug): #define to 0 if not DEBUGGING, so that users of `debug' - no longer need to be surrounded by `#if DEBUGGING'. - (out_of_mem, filec, filearg, outname, toutkeep, trejkeep): Remove. - (inname, inerrno, dry_run, origbase): New variables. - (origprae): Now const*. - (TMPOUTNAME, TMPINNAME, TMPPATNAME): Now const*volatile. - (verbosity): New variable; subsumes `verbose'. - (DEFAULT_VERBOSITY, SILENT, VERBOSE): Values in a new enum. - (verbose): Removed. - (VOID): Use `#ifdef __STDC__' instead of`#if __STDC__', - for consistency elsewhere. - (__attribute__): New macro (empty if not a recent GCC). - (fatal_exit): Renamed from my_exit. - (errno): Don't define if STDC_HEADERS. - (): Include if either STDC_HEADERS or HAVE_STRING_H. - (memcmp, memcpy): Define if !STDC_HEADERS && !HAVE_STRING_H - && !HAVE_MEMCHR. - (): Include if HAVE_STDLIB_H, not if STDC_HEADERS. - (atol, getenv, malloc, realloc, lseek): Declare only if not defined - as a macro. - (popen, strcpy, strcat, mktemp): Do not declare. - (lseek): Declare to yield off_t, not long. - (): Include only if HAVE_FCNTL_H. - - * inp.h (get_input_file): New decl. - * inp.c (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF, RCSSUFFIX, CHECKOUT, - CHECKOUT_LOCKED, RCSDIFF): Moved here from common.h. - (i_ptr): Now char const **. - (i_size): Remove. - (TIBUFSIZE_MINIMUM): Define only if not already defined. - (plan_a, plan_b): Arg is now const *. - (report_revision): Declare before use. It's now the caller's - responsibility to test whether revision is 0. - (scan_input, report_revision, get_input_file): - Be less chatty unless --verbose. - (get_input_file): New function, split off from plan_a. - Reuse file status gotten by pch if possible. Allow for dry run. - Use POSIX bits for creat, not number. Check for creation and - close failure, and use fstat not stat. Use memcpy not strncpy. - (plan_a): Rewrite for speed. - Caller now assigns result to using_plan_a. - Don't bother reading empty files; during dry runs they might not exist. - Use ISSPACE, not isspace. - (plan_b): Allow for dry runs. Use ISSPACE, and handle sign extension - correctly on arg. Use POSIX symbol for open arg. - - * patch.c (backup, output, patchname, program_name): New vars. - (last_frozen_line): Moved here from inp.h. - (TMPREJNAME): Moved here from common.h. - (optind_last): Removed. - (do_defines, if_defined, not_defined, else_defined, end_defined): - Now char const. Prepend with \n (except for not_defined) to - allow for files ending in non-newline. - (Argv): Now char*const*. - (main, get_some_switches): Exit status 0 means success, - 1 means hunks were rejected, 2 means trouble. - (main, locate_hunk, patch_match): Keep track of patch prefix context - separately from suffix context; this fixes several bugs. - (main): Initialize bufsize, strippath. - Be less chatty unless --verbose. - No more NODIR; always have version control available. - Require environment variables to be nonempty to have effect. - Add support for --dry-run, --output, --verbose. - Invoke get_input_file first, before deciding among do_ed_script, - plan_a, or plan_b. - Clear ofp after closing it, to keep discipline that ofp is either - 0 or open, to avoid file descriptor leaks. Conversely, rejfp doesn't - need this trick since static analysis is enough to show when it - needs to be closed. - Don't allow file-creation patches to be applied to existing files. - Misordered hunks are now not fatal errors; just go on to the next file. - It's a fatal error to fall back on plan B when --output is given, - since the moving hand has writ. - Add support for binary files. - Check for I/O errors. - chmod output file ourselves, rather than letting move_file do it; - this saves global state. - Use better grammar when outputting hunks messages, e.g. avoid - `1 hunks'. - (main, reinitialize_almost_everything): - Remove support for multiple file arguments. - Move get_some_switches call from reinitialize_almost_everything - to main. - (reinitialize_almost_everything): No need to reinitialize things - that are no longer global variables, e.g. outname. - (shortopts): Remove leading "-"; it's no longer important to - return options and arguments in order. '-b' no longer takes operand. - -p's operand is no longer optional. Add -i, -Y, -z. Remove -S. - (longopts): --suffix is now pared with -z, not -b. --backup now - means -b. Add --input, --basename-prefix, --dry-run, --verbose. - Remove --skip. --strip's operand is now required. - (option_help): New variable. Use style of current coding standards. - Change to match current option set. - (usage): Use it. - (get_some_switches): Get all switches, since `+' is defunct. - New options -i, -Y, -z, --verbose, --dry-run. - Option -S removed. - -b now means backup (backup_type == simple), not simple_backup_suffix. - -B now implies backup, and requires nonempty operand. - -D no longer requires first char of argument to be an identifier. - `-o -' is now disallowed (formerly output to regular file named "-"). - -p operand is now required. - -v no longer needs to cleanup (no temp files can exist at that point). - -V now implies backup. - Set inname, patchname from file name arguments, if any; - do not set filearg. It's now an error if extra operands are given. - (abort_junk): Check for write errors in reject file. - (apply_hunk, copy_till): Return error flag, so that failure to apply - out-of-order hunk is no longer fatal. - (apply_hunk): New arg after_newline, - for patching files not ending in newline. - Cache ofp for speed. Check for write errors. - (OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE): Now part of an enumerated type - instead of being #defined to small integers. - Change while-do to do-while when copying !-part for R_do_defines, - since condition is always true the first time through the loop. - (init_output, init_reject): Arg is now const *. - (copy_till, spew_output): Do not insert ``missing'' newlines; - propagate them via new after_newline argument. - (spew_output): Nothing to copy if last_frozen_line == input lines. - Do not close (ofp) if it's null. - (dump_line): Remove. - (similar): Ignore presence or absence of trailing newlines. - Check for only ' ' or '\t', not isspace (as per POSIX.2). - (make_temp): Use tmpnam if mktemp is not available. - (cleanup): New function. - (fatal_exit): Use it. Renamed from my_exit. - Take signal to exit with, not exit status (which is now always 2). - - * pch.h, pch.c (pch_prefix_context, pch_suffix_context): - New fns replacing pch_context. - (another_hunk): Now yields int, not bool; -1 means out of memory. - Now takes difftype as argument. - (pch_write_line): Now returns boolean indicating whether we're after - a newline just after the write, for supporting non-text files. - * pch.c (isdigit): Remove; use ISDIGIT instead. - (INITHUNKMAX): Moved here from common.h. - (p_context): Removed. We need to keep track of the pre- and post- - context separately, in: - (p_prefix_context, p_suffix_context): New variables. - (bestguess): Remove. - (open_patch_file): Arg is now char const *. - Copy file a buffer at a time, not a char at a time, for speed. - (grow_hunkmax): Now returns success indicator. - (there_is_another_patch, skip_to, another_hunk, do_ed_script): - Be less chatty unless --verbose. - (there_is_another_patch): - Avoid infinite loop if user input keeps yielding EOF. - (intuit_diff_type): New returns enum diff, not int. - Strip paths as they're being fetched. - Set ok_to_create_file correctly even if patch is reversed. - Set up file names correctly with unidiff output. - Use algorithm specified by POSIX 1003.2b/D11 to deduce - name of file to patch, with the exception of patches - that can create files. - (skip_to): Be verbose if !inname, since we're about to ask the - user for a file name and the context will help the user choose. - (another_hunk): Keep context as LINENUM, not int. - If the replacement is missing, calculate its context correctly. - Don't assume input ends in newline. - Keep track of patch prefix context separately from suffix context; - this fixes several bugs. - Don't assume blank lines got chopped if the replacement is missing. - Report poorly-formed hunks instead of aborting. - Do not use strcpy on overlapping strings; it's not portable. - Work even if lines are incomplete. - Fix bugs associated with context-less context hunks, - particularly when patching in reverse. - (pget_line): Now takes just 1 arg; instead of second arg, - just examine using_plan_a global. Return -1 if we ran out - of memory. - (do_ed_script): Now takes output FILE * argument. - Take name of editor from ED_PROGRAM instead of hardwiring /bin/ed. - Don't bother unlinking TMPOUTNAME. - Check for popen failure. - Flush pipe to check for output errors. - If ofp is nonzero, copy result to it, instead of trying to - move the result. - - * util.h, util.c (say1, say2, say3, say4, fatal1, fatal2, fatal3, - fatal4, pfatal1, pfatal2, pfatal3, pfatal4, ask1, ask2, ask3, ask4): - Remove; replaced with following. - (ask, say, fatal, pfatal): New stdarg functions. - (fetchname): Remove last, `assume_exists' parameter. - (savebuf, savestr, move_file, copy_file): Args are now const *. - (exit_with_signal): New function, for proper process status if - a signal is received as per POSIX.2. - (basename): Rename to `base_name' and move to backupfile. - * util.c (): Include here, not in common.h. - (vararg_start): New macro. - (va_dcl, va_start, va_arg, va_end): Define if neither - nor are available. - (SIGCHLD): Define to SIGCLD if SIGCLD is defined and - SIGCHLD isn't. - (private_strerror): Remove. - (move_file): Remove option of moving to stdout. - Add support for -Y, -z. - Don't assume chars in file name are nonnegative. - Use copy_file if rename fails due to EXDEV; - report failure if rename fails for any other reason. - (copy_file, makedirs): Use POSIX symbols for permissions. - (copy_file): Open source before destination. - (remove_prefix): New function. - (vfprintf): New function, if !HAVE_VPRINTF. - (afatal, apfatal, zfatal, zpfatal, errnum): Remove. - (fatal, pfatal, say): New functions that use stdarg. - All callers changed. - (zask): Renamed from `ask'. Now uses stdarg. Output to stdout, - and read from /dev/tty, or if that cannot be opened, from - stderr, stdout, stdin, whichever is first a tty. - Print "EOF" when an EOF is read. Do not echo input. - (sigs): New array. - (sigset_t, sigemptyset, sigmask, sigaddset, sigismember, SIG_BLOCK, - SIG_UNBLOCK, SIG_SETMASK, sigprocmask, sigblock, sigsetmask): - Define substitutes if not available. - (initial_signal_mask, signals_to_block): New vars. - (fatal_exit_handler): New function, if !HAVE_SIGACTION. - (set_signals, ignore_signals): Use sigaction and sigprocmask style - signal-handling if possible; it doesn't lose signals. - (set_signals): Default SIGCHLD to work around SysV fork+wait bug. - (mkdir): First arg is now const *. - (makedirs): Handle multiple adjacent slashes correctly. - (fetchname): Do not worry about whether the file exists - (that is now the caller's responsibility). - Treat a sequence of one or more slashes like one slash. - Do not unstrip leading directories if they all exist and if - no -p option was given; POSIX doesn't allow this. - (memcmp): Remove (now a macro in common.h). - - * version.c (copyright_string, free_software_msgid, authorship_msgid): - New constants. - (version): Use them. Use program_name instead of hardwiring it. - - * patch.man: Generate date from RCS Id. - Rewrite to match the above changes. - -Fri Jul 30 02:02:51 1993 Paul Eggert (eggert@twinsun.com) - - * configure.in (AC_HAVE_FUNCS): Add mkdir. - - * common.h (Chmod, Fputc, Write, VOID): New macros. - (malloc, realloc): Yield `VOID *', not `char *'. - - * util.h (makedirs): Omit `striplast' argument. Remove `aask'. - - * inp.c (plan_a): Remove fixed internal buffer. Remove lint. - - * util.c (set_signals, ignore_signals): Trap SIGTERM, too. - (makedirs): Removed fixed internal buffer. Omit `striplast' argument. - (mkdir): New function, if !HAVE_MKDIR. - (fetchname): Remove fixed internal buffer. - Remove lint from various functions. - - * patch.c, pch.c: Remove lint. - -Thu Jul 29 20:52:07 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * Makefile.in (config.status): Run config.status --recheck, not - configure, to get the right args passed. - -Thu Jul 29 07:46:16 1993 Paul Eggert (eggert@twinsun.com) - - * The following changes remove all remaining fixed limits on memory, - and fix bugs in patch's handling of null bytes and files that do not - end in newline. `Patch' now works on binary files. - - * backupfile.c (find_backup_file_name): Don't dump core if malloc fails. - - * EXTERN.h, INTERN.h (EXITING): New macro. - * backupfile.[ch], patch.c, pch.c: Add PARAMS to function declarations. - - * common.h (bool): Change to int, so ANSI C prototype promotion works. - (CANVARARG): Remove varargs hack; it wasn't portable. - (filearg): Now a pointer, not an array, so that it can be reallocated. - (GET*, SCCSDIFF, CHECKOUT*, RCSDIFF): Quote operands to commands. - (my_exit): Declare here. - (BUFFERSIZE, Ctl, filemode, Fseek, Fstat, Lseek, MAXFILEC, MAXHUNKSIZE, - Mktemp, myuid, Null, Nullch, Nullfp, Nulline, Pclose, VOIDUSED): Remove. - All invokers changed. - (Argc, Argv, *define[sd], last_offset, maxfuzz, noreverse, ofp, - optind_last, rejfp, rejname): No longer externally visible; all - definers changed. - (INT_MAX, INT_MIN, STD*_FILENO, SEEK_SET): Define if the underlying - system doesn't. Include for this. - - * configure.in: Add limits.h, memcmp. Delete getline. - - * inp.c (tibufsize): New variable; buffers grow as needed. - (TIBUFSIZE_MINIMUM): New macro. - (report_revision): New function. - (plan_a): Do not search patch as a big string, since that fails - if it contains null bytes. - Prepend `./' to filenames starting with `-', for RCS and SCCS. - If file does not match default RCS/SCCS version, go ahead and patch - it anyway; warn about the problem but do not report a fatal error. - (plan_b): Do not use a fixed buffer to read lines; read byte by byte - instead, so that the lines can be arbitrarily long. Do not search - lines as strings, since they may contain null bytes. - (plan_a, plan_b): Report I/O errors. - - * inp.c, inp.h (rev_in_string): Remove. - (ifetch): Yield size of line too, since strlen no longer applies. - (plan_a, plan_b): No longer exported. - - * patch.c (abort_hunk, apply_hunk, patch_match, similar): - Lines may contain NUL and need not end in newline. - (copy_till, dump_line): Insert newline if appending after partial line. - All invokers changed. - (main, get_some_switches, apply_hunk): Allocate *_define[ds], filearg, - rejname dynamically. - (make_temp): New function. - (main): Use it. - (main, spew_output, dump_line) Check for I/O errors. - - * pch.c (open_patch_file): Don't copy stdin to a temporary file if - it's a regular file, since we can seek on it directly. - (open_patch_file, skip_to, another_hunk): The patch file may contain - NULs. - (another_hunk): The patch file may contain lines starting with '\', - which means the preceding line lacked a trailing newline. - (pgetline): Rename to pget_line. - (get_line, incomplete_line, pch_write_line): New functions. - (pch_line_len): Return size_t, not short; lines may be very long. - (do_ed_script): Check for I/O errors. Allow scripts to contain - 'i' and 's' commands, too. - - * pch.h (pfp, grow_hunkmax, intuit_diff_type, next_intuit_at, skip_to, - pfetch, pgetline): No longer exported. - (pch_write_line): New declaration. - (getline): Removed. - - * util.c (move_file, fetchname): Use private stat buffer, so that - filestat isn't lost. Check for I/O errors. - (savestr): Use savebuf. - (zask): Use STD*_FILENO instead of 0, 1, 2. - (fetchname): strip_leading defaults to INT_MAX instead of 957 (!). - (memcmp): Define if !HAVE_MEMCMP. - - * util.c, util.h (say*, fatal*, pfatal*, ask*): Delete; these - pseudo-varargs functions weren't ANSI C. Replace by macros - that invoke [fs]printf directly, and invoke new functions - [az]{say,fatal,pfatal,ask} before and after. - (savebuf, read_fatal, write_fatal, memory_fatal, Fseek): New functions. - (fatal*): Output trailing newline after message. All invokers changed. - - * version.c (version): Don't exit. - - * Makefile.in (SRCS): Remove getline.c. - -Thu Jul 22 15:24:24 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * EXTERN.h, INTERN.h (PARAMS): Define. - * backupfile.h, common.h, inp.h, pch.h, util.h: Use. - * backupfile.c: Include EXTERN.h. - -Wed Jul 21 13:14:05 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * getline.c: New file. - * configure.in: Check for getline (GNU libc has it). - * pch.c: Use it instead of fgets. - (pgetline): Renamed from pgets. Change callers. - * pch.h: Change decl. - - * pch.c (pgets): Tab adjusts by 8 - (indent % 8), not % 7. - Be consistent with similar code in pch.c::intuit_diff_type. - - * common.h (MEM): Typedef removed. - inp.c, pch.c, util.c: Use size_t instead of MEM. - inp.c, pch.c: Use off_t. - configure.in: Add AC_SIZE_T and AC_OFF_T. - - * common.h: Make buf a pointer and add a bufsize variable. - * util.c, pch.c, inp.c: Replace sizeof buf with bufsize. - * patch.c: malloc buf to bufsize bytes. - -Tue Jul 20 20:40:03 1993 Paul Eggert (eggert@twinsun.com) - - * common.h (BUFFERSIZE): Grow it to 8k too, just in case. - (buf): Turn `buf' back into an array; making it a pointer broke - things seriously. - * patch.c (main): Likewise. - -Tue Jul 20 20:02:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Move Reg[1-16] and CANVARARG decls from config.h.in to common.h. - * acconfig.h: New file. - * Makefile (HDRS): Add it. - -Tue Jul 20 16:35:27 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in: Remove alloca.[co]; getopt no longer needs it. - * configure.in (AC_ALLOCA): Remove. - - * util.c (set_signals, ignore_signals): Do nothing if SIGHUP - and SIGINT aren't defined. - -Tue Jul 20 17:59:56 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (main): Call xmalloc, not malloc. xmalloc buf. - * common.h: Declare xmalloc. Make buf a pointer, not an array. - - * util.c (xmalloc): Call fatal1, not fatal. - - * common.h [MAXLINELEN]: Bump from 1k to 8k. - -Thu Jul 8 19:56:16 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in (installdirs): New target. - (install): Use it. - (Makefile, config.status, configure): New targets. - -Wed Jul 7 13:25:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (get_some_switches, longopts): Recognize --help - option, and call usage. - (usage): New function. - -Fri Jun 25 07:49:45 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Don't use .orig if - numbered_existing with no existing numbered backup. - (addext): Don't use ext if !HAVE_LONG_FILE_NAMES, - even if it would fit. This matches patch's historical behavior. - (simple_backup_suffix): Default to ".orig". - * patch.c (main): Just use that default. - -Tue Jun 15 22:32:14 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (HAVE_ALLOCA_H): This #undef was missing. - * Makefile.in (info, check, installcheck): New rules. - -Sun Jun 13 14:31:29 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (index, rindex): Remove unused macro - definitions; they get in the way when porting to AIX. - * config.h.in, configure.in (HAVE_STRING_H): Remove unused defn. - -Thu Jun 10 21:13:47 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCH_VERSION 2.1. - (The name `patch-2.0.12g12' is too long for traditional Unix.) - - * patchlevel.h (PATCH_VERSION): Renamed from PATCHLEVEL. - Now contains the entire patch version number. - * version.c (version): Use it. - -Wed Jun 9 21:43:23 1993 Paul Eggert (eggert@twinsun.com) - - * common.h: Remove declarations of index and rindex. - * backupfile.c: Likewise. - (addext, basename, dirname): Avoid rindex. - -Tue Jun 8 15:24:14 1993 Paul Eggert (eggert@twinsun.com) - - * inp.c (plan_a): Check that RCS and working files are not the - same. This check is needed on hosts that do not report file - name length limits and have short limits. - -Sat Jun 5 22:56:07 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in (.c.o): Put $(CFLAGS) after other options. - (dist): Switch from .z to .gz. - -Wed Jun 2 10:37:15 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Initialize copy of - file name properly. - -Mon May 31 21:55:21 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g11. - - * pch.c (p_Char): Renamed from p_char, which is a system type - in Tex XD88's . - - * backupfile.c: Include "config.h" first, so that `const' is - treated consistently in system headers. - -Mon May 31 16:06:23 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g10. - - * configure.in: Add AC_CONST. - * config.h.in: Add `const'. - * Makefile.in (.c.o): Add -DHAVE_CONFIG_H. - (getopt.o getopt1.o): Depend on config.h. - - * util.c (xmalloc): New function; alloca.c needs this. - -Mon May 31 00:49:40 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCHLEVEL 12g9. - - * backupfile.c, backupfile.h (addext): New function. - It uses pathconf(), if available, to determine maximum file - name length. - * patch.c (main): Use it for reject file name. - * common.h (ORIGEXT): Moved to patch.c. - * config.h.in (HAVE_PATHCONF): New macro. - * configure.in: Define it. - - * Makefile.in (dist): Use gzip, not compress. - -Sat May 29 09:42:18 1993 Paul Eggert (eggert@twinsun.com) - - * patch.c (main): Use pathconf to decide reject file name. - * common.h (REJEXT): Remove. - - * inp.c (plan_a): Don't lock the checked-out file if `patch -o' - redirected the output elsewhere. - * common.h (CHECKOUT_LOCKED, GET_LOCKED): New macros. GET and - CHECKOUT now just checkout unlocked copies. - -Fri May 28 08:44:50 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (basename): Define even if NODIR isn't defined. - * patch.c (main): Ask just once to apply a reversed patch. - -Tue Nov 24 08:09:04 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * config.h.in, common.h: Use HAVE_FCNTL_H and HAVE_STRING_H - instead of USG. - - * backupfile.c: Use SYSDIR and NDIR instead of USG. - Define direct as dirent, not vice-versa. - -Wed Sep 16 17:11:48 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (get_some_switches): optc should be int, not char. - -Tue Sep 15 00:36:46 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12g8. - -Mon Sep 14 22:01:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Makefile.in: Add uninstall target. - - * util.c (fatal, pfatal): Add some asterisks to make fatal - messages stand out more. - -Tue Aug 25 22:13:36 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main, get_some_switches), common.h, inp.c (plan_a, - plan_b), pch.c (there_is_another_patch): Add -t --batch - option, similar to -f --force. - -Mon Jul 27 11:27:07 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * common.h: Define SCCSDIFF and RCSDIFF. - * inp.c (plan_a): Use them to make sure it's safe to check out - the default RCS or SCCS version. - From Paul Eggert. - -Mon Jul 20 14:10:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.h: Declare basename. - * inp.c (plan_a), util.c (fetchname): Use it to isolate the - leading path when testing for RCS and SCCS files. - -Fri Jul 10 16:03:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (makedirs): Only make the directories that don't exist. - From chip@tct.com (Chip Salzenberg). - -Wed Jul 8 01:20:56 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main): Open ofp after checking for ed script. - Close ofp and rejfp before trying plan B. - From epang@sfu.ca (Eugene Pang). - - * util.c (fatal, pfatal): Print "patch: " before message. - * pch.c, inp.c, patch.c, util.c: Remove "patch: " from the - callers that had it. - - * common.h (myuid): New variable. - * patch.c (main): Initialize it. - * inp.c (myuid): Function removed. - (plan_a): Use the variable, not the function. - - * patch.c: Add back -E --remove-empty-files option. - -Tue Jul 7 23:19:28 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (myuid): New function. - (plan_a): Call it. Optimize stat calls. Be smarter about - detecting checked out RCS and SCCS files. - From Paul Eggert (eggert@twinsun.com). - - * inp.c, util.c, patch.c: Don't bother checking for stat() > 0. - -Mon Jul 6 13:01:52 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (move_file): Use rename instead of link and copying. - - * util.c (pfatal): New function. - * util.h: Declare it and pfatal[1-4] macros. - * various files: Use it instead of fatal where appropriate. - - * common.h, patch.c: Replace Arg[cv]_last with optind_last. - - * patch.c (main, get_some_switches): Use getopt_long. Update - usage message. - (nextarg): Function removed. - - * Rename FLEXFILENAMES to HAVE_LONG_FILE_NAMES, - VOIDSIG to RETSIGTYPE. - - * backupfile.c, common.h: Use STDC header files if available. - backupfile.h: Declare get_version. - - * COPYING, COPYING.LIB, INSTALL, Makefile.in, alloca.c, - config.h.in, configure, configure.in, getopt.[ch], getopt1.c, - rename.c: New files. - * Configure, MANIFEST, Makefile.SH, config.H, config.h.SH, - malloc.c: Files removed. - - * version.c (version): Don't print the RCS stuff, since we're - not updating it regularly. - - * patchlevel.h: PATCHLEVEL 12u7. - - * Makefile.SH (dist): New target. - Makedist: File removed. - - * inp.c (plan_a): Check whether the user can write to the - file, not whether anyone can write to the file. - -Sat Jul 4 00:06:58 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (plan_a): Try to check out read-only files from RCS or SCCS. - - * util.c (move_file): If backing up by linking fails, try copying. - From cek@sdc.boeing.com (Conrad Kimball). - - * patch.c (get_some_switches): Eliminate -E option; always - remove empty output files. - - * util.c (fetchname): Only undo slash removal for relative - paths if -p was not given. - - * Makefile.sh: Add mostlyclean target. - -Fri Jul 3 23:48:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (fetchname): Accept whitespace between `Index:' and filename. - Also plug a small memory leak for diffs against /dev/null. - From eggert@twinsun.com (Paul Eggert). - - * common.h: Don't define TRUE and FALSE if already defined. - From phk@data.fls.dk (Poul-Henning Kamp). - -Wed Apr 29 10:19:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - - * backupfile.c (get_version): Exit if given a bad backup type. - -Fri Mar 27 09:57:14 1992 Karl Berry (karl at hayley) - - * common.h (S_ISDIR, S_ISREG): define these. - * inp.c (plan_a): use S_ISREG, not S_IFREG. - * util.c (fetchname): use S_ISDIR, not S_IFDIR. - -Mon Mar 16 14:10:42 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u6. - -Sat Mar 14 13:13:29 1992 David J. MacKenzie (djm at frob.eng.umd.edu) - - * Configure, config.h.SH: Check for directory header and unistd.h. - - * patch.c (main): If -E was given and output file is empty after - patching, remove it. - (get_some_switches): Recognize -E option. - - * patch.c (copy_till): Make garbled output an error, not a warning - that doesn't change the exit status. - - * common.h: Protect against system declarations of malloc and realloc. - - * Makedist: Add backupfile.[ch]. - - * Configure: Look for C library where NeXT and SVR4 put it. - Look in /usr/ucb after /bin and /usr/bin for utilities, - and look in /usr/ccs/bin, to make SVR4 happier. - Recognize m68k predefine. - - * util.c (fetchname): Test of stat return value was backward. - From csss@scheme.cs.ubc.ca. - - * version.c (version): Exit with status 0, not 1. - - * Makefile.SH: Add backupfile.[cho]. - * patch.c (main): Initialize backup file generation. - (get_some_switches): Add -V option. - * common.h, util,c, patch.c: Replace origext with simple_backup_suffix. - * util.c (move_file): Use find_backup_file_name. - -Tue Dec 3 11:27:16 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u5. - - * Makefile.SH: Change clean, distclean, and realclean targets a - little so they agree with the GNU coding standards. - Add Makefile to addedbyconf, so distclean removes it. - - * Configure: Recognize Domain/OS C library in /lib/libc. - From mmuegel@mot.com (Michael S. Muegel). - - * pch.c: Fixes from Wayne Davison: - Patch now accepts no-context context diffs that are - specified with an assumed one line hunk (e.g. "*** 10 ****"). - Fixed a bug in both context and unified diff processing that would - put a zero-context hunk in the wrong place (one line too soon). - Fixed a minor problem with p_max in unified diffs where it would - set p_max to hunkmax unnecessarily (the only adverse effect was to - not supply empty lines at eof by assuming they were truncated). - -Tue Jul 2 03:25:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Configure: Check for signal declaration in - /usr/include/sys/signal.h as well as /usr/include/signal.h. - - * Configure, common.h, config.h.SH: Comment out the sprintf - declaration and tests to determine its return value type. It - conflicts with ANSI C systems' prototypes in stdio.h and the - return value of sprintf is never used anyway -- it's always cast - to void. - -Thu Jun 27 13:05:32 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u4. - -Thu Feb 21 15:18:14 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * pch.c (another_hunk): Fix off by 1 error. From - iverson@xstor.com (Tim Iverson). - -Sun Jan 20 20:18:58 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * Makefile.SH (all): Don't make a dummy `all' file. - - * patchlevel.h: PATCHLEVEL 12u3. - - * patch.c (nextarg): New function. - (get_some_switches): Use it, to prevent dereferencing a null - pointer if an option that takes an arg is not given one (is last - on the command line). From Paul Eggert. - - * pch.c (another_hunk): Fix from Wayne Davison to recognize - single-line hunks in unified diffs (with a single line number - instead of a range). - - * inp.c (rev_in_string): Don't use `s' before defining it. From - Wayne Davison. - -Mon Jan 7 06:25:11 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u2. - - * pch.c (intuit_diff_type): Recognize `+++' in diff headers, for - unified diff format. From unidiff patch 1. - -Mon Dec 3 00:14:25 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * patch.c (get_some_switches): Make the usage message more - informative. - -Sun Dec 2 23:20:18 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * Configure: When checking for C preprocessor, look for 'abc.*xyz' - instead of 'abc.xyz', so ANSI C preprocessors work. - - * Apply fix for -D from ksb@mentor.cc.purdue.edu (Kevin Braunsdorf). - -1990-05-01 Wayne Davison - * patch.c, pch.c: unidiff support added - -Wed Mar 7 23:47:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * pch.c: Call malformed instead of goto malformed - (just allows easier debugging). - -Tue Jan 23 21:27:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * common.h (TMP*NAME): Make these char *, not char []. - patch.c (main): Use TMPDIR (if present) to set TMP*NAME. - common.h: Declare getenv. - -Sun Dec 17 17:29:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) - - * patch.c (reverse_flag_specified): New variable. - (get_some_switches, reinitialize_almost_everything): Use it. - -1988-06-22 Larry Wall - patch12: - * common.h: sprintf was declared wrong - * patch.c: rindex() wasn't declared - * patch.man: now avoids Bell System Logo - -1988-06-03 Larry Wall - patch10: - * common.h: support for shorter extensions. - * inp.c: made a little smarter about sccs files - * patch.c: exit code improved. - better support for non-flexfilenames. - * patch.man: -B switch was contributed. - * pch.c: Can now find patches in shar scripts. - Hunks that swapped and then swapped back could core dump. - -1987-06-04 Larry Wall - * pch.c: pch_swap didn't swap p_bfake and p_efake. - -1987-02-16 Larry Wall - * patch.c: Short replacement caused spurious "Out of sync" message. - -1987-01-30 Larry Wall - * patch.c: Improved diagnostic on sync error. - Moved do_ed_script() to pch.c. - * pch.c: Improved responses to mangled patches. - * pch.h: Added do_ed_script(). - -1987-01-05 Larry Wall - * pch.c: New-style context diffs caused double call to free(). - -1986-11-21 Larry Wall - * patch.c: Fuzz factor caused offset of installed lines. - -1986-11-14 Larry Wall - * pch.c: Fixed problem where a long pattern wouldn't grow the hunk. - Also restored p_input_line when backtracking so error messages are - right. - -1986-11-03 Larry Wall - * pch.c: New-style delete triggers spurious assertion error. - -1986-10-29 Larry Wall - * patch.c: Backwards search could terminate prematurely. - * pch.c: Could falsely report new-style context diff. - -1986-09-17 Larry Wall - * common.h, inp.c, inp.h, patch.c, patch.man, pch.c, pch.h, - util.h, version.c, version.h: Baseline for netwide release. - -1986-08-01 Larry Wall - * patch.c: Fixes for machines that can't vararg. - Added fuzz factor. Generalized -p. General cleanup. - Changed some %d's to %ld's. Linted. - * patch.man: Documented -v, -p, -F. - Added notes to patch senders. - -1985-08-15 van%ucbmonet@berkeley - Changes for 4.3bsd diff -c. - -1985-03-26 Larry Wall - * patch.c: Frozen. - * patch.man: Frozen. - -1985-03-12 Larry Wall - * patch.c: Now checks for normalness of file to patch. - Check i_ptr and i_womp to make sure they aren't null before freeing. - Also allow ed output to be suppressed. - Changed pfp->_file to fileno(pfp). - Added -p option from jromine@uci-750a. - Added -D (#ifdef) option from joe@fluke. - * patch.man: Documented -p, -D. - -1984-12-06 Larry Wall - * patch.c: Made smarter about SCCS subdirectories. - -1984-12-05 Larry Wall - * patch.c: Added -l switch to do loose string comparison. - * patch.man: Added -l switch, and noted bistability bug. - -1984-12-04 Larry Wall - Branch for sdcrdcf changes. - * patch.c: Failed hunk count not reset on multiple patch file. - * patch.man: Baseline version. - -1984-11-29 Larry Wall - * patch.c: Linted. Identifiers uniquified. Fixed i_ptr malloc() bug. - Fixed multiple calls to mktemp(). Will now work on machines that can - only read 32767 chars. Added -R option for diffs with new and old - swapped. Various cosmetic changes. - -1984-11-09 Larry Wall - * patch.c: Initial revision - -Local Variables: -mode: indented-text -left-margin: 8 -version-control: never -end: Property changes on: vendor/misc-GNU/patch/2.4/ChangeLog ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/partime.c =================================================================== --- vendor/misc-GNU/patch/2.4/partime.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/partime.c (nonexistent) @@ -1,742 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#if STDC_HEADERS -# define CTYPE_DOMAIN(c) 1 -#else -# define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#define ISALNUM(c) (CTYPE_DOMAIN (c) && isalnum (c)) -#define ISALPHA(c) (CTYPE_DOMAIN (c) && isalpha (c)) -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c)) -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#include - -char const partimeId[] = - "$Id: partime.c,v 5.16 1997/05/19 06:33:53 eggert Exp $"; - - -/* Lookup tables for names of months, weekdays, time zones. */ - -#define NAME_LENGTH_MAXIMUM 4 - -struct name_val - { - char name[NAME_LENGTH_MAXIMUM]; - int val; - }; - - -static char const *parse_decimal P ((char const *, int, int, int, int, int *, int *)); -static char const *parse_fixed P ((char const *, int, int *)); -static char const *parse_pattern_letter P ((char const *, int, struct partime *)); -static char const *parse_prefix P ((char const *, struct partime *, int *)); -static char const *parse_ranged P ((char const *, int, int, int, int *)); -static int lookup P ((char const *, struct name_val const[])); -static int merge_partime P ((struct partime *, struct partime const *)); -static void undefine P ((struct partime *)); - - -static struct name_val const month_names[] = -{ - {"jan", 0}, - {"feb", 1}, - {"mar", 2}, - {"apr", 3}, - {"may", 4}, - {"jun", 5}, - {"jul", 6}, - {"aug", 7}, - {"sep", 8}, - {"oct", 9}, - {"nov", 10}, - {"dec", 11}, - {"", TM_UNDEFINED} -}; - -static struct name_val const weekday_names[] = -{ - {"sun", 0}, - {"mon", 1}, - {"tue", 2}, - {"wed", 3}, - {"thu", 4}, - {"fri", 5}, - {"sat", 6}, - {"", TM_UNDEFINED} -}; - -#define hr60nonnegative(t) ((t)/100 * 60 + (t)%100) -#define hr60(t) ((t)<0 ? -hr60nonnegative(-(t)) : hr60nonnegative(t)) -#define zs(t,s) {s, hr60(t)} -#define zd(t,s,d) zs(t, s), zs((t)+100, d) - -static struct name_val const zone_names[] = -{ - zs (-1000, "hst"), /* Hawaii */ - zd (-1000, "hast", "hadt"), /* Hawaii-Aleutian */ - zd (- 900, "akst", "akdt"), /* Alaska */ - zd (- 800, "pst" , "pdt" ), /* Pacific */ - zd (- 700, "mst" , "mdt" ), /* Mountain */ - zd (- 600, "cst" , "cdt" ), /* Central */ - zd (- 500, "est" , "edt" ), /* Eastern */ - zd (- 400, "ast" , "adt" ), /* Atlantic */ - zd (- 330, "nst" , "ndt" ), /* Newfoundland */ - zs ( 000, "utc" ), /* Coordinated Universal */ - zs ( 000, "uct" ), /* " */ - zs ( 000, "cut" ), /* " */ - zs ( 000, "ut"), /* Universal */ - zs ( 000, "z"), /* Zulu (required by ISO 8601) */ - zd ( 000, "gmt" , "bst" ), /* Greenwich Mean, British Summer */ - zd ( 000, "wet" , "west"), /* Western European */ - zd ( 100, "cet" , "cest"), /* Central European */ - zd ( 100, "met" , "mest"), /* Middle European (bug in old tz versions) */ - zd ( 100, "mez" , "mesz"), /* Mittel-Europaeische Zeit */ - zd ( 200, "eet" , "eest"), /* Eastern European */ - zs ( 530, "ist" ), /* India */ - zd ( 900, "jst" , "jdt" ), /* Japan */ - zd ( 900, "kst" , "kdt" ), /* Korea */ - zd ( 1200, "nzst", "nzdt"), /* New Zealand */ - {"lt", 1}, -#if 0 - /* The following names are duplicates or are not well attested. - There are lots more where these came from. */ - zs (-1100, "sst" ), /* Samoan */ - zd (- 900, "yst" , "ydt" ), /* Yukon - name is no longer used */ - zd (- 500, "ast" , "adt" ), /* Acre */ - zd (- 400, "wst" , "wdt" ), /* Western Brazil */ - zd (- 400, "cst" , "cdt" ), /* Chile */ - zd (- 200, "fst" , "fdt" ), /* Fernando de Noronha */ - zs ( 000, "wat" ), /* West African */ - zs ( 100, "cat" ), /* Central African */ - zs ( 200, "sat" ), /* South African */ - zd ( 200, "ist" , "idt" ), /* Israel */ - zs ( 300, "eat" ), /* East African */ - zd ( 300, "msk" , "msd" ), /* Moscow */ - zd ( 330, "ist" , "idt" ), /* Iran */ - zs ( 800, "hkt" ), /* Hong Kong */ - zs ( 800, "sgt" ), /* Singapore */ - zd ( 800, "cst" , "cdt" ), /* China */ - zd ( 800, "wst" , "wst" ), /* Western Australia */ - zd ( 930, "cst" , "cst" ), /* Central Australia */ - zs ( 1000, "gst" ), /* Guam */ - zd ( 1000, "est" , "est" ), /* Eastern Australia */ -#endif - {"", -1} -}; - -/* Look for a prefix of S in TABLE, returning val for first matching entry. */ -static int -lookup (s, table) - char const *s; - struct name_val const table[]; -{ - int j; - char buf[NAME_LENGTH_MAXIMUM]; - - for (j = 0; j < NAME_LENGTH_MAXIMUM; j++) - { - unsigned char c = *s++; - if (! ISALPHA (c)) - { - buf[j] = '\0'; - break; - } - buf[j] = ISUPPER (c) ? tolower (c) : c; - } - - for (;; table++) - for (j = 0; ; j++) - if (j == NAME_LENGTH_MAXIMUM || ! table[0].name[j]) - return table[0].val; - else if (buf[j] != table[0].name[j]) - break; -} - - -/* Set *T to ``undefined'' values. */ -static void -undefine (t) - struct partime *t; -{ - t->tm.tm_sec = t->tm.tm_min = t->tm.tm_hour = t->tm.tm_mday = t->tm.tm_mon - = t->tm.tm_year = t->tm.tm_wday = t->tm.tm_yday - = t->ymodulus = t->yweek - = TM_UNDEFINED; - t->zone = TM_UNDEFINED_ZONE; -} - -/* Array of patterns to look for in a date string. - Order is important: we look for the first matching pattern - whose values do not contradict values that we already know about. - See `parse_pattern_letter' below for the meaning of the pattern codes. */ -static char const *const patterns[] = -{ - /* These traditional patterns must come first, - to prevent an ISO 8601 format from misinterpreting their prefixes. */ - "E_n_y", "x", /* RFC 822 */ - "E_n", "n_E", "n", "t:m:s_A", "t:m_A", "t_A", /* traditional */ - "y/N/D$", /* traditional RCS */ - - /* ISO 8601:1988 formats, generalized a bit. */ - "y-N-D$", "4ND$", "Y-N$", - "RND$", "-R=N$", "-R$", "--N=D$", "N=DT", - "--N$", "---D$", "DT", - "Y-d$", "4d$", "R=d$", "-d$", "dT", - "y-W-X", "yWX", "y=W", - "-r-W-X", "r-W-XT", "-rWX", "rWXT", "-W=X", "W=XT", "-W", - "-w-X", "w-XT", "---X$", "XT", "4$", - "T", - "h:m:s$", "hms$", "h:m$", "hm$", "h$", "-m:s$", "-ms$", "-m$", "--s$", - "Y", "Z", - - 0 -}; - -/* Parse an initial prefix of STR, setting *T accordingly. - Return the first character after the prefix, or 0 if it couldn't be parsed. - Start with pattern *PI; if success, set *PI to the next pattern to try. - Set *PI to -1 if we know there are no more patterns to try; - if *PI is initially negative, give up immediately. */ -static char const * -parse_prefix (str, t, pi) - char const *str; - struct partime *t; - int *pi; -{ - int i = *pi; - char const *pat; - unsigned char c; - - if (i < 0) - return 0; - - /* Remove initial noise. */ - while (! ISALNUM (c = *str) && c != '-' && c != '+') - { - if (! c) - { - undefine (t); - *pi = -1; - return str; - } - str++; - } - - /* Try a pattern until one succeeds. */ - while ((pat = patterns[i++]) != 0) - { - char const *s = str; - undefine (t); - do - { - if (! (c = *pat++)) - { - *pi = i; - return s; - } - } - while ((s = parse_pattern_letter (s, c, t)) != 0); - } - - return 0; -} - -/* Parse an initial prefix of S of length DIGITS; it must be a number. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_fixed (s, digits, res) - char const *s; - int digits, *res; -{ - int n = 0; - char const *lim = s + digits; - while (s < lim) - { - unsigned d = *s++ - '0'; - if (9 < d) - return 0; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_ranged (s, digits, lo, hi, res) - char const *s; - int digits, lo, hi, *res; -{ - s = parse_fixed (s, digits, res); - return s && lo <= *res && *res <= hi ? s : 0; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI - and it may be followed by a fraction to be computed using RESOLUTION. - Store the parsed number into *RES; store the fraction times RESOLUTION, - rounded to the nearest integer, into *FRES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_decimal (s, digits, lo, hi, resolution, res, fres) - char const *s; - int digits, lo, hi, resolution, *res, *fres; -{ - s = parse_fixed (s, digits, res); - if (s && lo <= *res && *res <= hi) - { - int f = 0; - if ((s[0] == ',' || s[0] == '.') && ISDIGIT (s[1])) - { - char const *s1 = ++s; - int num10 = 0, denom10 = 10, product; - while (ISDIGIT (*++s)) - { - int d = denom10 * 10; - if (d / 10 != denom10) - return 0; /* overflow */ - denom10 = d; - } - s = parse_fixed (s1, (int) (s - s1), &num10); - product = num10 * resolution; - f = (product + (denom10 >> 1)) / denom10; - f -= f & (product % denom10 == denom10 >> 1); /* round to even */ - if (f < 0 || product/resolution != num10) - return 0; /* overflow */ - } - *fres = f; - return s; - } - return 0; -} - -/* Parse an initial prefix of S; it must denote a time zone. - Set *ZONE to the number of seconds east of GMT, - or to TM_LOCAL_ZONE if it is the local time zone. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -char * -parzone (s, zone) - char const *s; - long *zone; -{ - char sign; - int hh, mm, ss; - int minutesEastOfUTC; - long offset, z; - - /* The formats are LT, n, n DST, nDST, no, o - where n is a time zone name - and o is a time zone offset of the form [-+]hh[:mm[:ss]]. */ - switch (*s) - { - case '-': - case '+': - z = 0; - break; - - default: - minutesEastOfUTC = lookup (s, zone_names); - if (minutesEastOfUTC == -1) - return 0; - - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - - /* Don't modify LT. */ - if (minutesEastOfUTC == 1) - { - *zone = TM_LOCAL_ZONE; - return (char *) s; - } - - z = minutesEastOfUTC * 60L; - - /* Look for trailing " DST". */ - if ((s[-1] == 'T' || s[-1] == 't') - && (s[-2] == 'S' || s[-2] == 's') - && (s[-3] == 'D' || s[-3] == 'd')) - goto trailing_dst; - while (ISSPACE ((unsigned char) *s)) - s++; - if ((s[0] == 'D' || s[0] == 'd') - && (s[1] == 'S' || s[1] == 's') - && (s[2] == 'T' || s[2] == 't')) - { - s += 3; - trailing_dst: - *zone = z + 60*60; - return (char *) s; - } - - switch (*s) - { - case '-': - case '+': - break; - - default: - *zone = z; - return (char *) s; - } - - break; - } - - sign = *s++; - - if (! (s = parse_ranged (s, 2, 0, 23, &hh))) - return 0; - mm = ss = 0; - if (*s == ':') - s++; - if (ISDIGIT (*s)) - { - if (! (s = parse_ranged (s, 2, 0, 59, &mm))) - return 0; - if (*s == ':' && s[-3] == ':' && ISDIGIT (s[1]) - && ! (s = parse_ranged (s + 1, 2, 0, 59, &ss))) - return 0; - } - if (ISDIGIT (*s)) - return 0; - offset = (hh * 60 + mm) * 60L + ss; - *zone = z + (sign == '-' ? -offset : offset); - /* ?? Are fractions allowed here? If so, they're not implemented. */ - return (char *) s; -} - -/* Parse an initial prefix of S, matching the pattern whose code is C. - Set *T accordingly. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_pattern_letter (s, c, t) - char const *s; - int c; - struct partime *t; -{ - switch (c) - { - case '$': /* The next character must be a non-digit. */ - if (ISDIGIT (*s)) - return 0; - break; - - case '-': - case '/': - case ':': - /* These characters stand for themselves. */ - if (*s++ != c) - return 0; - break; - - case '4': /* 4-digit year */ - s = parse_fixed (s, 4, &t->tm.tm_year); - break; - - case '=': /* optional '-' */ - s += *s == '-'; - break; - - case 'A': /* AM or PM */ - /* This matches the regular expression [AaPp][Mm]?. - It must not be followed by a letter or digit; - otherwise it would match prefixes of strings like "PST". */ - switch (*s++) - { - case 'A': - case 'a': - if (t->tm.tm_hour == 12) - t->tm.tm_hour = 0; - break; - - case 'P': - case 'p': - if (t->tm.tm_hour != 12) - t->tm.tm_hour += 12; - break; - - default: - return 0; - } - switch (*s) - { - case 'M': - case 'm': - s++; - break; - } - if (ISALNUM ((unsigned char) *s)) - return 0; - break; - - case 'D': /* day of month [01-31] */ - s = parse_ranged (s, 2, 1, 31, &t->tm.tm_mday); - break; - - case 'd': /* day of year [001-366] */ - s = parse_ranged (s, 3, 1, 366, &t->tm.tm_yday); - t->tm.tm_yday--; - break; - - case 'E': /* extended day of month [1-9, 01-31] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 31, - &t->tm.tm_mday); - break; - - case 'h': /* hour [00-23 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 23, 60 * 60, &t->tm.tm_hour, &frac); - t->tm.tm_min = frac / 60; - t->tm.tm_sec = frac % 60; - } - break; - - case 'm': /* minute [00-59 followed by optional fraction] */ - s = parse_decimal (s, 2, 0, 59, 60, &t->tm.tm_min, &t->tm.tm_sec); - break; - - case 'n': /* month name [e.g. "Jan"] */ - if (! TM_DEFINED (t->tm.tm_mon = lookup (s, month_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'N': /* month [01-12] */ - s = parse_ranged (s, 2, 1, 12, &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'r': /* year % 10 (remainder in origin-0 decade) [0-9] */ - s = parse_fixed (s, 1, &t->tm.tm_year); - t->ymodulus = 10; - break; - - case_R: - case 'R': /* year % 100 (remainder in origin-0 century) [00-99] */ - s = parse_fixed (s, 2, &t->tm.tm_year); - t->ymodulus = 100; - break; - - case 's': /* second [00-60 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 60, 1, &t->tm.tm_sec, &frac); - t->tm.tm_sec += frac; - } - break; - - case 'T': /* 'T' or 't' */ - switch (*s++) - { - case 'T': - case 't': - break; - default: - return 0; - } - break; - - case 't': /* traditional hour [1-9 or 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_hour); - break; - - case 'w': /* 'W' or 'w' only (stands for current week) */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - break; - - case 'W': /* 'W' or 'w', followed by a week of year [00-53] */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - s = parse_ranged (s, 2, 0, 53, &t->yweek); - break; - - case 'X': /* weekday (1=Mon ... 7=Sun) [1-7] */ - s = parse_ranged (s, 1, 1, 7, &t->tm.tm_wday); - t->tm.tm_wday--; - break; - - case 'x': /* weekday name [e.g. "Sun"] */ - if (! TM_DEFINED (t->tm.tm_wday = lookup (s, weekday_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'y': /* either R or Y */ - if (ISDIGIT (s[0]) && ISDIGIT (s[1]) && ! ISDIGIT (s[2])) - goto case_R; - /* fall into */ - case 'Y': /* year in full [4 or more digits] */ - { - int len = 0; - while (ISDIGIT (s[len])) - len++; - if (len < 4) - return 0; - s = parse_fixed (s, len, &t->tm.tm_year); - } - break; - - case 'Z': /* time zone */ - s = parzone (s, &t->zone); - break; - - case '_': /* possibly empty sequence of non-alphanumerics */ - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - break; - - default: /* bad pattern */ - return 0; - } - - return s; -} - -/* If there is no conflict, merge into *T the additional information in *U - and return 0. Otherwise do nothing and return -1. */ -static int -merge_partime (t, u) - struct partime *t; - struct partime const *u; -{ -# define conflict(a,b) ((a) != (b) && TM_DEFINED (a) && TM_DEFINED (b)) - if (conflict (t->tm.tm_sec, u->tm.tm_sec) - || conflict (t->tm.tm_min, u->tm.tm_min) - || conflict (t->tm.tm_hour, u->tm.tm_hour) - || conflict (t->tm.tm_mday, u->tm.tm_mday) - || conflict (t->tm.tm_mon, u->tm.tm_mon) - || conflict (t->tm.tm_year, u->tm.tm_year) - || conflict (t->tm.tm_wday, u->tm.tm_yday) - || conflict (t->ymodulus, u->ymodulus) - || conflict (t->yweek, u->yweek) - || (t->zone != u->zone - && t->zone != TM_UNDEFINED_ZONE - && u->zone != TM_UNDEFINED_ZONE)) - return -1; -# undef conflict -# define merge_(a,b) if (TM_DEFINED (b)) (a) = (b); - merge_ (t->tm.tm_sec, u->tm.tm_sec) - merge_ (t->tm.tm_min, u->tm.tm_min) - merge_ (t->tm.tm_hour, u->tm.tm_hour) - merge_ (t->tm.tm_mday, u->tm.tm_mday) - merge_ (t->tm.tm_mon, u->tm.tm_mon) - merge_ (t->tm.tm_year, u->tm.tm_year) - merge_ (t->tm.tm_wday, u->tm.tm_yday) - merge_ (t->ymodulus, u->ymodulus) - merge_ (t->yweek, u->yweek) -# undef merge_ - if (u->zone != TM_UNDEFINED_ZONE) - t->zone = u->zone; - return 0; -} - -/* Parse a date/time prefix of S, putting the parsed result into *T. - Return the first character after the prefix. - The prefix may contain no useful information; - in that case, *T will contain only undefined values. */ -char * -partime (s, t) - char const *s; - struct partime *t; -{ - struct partime p; - - undefine (t); - - while (*s) - { - int i = 0; - char const *s1; - - do - { - if (! (s1 = parse_prefix (s, &p, &i))) - return (char *) s; - } - while (merge_partime (t, &p) != 0); - - s = s1; - } - - return (char *) s; -} Property changes on: vendor/misc-GNU/patch/2.4/partime.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/getopt.h =================================================================== --- vendor/misc-GNU/patch/2.4/getopt.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/getopt.h (nonexistent) @@ -1,133 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ Property changes on: vendor/misc-GNU/patch/2.4/getopt.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/getopt.c =================================================================== --- vendor/misc-GNU/patch/2.4/getopt.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/getopt.c (nonexistent) @@ -1,1053 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#include -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -extern pid_t __libc_pid; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -text_set_element (__libc_subinit, store_args_and_env); - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); - memset (&new_str[nonoption_flags_max_len], '\0', - top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - { - memcpy (__getopt_nonoption_flags, orig_str, len); - memset (&__getopt_nonoption_flags[len], '\0', - nonoption_flags_max_len - len); - } - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.4/getopt.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/COPYING =================================================================== --- vendor/misc-GNU/patch/2.4/COPYING (revision 358868) +++ vendor/misc-GNU/patch/2.4/COPYING (nonexistent) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Property changes on: vendor/misc-GNU/patch/2.4/COPYING ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/inp.h =================================================================== --- vendor/misc-GNU/patch/2.4/inp.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/inp.h (nonexistent) @@ -1,10 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.h,v 1.4 1997/04/07 01:07:00 eggert Exp $ */ - -XTERN LINENUM input_lines; /* how long is input file in lines */ - -char const *ifetch PARAMS ((LINENUM, int, size_t *)); -void get_input_file PARAMS ((char const *, char const *)); -void re_input PARAMS ((void)); -void scan_input PARAMS ((char *)); Property changes on: vendor/misc-GNU/patch/2.4/inp.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/getopt1.c =================================================================== --- vendor/misc-GNU/patch/2.4/getopt1.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/getopt1.c (nonexistent) @@ -1,189 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "getopt.h" - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.4/getopt1.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/partime.h =================================================================== --- vendor/misc-GNU/patch/2.4/partime.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/partime.h (nonexistent) @@ -1,67 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#define TM_UNDEFINED (-1) -#define TM_DEFINED(x) (0 <= (x)) - -/* #include if you want to use these symbols. */ -#define TM_LOCAL_ZONE LONG_MIN -#define TM_UNDEFINED_ZONE (LONG_MIN + 1) - -struct partime - { - /* This structure describes the parsed time. - Only the following tm_* values in it are used: - sec, min, hour, mday, mon, year, wday, yday. - If TM_UNDEFINED (value), the parser never found the value. - The tm_year field is the actual year, not the year - 1900; - but see ymodulus below. */ - struct tm tm; - - /* If !TM_UNDEFINED (ymodulus), - then tm.tm_year is actually modulo ymodulus. */ - int ymodulus; - - /* Week of year, ISO 8601 style. - If TM_UNDEFINED (yweek), the parser never found yweek. - Weeks start on Mondays. - Week 1 includes Jan 4. */ - int yweek; - - /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */ - long zone; - }; - -#if defined __STDC__ || has_prototypes -# define __PARTIME_P(x) x -#else -# define __PARTIME_P(x) () -#endif - -char *partime __PARTIME_P ((char const *, struct partime *)); -char *parzone __PARTIME_P ((char const *, long *)); Property changes on: vendor/misc-GNU/patch/2.4/partime.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/rename.c =================================================================== --- vendor/misc-GNU/patch/2.4/rename.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/rename.c (nonexistent) @@ -1,112 +0,0 @@ -/* BSD compatible rename and directory rename function for System V. - Copyright (C) 1988, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#ifndef errno -extern int errno; -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -/* Rename file FROM to file TO. - Return 0 if successful, -1 if not. */ - -int -rename (from, to) - char *from; - char *to; -{ - struct stat from_stats, to_stats; - int pid, status; - - if (stat (from, &from_stats)) - return -1; - - /* Be careful not to unlink `from' if it happens to be equal to `to' or - (on filesystems that silently truncate filenames after 14 characters) - if `from' and `to' share the significant characters. */ - if (stat (to, &to_stats)) - { - if (errno != ENOENT) - return -1; - } - else - { - if ((from_stats.st_dev == to_stats.st_dev) - && (from_stats.st_ino == to_stats.st_ino)) - /* `from' and `to' designate the same file on that filesystem. */ - return 0; - - if (unlink (to) && errno != ENOENT) - return -1; - } - -#ifdef MVDIR - -/* If MVDIR is defined, it should be the full filename of a setuid root - program able to link and unlink directories. If MVDIR is not defined, - then the capability of renaming directories may be missing. */ - - if (S_ISDIR (from_stats.st_mode)) - { - /* Need a setuid root process to link and unlink directories. */ - pid = fork (); - switch (pid) - { - case -1: /* Error. */ - error (1, errno, "cannot fork"); - - case 0: /* Child. */ - execl (MVDIR, "mvdir", from, to, (char *) 0); - error (255, errno, "cannot run `%s'", MVDIR); - - default: /* Parent. */ - while (wait (&status) != pid) - /* Do nothing. */ ; - - errno = 0; /* mvdir printed the system error message. */ - if (status) - return -1; - } - } - else - -#endif /* MVDIR */ - - { - if (link (from, to)) - return -1; - if (unlink (from) && errno != ENOENT) - { - unlink (to); - return -1; - } - } - return 0; -} Property changes on: vendor/misc-GNU/patch/2.4/rename.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/patch.1 =================================================================== --- vendor/misc-GNU/patch/2.4/patch.1 (revision 358868) +++ vendor/misc-GNU/patch/2.4/patch.1 (nonexistent) @@ -1,1063 +0,0 @@ -.\" patch man page -.de Id -.ds Dt \\$4 -.. -.Id $Id: patch.man,v 1.20 1997/06/17 22:32:49 eggert Exp $ -.ds = \-\^\- -.de Sp -.if t .sp .3 -.if n .sp -.. -.TH PATCH 1 \*(Dt GNU -.ta 3n -.SH NAME -patch \- apply a diff file to an original -.SH SYNOPSIS -.B patch -.RI [ options ] -.RI [ originalfile -.RI [ patchfile ]] -.Sp -but usually just -.Sp -.BI "patch \-p" "num" -.BI < patchfile -.SH DESCRIPTION -.B patch -takes a patch file -.I patchfile -containing a difference listing produced by the -.B diff -program and applies those differences to one or more original files, -producing patched versions. -Normally the patched versions are put in place of the originals. -Backups can be made; see the -.B \-V -or -.B \*=version\-control -option. -The names of the files to be patched are usually taken from the patch file, -but if there's just one file to be patched it can specified on the -command line as -.IR originalfile . -.PP -Upon startup, patch attempts to determine the type of the diff listing, -unless overruled by a -\fB\-c\fP (\fB\*=context\fP), -\fB\-e\fP (\fB\*=ed\fP), -\fB\-n\fP (\fB\*=normal\fP), -or -\fB\-u\fP (\fB\*=unified\fP) -option. -Context diffs (old-style, new-style, and unified) and -normal diffs are applied by the -.B patch -program itself, while -.B ed -diffs are simply fed to the -.BR ed (1) -editor via a pipe. -.PP -.B patch -tries to skip any leading garbage, apply the diff, -and then skip any trailing garbage. -Thus you could feed an article or message containing a -diff listing to -.BR patch , -and it should work. -If the entire diff is indented by a consistent amount, -this is taken into account. -.PP -With context diffs, and to a lesser extent with normal diffs, -.B patch -can detect when the line numbers mentioned in the patch are incorrect, -and attempts to find the correct place to apply each hunk of the patch. -As a first guess, it takes the line number mentioned for the hunk, plus or -minus any offset used in applying the previous hunk. -If that is not the correct place, -.B patch -scans both forwards and backwards for a set of lines matching the context -given in the hunk. -First -.B patch -looks for a place where all lines of the context match. -If no such place is found, and it's a context diff, and the maximum fuzz factor -is set to 1 or more, then another scan takes place ignoring the first and last -line of context. -If that fails, and the maximum fuzz factor is set to 2 or more, -the first two and last two lines of context are ignored, -and another scan is made. -(The default maximum fuzz factor is 2.) -If -.B patch -cannot find a place to install that hunk of the patch, it puts the -hunk out to a reject file, which normally is the name of the output file -plus a -.B \&.rej -suffix, or -.B # -if -.B \&.rej -would generate a file name that is too long -(if even appending the single character -.B # -makes the file name too long, then -.B # -replaces the file name's last character). -(The rejected hunk comes out in ordinary context diff form regardless of -the input patch's form. -If the input was a normal diff, many of the contexts are simply null.) -The line numbers on the hunks in the reject file may be different than -in the patch file: they reflect the approximate location patch thinks the -failed hunks belong in the new file rather than the old one. -.PP -As each hunk is completed, you are told if the hunk -failed, and if so which line (in the new file) -.B patch -thought the hunk should go on. -If the hunk is installed at a different line -from the line number specified in the diff you -are told the offset. -A single large offset -.I may -indicate that a hunk was installed in the -wrong place. -You are also told if a fuzz factor was used to make the match, in which -case you should also be slightly suspicious. -If the -.B \*=verbose -option is given, you are also told about hunks that match exactly. -.PP -If no original file -.I origfile -is specified on the command line, -.B patch -tries to figure out from the leading garbage what the name of the file -to edit is, using the following rules. -.TP 3 -.B " \(bu" -If the header is that of a context diff, -.B patch -takes the old and new file names in the header. -Any -.B /dev/null -names are ignored. -.TP -.B " \(bu" -If there is an -.B Index:\& -line in the leading garbage -and if either the old and new names are both absent or the -.B POSIXLY_CORRECT -environment variable is set, -.B patch -takes the name in the -.B Index:\& -line. -.TP -.B " \(bu" -For the purpose of the following rules, -the names are considered to be in the order (old, new, index), -regardless of the order that they appear in the header. -.TP -.B " \(bu" -If some of the named files exist, -.B patch -uses the first name if the -.B POSIXLY_CORRECT -environment variable is set, and the best name otherwise. -.TP -.B " \(bu" -If -.B patch -is not ignoring \s-1RCS\s0 and \s-1SCCS\s0 (see the -.BI "\-g " num -or -.BI \*=get= num -option), and no named files exist -but an \s-1RCS\s0 or \s-1SCCS\s0 master is found, -.B patch -uses the first named file with an \s-1RCS\s0 or \s-1SCCS\s0 master. -.TP -.B " \(bu" -If no named files exist, no \s-1RCS\s0 or \s-1SCCS\s0 master was found, -some names are given, -.B POSIXLY_CORRECT -is not set, and the patch appears to create a file, -.B patch -uses the best name requiring the creation of the fewest directories. -.TP -.B " \(bu" -If no file name results from the above heuristics, you are asked -for the name of the file to patch. -.LP -To determine the -.I best -of a nonempty list of file names, -.B patch -first takes all the names with the fewest path name components; -of those, it then takes all the names with the shortest basename; -of those, it then takes all the shortest names; -finally, it takes the first remaining name. -.PP -Additionally, if the leading garbage contains a -.B Prereq:\& -line, -.B patch -takes the first word from the prerequisites line (normally a version -number) and checks the original file to see if that word can be found. -If not, -.B patch -asks for confirmation before proceeding. -.PP -The upshot of all this is that you should be able to say, while in a news -interface, something like the following: -.Sp - \fB| patch \-d /usr/src/local/blurfl\fP -.Sp -and patch a file in the -.B blurfl -directory directly from the article containing -the patch. -.PP -If the patch file contains more than one patch, -.B patch -tries to apply each of them as if they came from separate patch files. -This means, among other things, that it is assumed that the name of the file -to patch must be determined for each diff listing, -and that the garbage before each diff listing -contains interesting things such as file names and revision level, as -mentioned previously. -.SH OPTIONS -.TP 3 -\fB\-b\fP or \fB\*=backup\fP -Make backup files. -That is, when patching a file, -rename or copy the original instead of removing it. -When backing up a file that does not exist, -an empty, unreadable backup file is created -as a placeholder to represent the nonexistent file. -.Sp -This option is equivalent to -.BR \*=version\-control=simple ; -see the -.B \-V -or -.B \*=version\-control -option. -.TP -.B \*=backup\-if\-mismatch -Back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -The backup file name is calculated as usual, -except that if the version control method is -.BR none , -a simple backup name is used. -This is the default unless the -.B POSIXLY_CORRECT -environment variable is set. -.TP -.B \*=no\-backup\-if\-mismatch -Do not back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default if the -.B POSIXLY_CORRECT -environment variable is set. -.TP -\fB\-B\fP \fIpref\fP or \fB\*=prefix=\fP\fIpref\fP -Prefix simple backup file names with -.IR pref . -For example, with -.B "\-B /junk/" -the simple backup file name for -.B src/patch/util.c -is -.BR /junk/src/patch/util.c . -.TP -\fB\*=binary\fP -Read and write all files in binary mode, -except for standard output and -.BR /dev/tty . -This option has no effect on \s-1POSIX\s0-compliant systems. -On systems like \s-1DOS\s0 where this option makes a difference, -the patch should be generated by -.BR "diff\ \-a\ \*=binary" . -.TP -\fB\-c\fP or \fB\*=context\fP -Interpret the patch file as a ordinary context diff. -.TP -\fB\-d\fP \fIdir\fP or \fB\*=directory=\fP\fIdir\fP -Change to the directory -.I dir -immediately, before doing -anything else. -.TP -\fB\-D\fP \fIdefine\fP or \fB\*=ifdef=\fP\fIdefine\fP -Use the -.BR #ifdef " .\|.\|. " #endif -construct to mark changes, with -.I define -as the differentiating symbol. -.TP -.B "\*=dry\-run" -Print the results of applying the patches without actually changing any files. -.TP -\fB\-e\fP or \fB\*=ed\fP -Interpret the patch file as an -.B ed -script. -.TP -\fB\-E\fP or \fB\*=remove\-empty\-files\fP -Remove output files that are empty after the patches have been applied. -Normally this option is unnecessary, since -.B patch -can examine the time stamps on the header to determine whether a file -should exist after patching. -However, if the input is not a context diff or if the -.B POSIXLY_CORRECT -environment variable is set, -.B patch -does not remove empty patched files unless this option is given. -When -.B patch -removes a file, it also attempts to remove any empty ancestor directories. -.TP -\fB\-f\fP or \fB\*=force\fP -Assume that the user knows exactly what he or she is doing, and do not -ask any questions. Skip patches whose headers -do not say which file is to be patched; patch files even though they have the -wrong version for the -.B Prereq:\& -line in the patch; and assume that -patches are not reversed even if they look like they are. -This option does not suppress commentary; use -.B \-s -for that. -.TP -\fB\-F\fP \fInum\fP or \fB\*=fuzz=\fP\fInum\fP -Set the maximum fuzz factor. -This option only applies to diffs that have context, and causes -.B patch -to ignore up to that many lines in looking for places to install a hunk. -Note that a larger fuzz factor increases the odds of a faulty patch. -The default fuzz factor is 2, and it may not be set to more than -the number of lines of context in the context diff, ordinarily 3. -.TP -\fB\-g\fP \fInum\fP or \fB\*=get=\fP\fInum\fP -This option controls -.BR patch 's -actions when a file is under \s-1RCS\s0 or \s-1SCCS\s0 control, -and does not exist or is read-only and matches the default version. -If -.I num -is positive, -.B patch -gets (or checks out) the file from the revision control system; if zero, -.B patch -ignores \s-1RCS\s0 and \s-1SCCS\s0 and does not get the file; and if negative, -.B patch -asks the user whether to get the file. -The default value of this option is given by the value of the -.B PATCH_GET -environment variable if it is set; if not, the default value is zero if -.B POSIXLY_CORRECT -is set, negative otherwise. -.TP -.B "\*=help" -Print a summary of options and exit. -.TP -\fB\-i\fP \fIpatchfile\fP or \fB\*=input=\fP\fIpatchfile\fP -Read the patch from -.IR patchfile . -If -.I patchfile -is -.BR \- , -read from standard input, the default. -.TP -\fB\-l\fP or \fB\*=ignore\-whitespace\fP -Match patterns loosely, in case tabs or spaces -have been munged in your files. -Any sequence of one or more blanks in the patch file matches any sequence -in the original file, and sequences of blanks at the ends of lines are ignored. -Normal characters must still match exactly. -Each line of the context must still match a line in the original file. -.TP -\fB\-n\fP or \fB\*=normal\fP -Interpret the patch file as a normal diff. -.TP -\fB\-N\fP or \fB\*=forward\fP -Ignore patches that seem to be reversed or already applied. -See also -.BR \-R . -.TP -\fB\-o\fP \fIoutfile\fP or \fB\*=output=\fP\fIoutfile\fP -Send output to -.I outfile -instead of patching files in place. -.TP -\fB\-p\fP\fInum\fP or \fB\*=strip\fP\fB=\fP\fInum\fP -Strip the smallest prefix containing -.I num -leading slashes from each file name found in the patch file. -A sequence of one or more adjacent slashes is counted as a single slash. -This controls how file names found in the patch file are treated, in case -you keep your files in a different directory than the person who sent -out the patch. -For example, supposing the file name in the patch file was -.Sp - \fB/u/howard/src/blurfl/blurfl.c\fP -.Sp -setting -.B \-p0 -gives the entire file name unmodified, -.B \-p1 -gives -.Sp - \fBu/howard/src/blurfl/blurfl.c\fP -.Sp -without the leading slash, -.B \-p4 -gives -.Sp - \fBblurfl/blurfl.c\fP -.Sp -and not specifying -.B \-p -at all just gives you \fBblurfl.c\fP. -Whatever you end up with is looked for either in the current directory, -or the directory specified by the -.B \-d -option. -.TP -\fB\-r\fP \fIrejectfile\fP or \fB\*=reject\-file=\fP\fIrejectfile\fP -Put rejects into -.I rejectfile -instead of the default -.B \&.rej -file. -.TP -\fB\-R\fP or \fB\*=reverse\fP -Assume that this patch was created with the old and new files swapped. -(Yes, I'm afraid that does happen occasionally, human nature being what it -is.) -.B patch -attempts to swap each hunk around before applying it. -Rejects come out in the swapped format. -The -.B \-R -option does not work with -.B ed -diff scripts because there is too little -information to reconstruct the reverse operation. -.Sp -If the first hunk of a patch fails, -.B patch -reverses the hunk to see if it can be applied that way. -If it can, you are asked if you want to have the -.B \-R -option set. -If it can't, the patch continues to be applied normally. -(Note: this method cannot detect a reversed patch if it is a normal diff -and if the first command is an append (i.e. it should have been a delete) -since appends always succeed, due to the fact that a null context matches -anywhere. -Luckily, most patches add or change lines rather than delete them, so most -reversed normal diffs begin with a delete, which fails, triggering -the heuristic.) -.TP -\fB\-s\fP or \fB\*=silent\fP or \fB\*=quiet\fP -Work silently, unless an error occurs. -.TP -\fB\-t\fP or \fB\*=batch\fP -Suppress questions like -.BR \-f , -but make some different assumptions: -skip patches whose headers do not contain file names (the same as \fB\-f\fP); -skip patches for which the file has the wrong version for the -.B Prereq:\& -line -in the patch; and assume that patches are reversed if they look like -they are. -.TP -\fB\-T\fP or \fB\*=set\-time\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use local time. This option is not recommended, because patches using -local time cannot easily be used by people in other time zones, and -because local time stamps are ambiguous when local clocks move backwards -during daylight-saving time adjustments. Instead of using this option, -generate patches with \s-1UTC\s0 and use the -.B \-Z -or -.B \*=set\-utc -option instead. -.TP -\fB\-u\fP or \fB\*=unified\fP -Interpret the patch file as a unified context diff. -.TP -\fB\-v\fP or \fB\*=version\fP -Print out -.BR patch 's -revision header and patch level, and exit. -.TP -\fB\-V\fP \fImethod\fP or \fB\*=version\-control=\fP\fImethod\fP -Use -.I method -to determine -backup file names. The method can also be given by the -.B PATCH_VERSION_CONTROL -(or, if that's not set, the -.BR VERSION_CONTROL ) -environment variable, which is overridden by this option. -.Sp -The value of -.I method -is like the \s-1GNU\s0 -Emacs `version-control' variable; -.B patch -also recognizes synonyms that -are more descriptive. The valid values for -.I method -are (unique abbreviations are -accepted): -.RS -.TP 3 -\fBexisting\fP or \fBnil\fP -Make numbered backups of files that already have them, -otherwise simple backups. -.TP -\fBnone\fP -Do not make backups, unless backup-if-mismatch is in effect -and patches do not match files. -This is the default. -.TP -\fBnumbered\fP or \fBt\fP -Make numbered backups. The numbered backup file name for -.I F -is -.IB F .~ N ~ -where -.I N -is the version number. -.TP -\fBsimple\fP or \fBnever\fP -Make simple backups. -The -.B \-B -or -.BR \*=prefix , -.B \-y -or -.BR \*=basename\-prefix , -and -.B \-z -or -.BR \*=suffix -options specify the simple backup file name. -If none of these options are given, then a simple backup suffix is used; -it is the value of the -.B SIMPLE_BACKUP_SUFFIX -environment variable if set, and is -.B \&.orig -otherwise. -.PP -With numbered or simple backups, -if the backup file name is too long, the backup suffix -.B ~ -is used instead; if even appending -.B ~ -would make the name too long, then -.B ~ -replaces the last character of the file name. -.RE -.TP -\fB\*=verbose\fP -Output extra information about the work being done. -.TP -\fB\-x\fP \fInum\fP or \fB\*=debug=\fP\fInum\fP -Set internal debugging flags of interest only to -.B patch -patchers. -.TP -\fB\-y\fP \fIpref\fP or \fB\*=basename\-prefix=\fP\fIpref\fP -Prefix the basename of the simple backup file name with -.IR pref . -For example, with -.B "\-y .del/" -the backup file name for -.B src/patch/util.c -is -.BR src/patch/.del/util.c . -.TP -\fB\-z\fP \fIsuffix\fP or \fB\*=suffix=\fP\fIsuffix\fP -Use -.I suffix -as the simple backup suffix. -The backup extension may also be specified by the -.B SIMPLE_BACKUP_SUFFIX -environment variable, which is overridden by this option. -.TP -\fB\-Z\fP or \fB\*=set\-utc\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use Coordinated Universal Time (\s-1UTC\s0, often known as \s-1GMT\s0). -Also see the -.B \-T -or -.B \*=set\-time -option. -.Sp -The -.B \-Z -or -.B \*=set\-utc -and -.B \-T -or -.B \*=set\-time -options normally refrain from setting a file's time if the file's original time -does not match the time given in the patch header, or if its -contents do not match the patch exactly. However, if the -.B \-f -or -.B \*=force -option is given, the file time is set regardless. -.Sp -Due to the limitations of -.B diff -output format, these options cannot update the times of files whose -contents have not changed. Also, if you use these options, you should remove -(e.g. with -.BR "make\ clean" ) -all files that depend on the patched files, so that later invocations of -.B make -do not get confused by the patched files' times. -.SH ENVIRONMENT -.TP 3 -\fBPATCH_GET\fP -This specifies whether -.B patch -gets missing or read-only files from \s-1RCS\s0 or \s-1SCCS\s0 -by default; see the -.B \-g -or -.B \*=get -option. -.TP -.B POSIXLY_CORRECT -If set, -.B patch -conforms more strictly to the \s-1POSIX\s0 standard: -it takes the first existing file from the list (old, new, index) -when intuiting file names from diff headers, -it does not remove files that are empty after patching, -it does not ask whether to get files from \s-1RCS\s0 or \s-1SCCS\s0, -it requires that all options precede the -files in the command line, -and by default it does not make backup files. -.TP -.B SIMPLE_BACKUP_SUFFIX -Extension to use for simple backup file names instead of -.BR \&.orig . -.TP -\fBTMPDIR\fP, \fBTMP\fP, \fBTEMP\fP -Directory to put temporary files in; -.B patch -uses the first environment variable in this list that is set. -If none are set, the default is system-dependent; -it is normally -.B /tmp -on Unix hosts. -.TP -\fBVERSION_CONTROL\fP or \fBPATCH_VERSION_CONTROL\fP -Selects version control style; see the -.B \-v -or -.B \*=version\-control -option. -.SH FILES -.TP 3 -.IB $TMPDIR "/p\(**" -temporary files -.TP -.B /dev/tty -controlling terminal; used to get answers to questions asked of the user -.SH "SEE ALSO" -.BR diff (1), -.BR ed (1) -.SH "NOTES FOR PATCH SENDERS" -There are several things you should bear in mind if you are going to -be sending out patches. -.PP -Create your patch systematically. -A good method is the command -.BI "diff\ \-Naur\ " "old\ new" -where -.I old -and -.I new -identify the old and new directories. -The names -.I old -and -.I new -should not contain any slashes. -The -.B diff -command's headers should have dates -and times in Universal Time using traditional Unix format, -so that patch recipients can use the -.B \-Z -or -.B \*=set\-utc -option. -Here is an example command, using Bourne shell syntax: -.Sp - \fBLC_ALL=C TZ=UTC0 diff \-Naur gcc\-2.7 gcc\-2.8\fP -.PP -Tell your recipients how to apply the patch -by telling them which directory to -.B cd -to, and which -.B patch -options to use. The option string -.B "\-Np1" -is recommended. -Test your procedure by pretending to be a recipient and applying -your patch to a copy of the original files. -.PP -You can save people a lot of grief by keeping a -.B patchlevel.h -file which is patched to increment the patch level -as the first diff in the patch file you send out. -If you put a -.B Prereq:\& -line in with the patch, it won't let them apply -patches out of order without some warning. -.PP -You can create a file by sending out a diff that compares -.B /dev/null -or an empty file dated the Epoch (1970-01-01 00:00:00 \s-1UTC\s0) -to the file you want to create. -This only works if the file you want to create doesn't exist already in -the target directory. -Conversely, you can remove a file by sending out a context diff that compares -the file to be deleted with an empty file dated the Epoch. -The file will be removed unless the -.B POSIXLY_CORRECT -environment variable is set and the -.B \-E -or -.B \*=remove\-empty\-files -option is not given. -An easy way to generate patches that create and remove files -is to use \s-1GNU\s0 -.BR diff 's -.B \-N -or -.B \*=new\-file -option. -.PP -If the recipient is supposed to use the -.BI \-p N -option, do not send output that looks like this: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -because the two file names have different numbers of slashes, -and different versions of -.B patch -interpret the file names differently. -To avoid confusion, send output that looks like this instead: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README v2.0.30/prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ v2.0.30/prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -.PP -Avoid sending patches that compare backup file names like -.BR README.orig , -since this might confuse -.B patch -into patching a backup file instead of the real file. -Instead, send patches that compare the same base file names -in different directories, e.g.\& -.B old/README -and -.BR new/README . -.PP -Take care not to send out reversed patches, since it makes people wonder -whether they already applied the patch. -.PP -Try not to have your patch modify derived files -(e.g. the file -.B configure -where there is a line -.B "configure: configure.in" -in your makefile), since the recipient should be -able to regenerate the derived files anyway. -If you must send diffs of derived files, -generate the diffs using \s-1UTC\s0, -have the recipients apply the patch with the -.B \-Z -or -.B \*=set\-utc -option, and have them remove any unpatched files that depend on patched files -(e.g. with -.BR "make\ clean" ). -.PP -While you may be able to get away with putting 582 diff listings into -one file, it may be wiser to group related patches into separate files in -case something goes haywire. -.SH DIAGNOSTICS -Diagnostics generally indicate that -.B patch -couldn't parse your patch file. -.PP -If the -.B \*=verbose -option is given, the message -.B Hmm.\|.\|.\& -indicates that there is unprocessed text in -the patch file and that -.B patch -is attempting to intuit whether there is a patch in that text and, if so, -what kind of patch it is. -.PP -.BR patch 's -exit status is -0 if all hunks are applied successfully, -1 if some hunks cannot be applied, -and 2 if there is more serious trouble. -When applying a set of patches in a loop it behooves you to check this -exit status so you don't apply a later patch to a partially patched file. -.SH CAVEATS -Context diffs cannot reliably represent the creation or deletion of -empty files, empty directories, or special files such as symbolic links. -Nor can they represent changes to file metadata like ownership, permissions, -or whether one file is a hard link to another. -If changes like these are also required, separate instructions -(e.g. a shell script) to accomplish them should accompany the patch. -.PP -.B patch -cannot tell if the line numbers are off in an -.B ed -script, and can detect -bad line numbers in a normal diff only when it finds a change or deletion. -A context diff using fuzz factor 3 may have the same problem. -Until a suitable interactive interface is added, you should probably do -a context diff in these cases to see if the changes made sense. -Of course, compiling without errors is a pretty good indication that the patch -worked, but not always. -.PP -.B patch -usually produces the correct results, even when it has to do a lot of -guessing. -However, the results are guaranteed to be correct only when the patch is -applied to exactly the same version of the file that the patch was -generated from. -.SH "COMPATIBILITY ISSUES" -The \s-1POSIX\s0 standard specifies behavior that differs from -.BR patch 's -traditional behavior. -You should be aware of these differences if you must interoperate with -.B patch -versions 2.1 and earlier, which are not \s-1POSIX\s0-compliant. -.TP 3 -.B " \(bu" -In traditional -.BR patch , -the -.B \-p -option's operand was optional, and a bare -.B \-p -was equivalent to -.BR \-p0. -The -.B \-p -option now requires an operand, and -.B "\-p\ 0" -is now equivalent to -.BR \-p0 . -For maximum compatibility, use options like -.B \-p0 -and -.BR \-p1 . -.Sp -Also, -traditional -.B patch -simply counted slashes when stripping path prefixes; -.B patch -now counts pathname components. -That is, a sequence of one or more adjacent slashes -now counts as a single slash. -For maximum portability, avoid sending patches containing -.B // -in file names. -.TP -.B " \(bu" -In traditional -.BR patch , -simple backups were enabled by default. -This behavior is now enabled with the -.B \-b -or -.B \*=backup -option, or by setting the -.B VERSION_CONTROL -environment variable to -.BR simple . -.Sp -Conversely, in \s-1POSIX\s0 -.BR patch , -backups are never made, even when there is a mismatch. -In \s-1GNU\s0 -.BR patch , -this behavior is enabled with the -.B \*=no\-backup\-if\-mismatch -option or by setting the -.B POSIXLY_CORRECT -environment variable. -.Sp -The -.BI \-b " suffix" -option -of traditional -.B patch -is equivalent to the -.BI "\-b \-z" " suffix" -options of \s-1GNU\s0 -.BR patch . -.TP -.B " \(bu" -Traditional -.B patch -used a complicated (and incompletely documented) method -to intuit the name of the file to be patched from the patch header. -This method was not \s-1POSIX\s0-compliant, and had a few gotchas. -Now -.B patch -uses a different, equally complicated (but better documented) method -that is optionally \s-1POSIX\s0-compliant; we hope it has -fewer gotchas. The two methods are compatible if the -file names in the context diff header and the -.B Index:\& -line are all identical after prefix-stripping. -Your patch is normally compatible if each header's file names -all contain the same number of slashes. -.TP -.B " \(bu" -When traditional -.B patch -asked the user a question, it sent the question to standard error -and looked for an answer from -the first file in the following list that was a terminal: -standard error, standard output, -.BR /dev/tty , -and standard input. -Now -.B patch -sends questions to standard output and gets answers from -.BR /dev/tty . -Defaults for some answers have been changed so that -.B patch -never goes into an infinite loop when using default answers. -.TP -.B " \(bu" -Traditional -.B patch -exited with a status value that counted the number of bad hunks, -or with status 1 if there was real trouble. -Now -.B patch -exits with status 1 if some hunks failed, -or with 2 if there was real trouble. -.TP -.B " \(bu" -Limit yourself to the following options when sending instructions -meant to be executed by anyone running \s-1GNU\s0 -.BR patch , -traditional -.BR patch , -or a \s-1POSIX\s0-compliant -.BR patch . -Spaces are significant in the following list, and operands are required. -.Sp -.nf -.in +3 -.ne 11 -.B \-c -.BI \-d " dir" -.BI \-D " define" -.B \-e -.B \-l -.B \-n -.B \-N -.BI \-o " outfile" -.BI \-p num -.B \-R -.BI \-r " rejectfile" -.in -.fi -.SH BUGS -.B patch -could be smarter about partial matches, excessively deviant offsets and -swapped code, but that would take an extra pass. -.PP -If code has been duplicated (for instance with -\fB#ifdef OLDCODE\fP .\|.\|. \fB#else .\|.\|. #endif\fP), -.B patch -is incapable of patching both versions, and, if it works at all, will likely -patch the wrong one, and tell you that it succeeded to boot. -.PP -If you apply a patch you've already applied, -.B patch -thinks it is a reversed patch, and offers to un-apply the patch. -This could be construed as a feature. -.SH COPYING -Copyright -.if t \(co -1984, 1985, 1986, 1988 Larry Wall. -.br -Copyright -.if t \(co -1997 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the copyright holders instead of in -the original English. -.SH AUTHORS -Larry Wall wrote the original version of -.BR patch . -Paul Eggert removed -.BR patch 's -arbitrary limits; added support for binary files, -setting file times, and deleting files; -and made it conform better to \s-1POSIX\s0. -Other contributors include Wayne Davison, who added unidiff support, -and David MacKenzie, who added configuration and backup support. Property changes on: vendor/misc-GNU/patch/2.4/patch.1 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/argmatch.c =================================================================== --- vendor/misc-GNU/patch/2.4/argmatch.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/argmatch.c (nonexistent) @@ -1,92 +0,0 @@ -/* argmatch.c -- find a match for a string in an array - Copyright (C) 1990, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#include - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -/* If ARG is an unambiguous match for an element of the - null-terminated array OPTLIST, return the index in OPTLIST - of the matched element, else -1 if it does not match any element - or -2 if it is ambiguous (is a prefix of more than one element). */ - -int -argmatch (arg, optlist) - const char *arg; - const char *const *optlist; -{ - int i; /* Temporary index in OPTLIST. */ - size_t arglen; /* Length of ARG. */ - int matchind = -1; /* Index of first nonexact match. */ - int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ - - arglen = strlen (arg); - - /* Test all elements for either exact match or abbreviated matches. */ - for (i = 0; optlist[i]; i++) - { - if (!strncmp (optlist[i], arg, arglen)) - { - if (strlen (optlist[i]) == arglen) - /* Exact match found. */ - return i; - else if (matchind == -1) - /* First nonexact match found. */ - matchind = i; - else - /* Second nonexact match found. */ - ambiguous = 1; - } - } - if (ambiguous) - return -2; - else - return matchind; -} - -/* Error reporting for argmatch. - KIND is a description of the type of entity that was being matched. - VALUE is the invalid value that was given. - PROBLEM is the return value from argmatch. */ - -void -invalid_arg (kind, value, problem) - const char *kind; - const char *value; - int problem; -{ - fprintf (stderr, "%s: ", program_name); - if (problem == -1) - fprintf (stderr, "invalid"); - else /* Assume -2. */ - fprintf (stderr, "ambiguous"); - fprintf (stderr, " %s `%s'\n", kind, value); -} Property changes on: vendor/misc-GNU/patch/2.4/argmatch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/NEWS =================================================================== --- vendor/misc-GNU/patch/2.4/NEWS (revision 358868) +++ vendor/misc-GNU/patch/2.4/NEWS (nonexistent) @@ -1,158 +0,0 @@ -Known problems: - -* The diffutils 2.7 documentation for `patch' is obsolete; this should be - fixed in diffutils 2.8. Until then, see `patch --help' or `man patch'. - -Change in version 2.4: - -* New options: - -Z or --set-utc sets times of patched files, assuming diff uses UTC (GMT). - -T or --set-time is similar, assuming local time (not recommended). - --backup-if-mismatch makes a backup if the patch does not match exactly - --no-backup-if-mismatch makes a backup only if otherwise requested - -* The default is now --backup-if-mismatch unless POSIXLY_CORRECT is set. - -* The -B or --prefix, -Y or --basename-prefix, and -z or --suffix options - no longer affect whether backups are made (as they did in patch 2.2 and 2.3); - they now merely specify the file names used when simple backups are made. - -* When patching a nonexistent file and making backups, an empty backup file - is now made (just as with traditional patch); but the backup file is - unreadable, as a way of indicating that it represents a nonexistent file. - -* `patch' now matches against empty and nonexistent files more generously. - A patch against an empty file applies to a nonexistent file, and vice versa. - -* -g or --get and PATCH_GET now have a numeric value that specifies - whether `patch' is getting files. - If the value is positive, working files are gotten from RCS or SCCS files; - if zero, `patch' ignores RCS and SCCS and working files are not gotten; - and if negative, `patch' asks the user whether to get each file. - The default is normally negative, but it is zero if POSIXLY_CORRECT is set. - -* The -G or --no-get option introduced in GNU patch 2.3 has been removed; - use -g0 instead. - -* The method used to intuit names of files to be patched is changed again: - `Index:' lines are normally ignored for context diffs, - and RCS and SCCS files are normally looked for when files do not exist. - The complete new method is described in the man page. - -* By default, `patch' is now more verbose when patches do not match exactly. - -* The manual page has a new COMPATIBILITY ISSUES section. - -Changes in version 2.3: - -* Unless the POSIXLY_CORRECT environment variable is set: - - - `patch' now distinguishes more accurately between empty and - nonexistent files if the input is a context diff. - A file is assumed to not exist if its context diff header - suggests that it is empty, and if the header timestamp - looks like it might be equivalent to 1970-01-01 00:00:00 UTC. - - Files that ``become nonexistent'' after patching are now removed. - When a file is removed, any empty ancestor directories are also removed. - -* Files are now automatically gotten from RCS and SCCS - if the -g or --get option is specified. - (The -G or --no-get option, also introduced in 2.3, was withdrawn in 2.4.) - -* If the PATCH_VERSION_CONTROL environment variable is set, - it overrides the VERSION_CONTROL environment variable. - -* The method used to intuit names of files to be patched is changed. - (It was further revised in 2.4; see above.) - -* The new --binary option makes `patch' read and write files in binary mode. - This option has no effect on POSIX-compliant hosts; - it is useful only in on operating systems like DOS - that distinguish between text and binary I/O. - -* The environment variables TMP and TEMP are consulted for the name of - the temporary directory if TMPDIR is not set. - -* A port to MS-DOS and MS-Windows is available; see the `pc' directory. - -* Backup file names are no longer ever computed by uppercasing characters, - since this isn't portable to systems with case-insensitive file names. - -Changes in version 2.2: - -* Arbitrary limits removed (e.g. line length, file name length). - -* On POSIX.1-compliant hosts, you can now patch binary files using the output - of GNU `diff -a'. - -* New options: - --dry-run - --help - --verbose - -i FILE or --input=FILE - -y PREF or --basename-prefix=PREF - -* patch is now quieter by default; use --verbose for the old chatty behavior. - -* Patch now complies better with POSIX.2 if your host complies with POSIX.1. - - Therefore: - - By default, no backups are made. - (But this was changed again in patch 2.4; see above.) - - The simple backup file name for F defaults to F.orig - regardless of whether the file system supports long file names, - and F~ is used only if F.orig is too long for that particular file. - - Similarly for the reject file names F.rej and F#. - - Also: - - The pseudo-option `+' has been withdrawn. - - -b is equivalent to --version-control=simple; - `-z SUFF' has the meaning that `-b SUFF' used to. - - Names of files to be patched are taken first from *** line and then from - --- line of context diffs; then from Index: line; /dev/tty is - consulted if none of the above files exist. However, if the patch - appears to create a file, the file does not have to exist: instead, - the first name with the longest existing directory prefix is taken. - (These rules were changed again in patch 2.3 and 2.4; see above.) - - Exit status 0 means success, 1 means hunks were rejected, 2 means trouble. - - `-l' ignores changes only in spaces and tabs, not in other white space. - - If no `-p' option is given, `-pINFINITY' is assumed, instead of trying - to guess the proper value. - - `-p' now requires an operand; use `-p 0' to get the effect of the old plain - `-p' option. - - `-p' treats two or more adjacent slashes as if it were one slash. - - The TERM signal is caught. - - New option `-i F' reads patch from F instead of stdin. - -* The `patch' options and build procedure conform to current GNU standards. - For example, the `--version' option now outputs copyright information. - -* When the patch is creating a file, but a nonempty file of that name already - exists, `patch' now asks for confirmation before patching. - -* RCS is used only if the version control method is `existing' - and there is already an RCS file. Similarly for SCCS. - (But this was changed again in patch 2.3 and 2.4; see above.) - -* Copyright notices have been clarified. Every file in this version of `patch' - can be distributed under the GNU General Public License. See README for - details. - -Changes in version 2.1: - -* A few more portability bugs have been fixed. The version number has - been changed from 2.0.12g11 to 2.1, because the name - `patch-2.0.12g10' was too long for traditional Unix file systems. - -Versions 2.0.12g9 through 2.0.12g11 fix various portability bugs. - -Changes in version 2.0.12g8: - -* Start of the 12g series, with a GNU-style configure script and - long-named options. -* Added the -t --batch option, similar to -f. -* Improved detection of files that are locked under RCS or SCCS. -* Reinstate the -E option to remove output files that are empty after - being patched. -* Print the system error message when system calls fail. -* Fixed various bugs and portability problems. Property changes on: vendor/misc-GNU/patch/2.4/NEWS ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/util.c =================================================================== --- vendor/misc-GNU/patch/2.4/util.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/util.c (nonexistent) @@ -1,1070 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.c,v 1.22 1997/06/13 06:28:37 eggert Exp $ */ - -/* -Copyright 1986 Larry Wall -Copyright 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#include -#include - -#include -#if !defined SIGCHLD && defined SIGCLD -#define SIGCHLD SIGCLD -#endif -#if ! HAVE_RAISE -# define raise(sig) kill (getpid (), sig) -#endif - -#ifdef __STDC__ -# include -# define vararg_start va_start -#else -# define vararg_start(ap,p) va_start (ap) -# if HAVE_VARARGS_H -# include -# else - typedef char *va_list; -# define va_dcl int va_alist; -# define va_start(ap) ((ap) = (va_list) &va_alist) -# define va_arg(ap, t) (((t *) ((ap) += sizeof (t))) [-1]) -# define va_end(ap) -# endif -#endif - -static void makedirs PARAMS ((char *)); - -/* Move a file FROM to TO, renaming it if possible and copying it if necessary. - If we must create TO, use MODE to create it. - If FROM is null, remove TO (ignoring FROMSTAT). - Back up TO if BACKUP is nonzero. */ - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -void -move_file (char const *from, char *to, mode_t mode, int backup) -#else -void -move_file (from, to, mode, backup) - char const *from; - char *to; - mode_t mode; - int backup; -#endif -{ - struct stat to_st; - int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno; - - if (backup) - { - int try_makedirs_errno = 0; - char *bakname; - - if (origprae || origbase) - { - char const *p = origprae ? origprae : ""; - char const *b = origbase ? origbase : ""; - char const *o = base_name (to); - size_t plen = strlen (p); - size_t tlen = o - to; - size_t blen = strlen (b); - size_t osize = strlen (o) + 1; - bakname = xmalloc (plen + tlen + blen + osize); - memcpy (bakname, p, plen); - memcpy (bakname + plen, to, tlen); - memcpy (bakname + plen + tlen, b, blen); - memcpy (bakname + plen + tlen + blen, o, osize); - for (p += FILESYSTEM_PREFIX_LEN (p); *p; p++) - if (ISSLASH (*p)) - { - try_makedirs_errno = ENOENT; - break; - } - } - else - { - bakname = find_backup_file_name (to); - if (!bakname) - memory_fatal (); - } - - if (to_errno) - { - int fd; - if (debug & 4) - say ("creating empty unreadable file `%s'\n", bakname); - try_makedirs_errno = ENOENT; - unlink (bakname); - while ((fd = creat (bakname, 0)) < 0) - { - if (errno != try_makedirs_errno) - pfatal ("can't create file `%s'", bakname); - makedirs (bakname); - try_makedirs_errno = 0; - } - if (close (fd) != 0) - pfatal ("can't close `%s'", bakname); - } - else - { - if (debug & 4) - say ("renaming `%s' to `%s'\n", to, bakname); - while (rename (to, bakname) != 0) - { - if (errno != try_makedirs_errno) - pfatal ("can't rename `%s' to `%s'", to, bakname); - makedirs (bakname); - try_makedirs_errno = 0; - } - } - - free (bakname); - } - - if (from) - { - if (debug & 4) - say ("renaming `%s' to `%s'\n", from, to); - - if (rename (from, to) != 0) - { - if (errno == ENOENT - && (to_errno == -1 || to_errno == ENOENT)) - { - makedirs (to); - if (rename (from, to) == 0) - return; - } - -#ifdef EXDEV - if (errno == EXDEV) - { - if (! backup && unlink (to) != 0 && errno != ENOENT) - pfatal ("can't remove `%s'", to); - copy_file (from, to, mode); - return; - } -#endif - pfatal ("can't rename `%s' to `%s'", from, to); - } - } - else if (! backup) - { - if (debug & 4) - say ("removing `%s'\n", to); - if (unlink (to) != 0) - pfatal ("can't remove `%s'", to); - } -} - -/* Create FILE with OPEN_FLAGS, and with MODE adjusted so that - we can read and write the file and that the file is not executable. - Return the file descriptor. */ -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -int -create_file (char const *file, int open_flags, mode_t mode) -#else -int -create_file (file, open_flags, mode) - char const *file; - int open_flags; - mode_t mode; -#endif -{ - int fd; - mode |= S_IRUSR | S_IWUSR; - mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); - if (! (O_CREAT && O_TRUNC)) - close (creat (file, mode)); - fd = open (file, O_CREAT | O_TRUNC | open_flags, mode); - if (fd < 0) - pfatal ("can't create `%s'", file); - return fd; -} - -/* Copy a file. */ - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -void -copy_file (char const *from, char const *to, mode_t mode) -#else -void -copy_file (from, to, mode) - char const *from; - char const *to; - mode_t mode; -#endif -{ - int tofd; - int fromfd; - size_t i; - - if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) - pfatal ("can't reopen `%s'", from); - tofd = create_file (to, O_WRONLY | O_BINARY, mode); - while ((i = read (fromfd, buf, bufsize)) != 0) - { - if (i == -1) - read_fatal (); - if (write (tofd, buf, i) != i) - write_fatal (); - } - if (close (fromfd) != 0) - read_fatal (); - if (close (tofd) != 0) - write_fatal (); -} - -static char const DEV_NULL[] = NULL_DEVICE; - -static char const SCCSPREFIX[] = "s."; -static char const GET[] = "get "; -static char const GET_LOCKED[] = "get -e "; -static char const SCCSDIFF1[] = "get -p "; -static char const SCCSDIFF2[] = "|diff - %s"; - -static char const RCSSUFFIX[] = ",v"; -static char const CHECKOUT[] = "co %s"; -static char const CHECKOUT_LOCKED[] = "co -l %s"; -static char const RCSDIFF1[] = "rcsdiff %s"; - -/* Return "RCS" if FILENAME is controlled by RCS, - "SCCS" if it is controlled by SCCS, and 0 otherwise. - READONLY is nonzero if we desire only readonly access to FILENAME. - FILESTAT describes FILENAME's status or is 0 if FILENAME does not exist. - If successful and if GETBUF is nonzero, set *GETBUF to a command - that gets the file; similarly for DIFFBUF and a command to diff the file. - *GETBUF and *DIFFBUF must be freed by the caller. */ -char const * -version_controller (filename, readonly, filestat, getbuf, diffbuf) - char const *filename; - int readonly; - struct stat const *filestat; - char **getbuf; - char **diffbuf; -{ - struct stat cstat; - char const *filebase = base_name (filename); - char const *dotslash = *filename == '-' ? "./" : ""; - size_t dir_len = filebase - filename; - size_t filenamelen = strlen (filename); - size_t maxfixlen = sizeof "SCCS/" - 1 + sizeof SCCSPREFIX - 1; - size_t maxtrysize = filenamelen + maxfixlen + 1; - size_t quotelen = quote_system_arg (0, filename); - size_t maxgetsize = sizeof GET_LOCKED + quotelen + maxfixlen; - size_t maxdiffsize = - (sizeof SCCSDIFF1 + sizeof SCCSDIFF2 + sizeof DEV_NULL - 1 - + 2 * quotelen + maxfixlen); - char *trybuf = xmalloc (maxtrysize); - char const *r = 0; - - strcpy (trybuf, filename); - -#define try1(f,a1) (sprintf (trybuf + dir_len, f, a1), stat (trybuf, &cstat) == 0) -#define try2(f,a1,a2) (sprintf (trybuf + dir_len, f, a1,a2), stat (trybuf, &cstat) == 0) - - /* Check that RCS file is not working file. - Some hosts don't report file name length errors. */ - - if ((try2 ("RCS/%s%s", filebase, RCSSUFFIX) - || try1 ("RCS/%s", filebase) - || try2 ("%s%s", filebase, RCSSUFFIX)) - && ! (filestat - && filestat->st_dev == cstat.st_dev - && filestat->st_ino == cstat.st_ino)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? CHECKOUT : CHECKOUT_LOCKED, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - sprintf (p, RCSDIFF1, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "RCS"; - } - else if (try2 ("SCCS/%s%s", SCCSPREFIX, filebase) - || try2 ("%s%s", SCCSPREFIX, filebase)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? GET : GET_LOCKED); - p += strlen (p); - p += quote_system_arg (p, trybuf); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - strcpy (p, SCCSDIFF1); - p += sizeof SCCSDIFF1 - 1; - p += quote_system_arg (p, trybuf); - sprintf (p, SCCSDIFF2, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "SCCS"; - } - - free (trybuf); - return r; -} - -/* Get FILENAME from version control system CS. The file already exists if - EXISTS is nonzero. Only readonly access is needed if READONLY is nonzero. - Use the command GETBUF to actually get the named file. - Store the resulting file status into *FILESTAT. - Return nonzero if successful. */ -int -version_get (filename, cs, exists, readonly, getbuf, filestat) - char const *filename; - char const *cs; - int exists; - int readonly; - char const *getbuf; - struct stat *filestat; -{ - if (patch_get < 0) - { - ask ("Get file `%s' from %s%s? [y] ", filename, - cs, readonly ? "" : " with lock"); - if (*buf == 'n') - return 0; - } - - if (dry_run) - { - if (! exists) - fatal ("can't do dry run on nonexistent version-controlled file `%s'; invoke `%s' and try again", - filename, getbuf); - } - else - { - if (verbosity == VERBOSE) - say ("Getting file `%s' from %s%s...\n", filename, - cs, readonly ? "" : " with lock"); - if (systemic (getbuf) != 0) - fatal ("can't get file `%s' from %s", filename, cs); - if (stat (filename, filestat) != 0) - pfatal ("%s", filename); - } - - return 1; -} - -/* Allocate a unique area for a string. */ - -char * -savebuf (s, size) - register char const *s; - register size_t size; -{ - register char *rv; - - assert (s && size); - rv = malloc (size); - - if (! rv) - { - if (! using_plan_a) - memory_fatal (); - } - else - memcpy (rv, s, size); - - return rv; -} - -char * -savestr(s) - char const *s; -{ - return savebuf (s, strlen (s) + 1); -} - -void -remove_prefix (p, prefixlen) - char *p; - size_t prefixlen; -{ - char const *s = p + prefixlen; - while ((*p++ = *s++)) - continue; -} - -#if !HAVE_VPRINTF -#define vfprintf my_vfprintf -static int vfprintf PARAMS ((FILE *, char const *, va_list)); -static int -vfprintf (stream, format, args) - FILE *stream; - char const *format; - va_list args; -{ -#if !HAVE_DOPRNT && HAVE__DOPRINTF -# define _doprnt _doprintf -#endif -#if HAVE_DOPRNT || HAVE__DOPRINTF - _doprnt (format, args, stream); - return ferror (stream) ? -1 : 0; -#else - int *a = (int *) args; - return fprintf (stream, format, - a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); -#endif -} -#endif /* !HAVE_VPRINTF */ - -/* Terminal output, pun intended. */ - -#ifdef __STDC__ -void -fatal (char const *format, ...) -#else -/*VARARGS1*/ void -fatal (format, va_alist) - char const *format; - va_dcl -#endif -{ - va_list args; - fprintf (stderr, "%s: **** ", program_name); - vararg_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - putc ('\n', stderr); - fflush (stderr); - fatal_exit (0); -} - -void -memory_fatal () -{ - fatal ("out of memory"); -} - -void -read_fatal () -{ - pfatal ("read error"); -} - -void -write_fatal () -{ - pfatal ("write error"); -} - -/* Say something from patch, something from the system, then silence . . . */ - -#ifdef __STDC__ -void -pfatal (char const *format, ...) -#else -/*VARARGS1*/ void -pfatal (format, va_alist) - char const *format; - va_dcl -#endif -{ - int errnum = errno; - va_list args; - fprintf (stderr, "%s: **** ", program_name); - vararg_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - fflush (stderr); /* perror bypasses stdio on some hosts. */ - errno = errnum; - perror (" "); - fflush (stderr); - fatal_exit (0); -} - -/* Tell the user something. */ - -#ifdef __STDC__ -void -say (char const *format, ...) -#else -/*VARARGS1*/ void -say (format, va_alist) - char const *format; - va_dcl -#endif -{ - va_list args; - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); -} - -/* Get a response from the user, somehow or other. */ - -#ifdef __STDC__ -void -ask (char const *format, ...) -#else -/*VARARGS1*/ void -ask (format, va_alist) - char const *format; - va_dcl -#endif -{ - static int ttyfd = -2; - int r; - va_list args; - - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); - - if (ttyfd == -2) - { - /* If standard output is not a tty, don't bother opening /dev/tty, - since it's unlikely that stdout will be seen by the tty user. - The isatty test also works around a bug in GNU Emacs 19.34 under Linux - which makes a call-process `patch' hang when it reads from /dev/tty. - POSIX.2 requires that we read /dev/tty, though. */ - ttyfd = (posixly_correct || isatty (STDOUT_FILENO) - ? open (TTY_DEVICE, O_RDONLY) - : -1); - } - - if (ttyfd < 0) - { - /* No terminal at all -- default it. */ - printf ("\n"); - buf[0] = '\n'; - buf[1] = '\0'; - } - else - { - size_t s = 0; - while ((r = read (ttyfd, buf + s, bufsize - 1 - s)) == bufsize - 1 - s - && buf[bufsize - 2] != '\n') - { - s = bufsize - 1; - bufsize *= 2; - buf = realloc (buf, bufsize); - if (!buf) - memory_fatal (); - } - if (r == 0) - printf ("EOF\n"); - else if (r < 0) - { - perror ("tty read"); - fflush (stderr); - close (ttyfd); - ttyfd = -1; - r = 0; - } - buf[s + r] = '\0'; - } -} - -/* Return nonzero if it OK to reverse a patch. */ - -#ifdef __STDC__ -int -ok_to_reverse (char const *format, ...) -#else -ok_to_reverse (format, va_alist) - char const *format; - va_dcl -#endif -{ - int r = 0; - - if (noreverse || ! (force && verbosity == SILENT)) - { - va_list args; - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - } - - if (noreverse) - { - printf (" Skipping patch.\n"); - skip_rest_of_patch = TRUE; - r = 0; - } - else if (force) - { - if (verbosity != SILENT) - printf (" Applying it anyway.\n"); - r = 0; - } - else if (batch) - { - say (reverse ? " Ignoring -R.\n" : " Assuming -R.\n"); - r = 1; - } - else - { - ask (reverse ? " Ignore -R? [y] " : " Assume -R? [y] "); - r = *buf != 'n'; - if (! r) - { - ask ("Apply anyway? [n] "); - if (*buf != 'y') - { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - } - } - } - - return r; -} - -/* How to handle certain events when not in a critical region. */ - -#define NUM_SIGS (sizeof (sigs) / sizeof (*sigs)) -static int const sigs[] = { -#ifdef SIGHUP - SIGHUP, -#endif -#ifdef SIGPIPE - SIGPIPE, -#endif -#ifdef SIGTERM - SIGTERM, -#endif -#ifdef SIGXCPU - SIGXCPU, -#endif -#ifdef SIGXFSZ - SIGXFSZ, -#endif - SIGINT -}; - -#if !HAVE_SIGPROCMASK -#define sigset_t int -#define sigemptyset(s) (*(s) = 0) -#ifndef sigmask -#define sigmask(sig) (1 << ((sig) - 1)) -#endif -#define sigaddset(s, sig) (*(s) |= sigmask (sig)) -#define sigismember(s, sig) ((*(s) & sigmask (sig)) != 0) -#ifndef SIG_BLOCK -#define SIG_BLOCK 0 -#endif -#ifndef SIG_UNBLOCK -#define SIG_UNBLOCK (SIG_BLOCK + 1) -#endif -#ifndef SIG_SETMASK -#define SIG_SETMASK (SIG_BLOCK + 2) -#endif -#define sigprocmask(how, n, o) \ - ((how) == SIG_BLOCK \ - ? ((o) ? *(o) = sigblock (*(n)) : sigblock (*(n))) \ - : (how) == SIG_UNBLOCK \ - ? sigsetmask (((o) ? *(o) = sigblock (0) : sigblock (0)) & ~*(n)) \ - : (o ? *(o) = sigsetmask (*(n)) : sigsetmask (*(n)))) -#if !HAVE_SIGSETMASK -#define sigblock(mask) 0 -#define sigsetmask(mask) 0 -#endif -#endif - -static sigset_t initial_signal_mask; -static sigset_t signals_to_block; - -#if ! HAVE_SIGACTION -static RETSIGTYPE fatal_exit_handler PARAMS ((int)) __attribute__ ((noreturn)); -static RETSIGTYPE -fatal_exit_handler (sig) - int sig; -{ - signal (sig, SIG_IGN); - fatal_exit (sig); -} -#endif - -void -set_signals(reset) -int reset; -{ - int i; -#if HAVE_SIGACTION - struct sigaction initial_act, fatal_act; - fatal_act.sa_handler = fatal_exit; - sigemptyset (&fatal_act.sa_mask); - fatal_act.sa_flags = 0; -#define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) -#else -#define setup_handler(sig) signal (sig, fatal_exit_handler) -#endif - - if (!reset) - { -#ifdef SIGCHLD - /* System V fork+wait does not work if SIGCHLD is ignored. */ - signal (SIGCHLD, SIG_DFL); -#endif - sigemptyset (&signals_to_block); - for (i = 0; i < NUM_SIGS; i++) - { - int ignoring_signal; -#if HAVE_SIGACTION - if (sigaction (sigs[i], (struct sigaction *) 0, &initial_act) != 0) - continue; - ignoring_signal = initial_act.sa_handler == SIG_IGN; -#else - ignoring_signal = signal (sigs[i], SIG_IGN) == SIG_IGN; -#endif - if (! ignoring_signal) - { - sigaddset (&signals_to_block, sigs[i]); - setup_handler (sigs[i]); - } - } - } - else - { - /* Undo the effect of ignore_signals. */ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_SETMASK, &initial_signal_mask, (sigset_t *) 0); -#else - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - setup_handler (sigs[i]); -#endif - } -} - -/* How to handle certain events when in a critical region. */ - -void -ignore_signals() -{ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); -#else - int i; - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - signal (sigs[i], SIG_IGN); -#endif -} - -void -exit_with_signal (sig) - int sig; -{ - sigset_t s; - signal (sig, SIG_DFL); - sigemptyset (&s); - sigaddset (&s, sig); - sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); - raise (sig); - exit (2); -} - -int -systemic (command) - char const *command; -{ - if (debug & 8) - say ("+ %s\n", command); - fflush (stdout); - return system (command); -} - -#if !HAVE_MKDIR -/* These mkdir and rmdir substitutes are good enough for `patch'; - they are not general emulators. */ - -static int doprogram PARAMS ((char const *, char const *)); -static int mkdir PARAMS ((char const *, mode_t)); -static int rmdir PARAMS ((char const *)); - -static int -doprogram (program, arg) - char const *program; - char const *arg; -{ - int result; - static char const DISCARD_OUTPUT[] = " 2>/dev/null"; - size_t program_len = strlen (program); - char *cmd = xmalloc (program_len + 1 + quote_system_arg (0, arg) - + sizeof DISCARD_OUTPUT); - char *p = cmd; - strcpy (p, program); - p += program_len; - *p++ = ' '; - p += quote_system_arg (p, arg); - strcpy (p, DISCARD_OUTPUT); - result = systemic (cmd); - free (cmd); - return result; -} - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -static int -mkdir (char const *path, mode_t mode) -#else -static int -mkdir (path, mode) - char const *path; - mode_t mode; /* ignored */ -#endif -{ - return doprogram ("mkdir", path); -} - -static int -rmdir (path) - char const *path; -{ - int result = doprogram ("rmdir", path); - errno = EEXIST; - return result; -} -#endif - -/* Replace '/' with '\0' in FILENAME if it marks a place that - needs testing for the existence of directory. Return the address - of the last location replaced, or 0 if none were replaced. */ -static char *replace_slashes PARAMS ((char *)); -static char * -replace_slashes (filename) - char *filename; -{ - char *f; - char *last_location_replaced = 0; - char const *component_start; - - for (f = filename + FILESYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) - continue; - - component_start = f; - - for (; *f; f++) - if (ISSLASH (*f)) - { - char *slash = f; - - /* Treat multiple slashes as if they were one slash. */ - while (ISSLASH (f[1])) - f++; - - /* Ignore slashes at the end of the path. */ - if (! f[1]) - break; - - /* "." and ".." need not be tested. */ - if (! (slash - component_start <= 2 - && component_start[0] == '.' && slash[-1] == '.')) - { - *slash = '\0'; - last_location_replaced = slash; - } - - component_start = f + 1; - } - - return last_location_replaced; -} - -/* Make sure we'll have the directories to create a file. - Ignore the last element of `filename'. */ - -static void -makedirs (filename) - register char *filename; -{ - register char *f; - register char *flim = replace_slashes (filename); - - if (flim) - { - /* Create any missing directories, replacing NULs by '/'s. - Ignore errors. We may have to keep going even after an EEXIST, - since the path may contain ".."s; and when there is an EEXIST - failure the system may return some other error number. - Any problems will eventually be reported when we create the file. */ - for (f = filename; f <= flim; f++) - if (!*f) - { - mkdir (filename, - S_IRUSR|S_IWUSR|S_IXUSR - |S_IRGRP|S_IWGRP|S_IXGRP - |S_IROTH|S_IWOTH|S_IXOTH); - *f = '/'; - } - } -} - -/* Remove empty ancestor directories of FILENAME. - Ignore errors, since the path may contain ".."s, and when there - is an EEXIST failure the system may return some other error number. */ -void -removedirs (filename) - char *filename; -{ - size_t i; - - for (i = strlen (filename); i != 0; i--) - if (ISSLASH (filename[i]) - && ! (ISSLASH (filename[i - 1]) - || (filename[i - 1] == '.' - && (i == 1 - || ISSLASH (filename[i - 2]) - || (filename[i - 2] == '.' - && (i == 2 - || ISSLASH (filename[i - 3]))))))) - { - filename[i] = '\0'; - if (rmdir (filename) == 0 && verbosity == VERBOSE) - say ("Removed empty directory `%s'.\n", filename); - filename[i] = '/'; - } -} - -static time_t initial_time; - -void -init_time () -{ - time (&initial_time); -} - -/* Make filenames more reasonable. */ - -char * -fetchname (at, strip_leading, pstamp) -char *at; -int strip_leading; -time_t *pstamp; -{ - char *name; - register char *t; - int sleading = strip_leading; - time_t stamp = (time_t) -1; - - while (ISSPACE ((unsigned char) *at)) - at++; - if (debug & 128) - say ("fetchname %s %d\n", at, strip_leading); - - name = at; - /* Strip off up to `sleading' leading slashes and null terminate. */ - for (t = at; *t; t++) - { - if (ISSLASH (*t)) - { - while (ISSLASH (t[1])) - t++; - if (--sleading >= 0) - name = t+1; - } - else if (ISSPACE ((unsigned char) *t)) - { - if (set_time | set_utc) - stamp = str2time (t, initial_time, set_utc ? 0L : TM_LOCAL_ZONE); - else - { - /* The head says the file is nonexistent if the timestamp - is the epoch; but the listed time is local time, not UTC, - and POSIX.1 allows local time to be 24 hours away from UTC. - So match any time within 24 hours of the epoch. - Use a default time zone 24 hours behind UTC so that any - non-zoned time within 24 hours of the epoch is valid. */ - stamp = str2time (t, initial_time, -24L * 60 * 60); - if (0 <= stamp && stamp <= 2 * 24L * 60 * 60) - stamp = 0; - } - - *t = '\0'; - break; - } - } - - if (!*name) - return 0; - - /* Allow files to be created by diffing against /dev/null. */ - if (strcmp (at, "/dev/null") == 0) - { - if (pstamp) - *pstamp = 0; - return 0; - } - - if (pstamp) - *pstamp = stamp; - - return savestr (name); -} - -GENERIC_OBJECT * -xmalloc (size) - size_t size; -{ - register GENERIC_OBJECT *p = malloc (size); - if (!p) - memory_fatal (); - return p; -} - -void -Fseek (stream, offset, ptrname) - FILE *stream; - file_offset offset; - int ptrname; -{ - if (file_seek (stream, offset, ptrname) != 0) - pfatal ("fseek"); -} Property changes on: vendor/misc-GNU/patch/2.4/util.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/argmatch.h =================================================================== --- vendor/misc-GNU/patch/2.4/argmatch.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/argmatch.h (nonexistent) @@ -1,12 +0,0 @@ -/* argmatch.h -- declarations for matching arguments against option lists */ - -#if defined __STDC__ || __GNUC__ -# define __ARGMATCH_P(args) args -#else -# define __ARGMATCH_P(args) () -#endif - -int argmatch __ARGMATCH_P ((const char *, const char * const *)); -void invalid_arg __ARGMATCH_P ((const char *, const char *, int)); - -extern char const program_name[]; Property changes on: vendor/misc-GNU/patch/2.4/argmatch.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/backupfile.h =================================================================== --- vendor/misc-GNU/patch/2.4/backupfile.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/backupfile.h (nonexistent) @@ -1,50 +0,0 @@ -/* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990, 1991, 1992, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -extern enum backup_type backup_type; -extern char const *simple_backup_suffix; - -#ifndef __BACKUPFILE_P -# if defined __STDC__ || __GNUC__ -# define __BACKUPFILE_P(args) args -# else -# define __BACKUPFILE_P(args) () -# endif -#endif - -char *base_name __BACKUPFILE_P ((char const *)); -char *find_backup_file_name __BACKUPFILE_P ((char const *)); -enum backup_type get_version __BACKUPFILE_P ((char const *)); -void addext __BACKUPFILE_P ((char *, char const *, int)); Property changes on: vendor/misc-GNU/patch/2.4/backupfile.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/backupfile.c =================================================================== --- vendor/misc-GNU/patch/2.4/backupfile.c (revision 358868) +++ vendor/misc-GNU/patch/2.4/backupfile.c (nonexistent) @@ -1,251 +0,0 @@ -/* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990,1991,1992,1993,1995,1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . - Some algorithms adapted from GNU Emacs. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_DIRENT_H -# include -# define NLENGTH(direct) strlen ((direct)->d_name) -#else -# define dirent direct -# define NLENGTH(direct) ((size_t) (direct)->d_namlen) -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - -#if CLOSEDIR_VOID -/* Fake a return value. */ -# define CLOSEDIR(d) (closedir (d), 0) -#else -# define CLOSEDIR(d) closedir (d) -#endif - -#if STDC_HEADERS -# include -#else -char *malloc (); -#endif - -#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H -# define HAVE_DIR 1 -#else -# define HAVE_DIR 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif -/* Upper bound on the string length of an integer converted to string. - 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; - add 1 for integer division truncation; add 1 more for a minus sign. */ -#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2) - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - - It's typically faster. - Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that - only '0' through '9' are digits. Prefer ISDIGIT to isdigit unless - it's important to use the locale's definition of `digit' even when the - host does not conform to Posix. */ -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#if D_INO_IN_DIRENT -# define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) -#else -# define REAL_DIR_ENTRY(dp) 1 -#endif - -/* Which type of backup file names are generated. */ -enum backup_type backup_type = none; - -/* The extension added to file names to produce a simple (as opposed - to numbered) backup file name. */ -const char *simple_backup_suffix = ".orig"; - -static int max_backup_version __BACKUPFILE_P ((const char *, const char *)); -static int version_number __BACKUPFILE_P ((const char *, const char *, size_t)); - -/* Return the name of the new backup file for file FILE, - allocated with malloc. Return 0 if out of memory. - FILE must not end with a '/' unless it is the root directory. */ - -char * -find_backup_file_name (file) - const char *file; -{ - size_t backup_suffix_size_max; - size_t file_len = strlen (file); - size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4; - char *s; - const char *suffix = simple_backup_suffix; - - /* Allow room for simple or `.~N~' backups. */ - backup_suffix_size_max = strlen (simple_backup_suffix) + 1; - if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max) - backup_suffix_size_max = numbered_suffix_size_max; - - s = malloc (file_len + backup_suffix_size_max + numbered_suffix_size_max); - if (s) - { - strcpy (s, file); - -#if HAVE_DIR - if (backup_type != simple && backup_type != none) - { - int highest_backup; - size_t dir_len = base_name (s) - s; - - strcpy (s + dir_len, "."); - highest_backup = max_backup_version (file + dir_len, s); - if (! (backup_type == numbered_existing && highest_backup == 0)) - { - char *numbered_suffix = s + (file_len + backup_suffix_size_max); - sprintf (numbered_suffix, ".~%d~", highest_backup + 1); - suffix = numbered_suffix; - } - strcpy (s, file); - } -#endif /* HAVE_DIR */ - - addext (s, suffix, '~'); - } - return s; -} - -#if HAVE_DIR - -/* Return the number of the highest-numbered backup file for file - FILE in directory DIR. If there are no numbered backups - of FILE in DIR, or an error occurs reading DIR, return 0. - */ - -static int -max_backup_version (file, dir) - const char *file; - const char *dir; -{ - DIR *dirp; - struct dirent *dp; - int highest_version; - int this_version; - size_t file_name_length; - - dirp = opendir (dir); - if (!dirp) - return 0; - - highest_version = 0; - file_name_length = strlen (file); - - while ((dp = readdir (dirp)) != 0) - { - if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) < file_name_length + 4) - continue; - - this_version = version_number (file, dp->d_name, file_name_length); - if (this_version > highest_version) - highest_version = this_version; - } - if (CLOSEDIR (dirp)) - return 0; - return highest_version; -} - -/* If BACKUP is a numbered backup of BASE, return its version number; - otherwise return 0. BASE_LENGTH is the length of BASE. - */ - -static int -version_number (base, backup, base_length) - const char *base; - const char *backup; - size_t base_length; -{ - int version; - const char *p; - - version = 0; - if (strncmp (base, backup, base_length) == 0 - && backup[base_length] == '.' - && backup[base_length + 1] == '~') - { - for (p = &backup[base_length + 2]; ISDIGIT (*p); ++p) - version = version * 10 + *p - '0'; - if (p[0] != '~' || p[1]) - version = 0; - } - return version; -} -#endif /* HAVE_DIR */ - -static const char * const backup_args[] = -{ - "never", "simple", "nil", "existing", "t", "numbered", 0 -}; - -static const enum backup_type backup_types[] = -{ - simple, simple, numbered_existing, numbered_existing, numbered, numbered -}; - -/* Return the type of backup indicated by VERSION. - Unique abbreviations are accepted. */ - -enum backup_type -get_version (version) - const char *version; -{ - int i; - - if (version == 0 || *version == 0) - return numbered_existing; - i = argmatch (version, backup_args); - if (i < 0) - { - invalid_arg ("version control type", version, i); - exit (2); - } - return backup_types[i]; -} Property changes on: vendor/misc-GNU/patch/2.4/backupfile.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.4/util.h =================================================================== --- vendor/misc-GNU/patch/2.4/util.h (revision 358868) +++ vendor/misc-GNU/patch/2.4/util.h (nonexistent) @@ -1,32 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.h,v 1.14 1997/06/13 06:28:37 eggert Exp $ */ - -int ok_to_reverse PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); -void ask PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); -void say PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); - -void fatal PARAMS ((char const *, ...)) - __attribute__ ((noreturn, format (printf, 1, 2))); -void pfatal PARAMS ((char const *, ...)) - __attribute__ ((noreturn, format (printf, 1, 2))); - -char *fetchname PARAMS ((char *, int, time_t *)); -char *savebuf PARAMS ((char const *, size_t)); -char *savestr PARAMS ((char const *)); -char const *version_controller PARAMS ((char const *, int, struct stat const *, char **, char **)); -int version_get PARAMS ((char const *, char const *, int, int, char const *, struct stat *)); -int create_file PARAMS ((char const *, int, mode_t)); -int systemic PARAMS ((char const *)); -void Fseek PARAMS ((FILE *, file_offset, int)); -void copy_file PARAMS ((char const *, char const *, mode_t)); -void exit_with_signal PARAMS ((int)) __attribute__ ((noreturn)); -void ignore_signals PARAMS ((void)); -void init_time PARAMS ((void)); -void memory_fatal PARAMS ((void)); -void move_file PARAMS ((char const *, char *, mode_t, int)); -void read_fatal PARAMS ((void)); -void remove_prefix PARAMS ((char *, size_t)); -void removedirs PARAMS ((char *)); -void set_signals PARAMS ((int)); -void write_fatal PARAMS ((void)); Property changes on: vendor/misc-GNU/patch/2.4/util.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/configure =================================================================== --- vendor/misc-GNU/patch/2.5/configure (revision 358868) +++ vendor/misc-GNU/patch/2.5/configure (nonexistent) @@ -1,2364 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=patch.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - - -PACKAGE=patch -VERSION=2.5 - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:551: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:580: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - ac_prog_rejected=no - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:628: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:662: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:667: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:691: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:719: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:809: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:859: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -# Extract the first word of "ed", so it can be a program name with args. -set dummy ed; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:890: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_ed_PROGRAM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$ed_PROGRAM" in - /*) - ac_cv_path_ed_PROGRAM="$ed_PROGRAM" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_ed_PROGRAM="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_ed_PROGRAM" && ac_cv_path_ed_PROGRAM="ed" - ;; -esac -fi -ed_PROGRAM="$ac_cv_path_ed_PROGRAM" -if test -n "$ed_PROGRAM"; then - echo "$ac_t""$ed_PROGRAM" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -# If available, prefer support for large files unless the user specified -# one of the CPPFLAGS, LDFLAGS, or LIBS variables. -echo $ac_n "checking whether large file support needs explicit enabling""... $ac_c" 1>&6 -echo "configure:923: checking whether large file support needs explicit enabling" >&5 -ac_getconfs='' -ac_result=yes -ac_set='' -ac_shellvars='CPPFLAGS LDFLAGS LIBS' -for ac_shellvar in $ac_shellvars; do - case $ac_shellvar in - CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; - *) ac_lfsvar=LFS_$ac_shellvar ;; - esac - eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar - (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } - ac_getconf=`getconf $ac_lfsvar` - ac_getconfs=$ac_getconfs$ac_getconf - eval ac_test_$ac_shellvar=\$ac_getconf -done -case "$ac_result$ac_getconfs" in -yes) ac_result=no ;; -esac -case "$ac_result$ac_set" in -yes?*) ac_result="yes, but $ac_set is already set, so use its settings" -esac -echo "$ac_t""$ac_result" 1>&6 -case $ac_result in -yes) - for ac_shellvar in $ac_shellvars; do - eval $ac_shellvar=\$ac_test_$ac_shellvar - done ;; -esac - -echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:954: checking for AIX" >&5 -cat > conftest.$ac_ext <&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF - -else - rm -rf conftest* - echo "$ac_t""no" 1>&6 -fi -rm -f conftest* - - -ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 -echo "configure:979: checking for minix/config.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - MINIX=yes -else - echo "$ac_t""no" 1>&6 -MINIX= -fi - -if test "$MINIX" = yes; then - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _POSIX_1_SOURCE 2 -EOF - - cat >> confdefs.h <<\EOF -#define _MINIX 1 -EOF - -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1027: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1049: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1129: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1167: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi - -else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1208: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1250: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1263: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -for ac_hdr in fcntl.h limits.h string.h unistd.h utime.h varargs.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1357: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1395: checking for mode_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_mode_t=yes -else - rm -rf conftest* - ac_cv_type_mode_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_mode_t" 1>&6 -if test $ac_cv_type_mode_t = no; then - cat >> confdefs.h <<\EOF -#define mode_t int -EOF - -fi - -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1428: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_off_t=yes -else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF -#define off_t long -EOF - -fi - -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1461: checking return type of signal handlers" >&5 -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int main() { -int i; -; return 0; } -EOF -if { (eval echo configure:1483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_type_signal=void -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_type_signal=int -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_type_signal" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1502: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - - -echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:1536: checking for struct utimbuf" >&5 -if eval "test \"`echo '$''{'patch_cv_sys_struct_utimbuf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if HAVE_UTIME_H -#include -#endif -int main() { -static struct utimbuf x; x.actime = x.modtime; -; return 0; } -EOF -if { (eval echo configure:1551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - patch_cv_sys_struct_utimbuf=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - patch_cv_sys_struct_utimbuf=no -fi -rm -f conftest* -fi - -echo "$ac_t""$patch_cv_sys_struct_utimbuf" 1>&6 -if test $patch_cv_sys_struct_utimbuf = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_STRUCT_UTIMBUF 1 -EOF - -fi - -# Check for NetBSD 1.0 bug, where memchr(..., 0) returns nonzero. -echo $ac_n "checking for working memchr""... $ac_c" 1>&6 -echo "configure:1573: checking for working memchr" >&5 -if eval "test \"`echo '$''{'ac_cv_func_memchr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - echo "configure: warning: We are cross-compiling so we assume memchr does not work." 1>&2 - ac_cv_func_memchr=no -else - cat > conftest.$ac_ext < -main () { exit (memchr ("", 0, 0) != 0 || memchr ("", 1, 0) != 0); } -EOF -if { (eval echo configure:1587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_func_memchr=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_memchr=no -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_func_memchr" 1>&6 -if test $ac_cv_func_memchr = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_MEMCHR 1 -EOF - -fi - -echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:1609: checking for getopt_long" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getopt_long(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_getopt_long) || defined (__stub___getopt_long) -choke me -#else -getopt_long(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_getopt_long=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_getopt_long=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'getopt_long`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -LIBOBJS="$LIBOBJS getopt1.o getopt.o" -fi - - -for ac_func in _doprintf isascii memcmp mkdir mktemp pathconf raise sigaction sigprocmask sigsetmask -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1661: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - -for ac_func in memchr rename -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1716: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.o" -fi -done - - -echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:1771: checking whether closedir returns void" >&5 -if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat > conftest.$ac_ext < -#include <$ac_header_dirent> -int closedir(); main() { exit(closedir(opendir(".")) != 0); } -EOF -if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_func_closedir_void=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_closedir_void=yes -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_closedir_void" 1>&6 -if test $ac_cv_func_closedir_void = yes; then - cat >> confdefs.h <<\EOF -#define CLOSEDIR_VOID 1 -EOF - -fi - -echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1808: checking for vprintf" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char vprintf(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vprintf) || defined (__stub___vprintf) -choke me -#else -vprintf(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_vprintf=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vprintf=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VPRINTF 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -if test "$ac_cv_func_vprintf" != yes; then -echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1860: checking for _doprnt" >&5 -if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -_doprnt(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func__doprnt=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func__doprnt=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_DOPRNT 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -fi - - -echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:1914: checking for long file names" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_sys_long_file_names=yes -# Test for long file names in all the places we know might matter: -# . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: -# /tmp where it might want to write temporary files -# /var/tmp likewise -# /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs="$TMPDIR" -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do - test -d $ac_dir || continue - test -w $ac_dir || continue # It is less confusing to not echo anything here. - (echo 1 > $ac_dir/conftest9012345) 2>/dev/null - (echo 2 > $ac_dir/conftest9012346) 2>/dev/null - val=`cat $ac_dir/conftest9012345 2>/dev/null` - if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then - ac_cv_sys_long_file_names=no - rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null - break - fi - rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null -done -fi - -echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6 -if test $ac_cv_sys_long_file_names = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_LONG_FILE_NAMES 1 -EOF - -fi - - -echo $ac_n "checking for d_ino member in directory struct""... $ac_c" 1>&6 -echo "configure:1959: checking for d_ino member in directory struct" >&5 -if eval "test \"`echo '$''{'patch_cv_sys_d_ino_in_dirent'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if HAVE_DIRENT_H -# include -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -#endif - -int main() { -struct dirent dp; dp.d_ino = 0; -; return 0; } -EOF -if { (eval echo configure:1987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - patch_cv_sys_d_ino_in_dirent=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - patch_cv_sys_d_ino_in_dirent=no -fi -rm -f conftest* -fi - -echo "$ac_t""$patch_cv_sys_d_ino_in_dirent" 1>&6 -if test $patch_cv_sys_d_ino_in_dirent = yes; then - cat >> confdefs.h <<\EOF -#define D_INO_IN_DIRENT 1 -EOF - -fi - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@CC@%$CC%g -s%@CPP@%$CPP%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@SET_MAKE@%$SET_MAKE%g -s%@ed_PROGRAM@%$ed_PROGRAM%g -s%@LIBOBJS@%$LIBOBJS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - Property changes on: vendor/misc-GNU/patch/2.5/configure ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/Makefile.in =================================================================== --- vendor/misc-GNU/patch/2.5/Makefile.in (revision 358868) +++ vendor/misc-GNU/patch/2.5/Makefile.in (nonexistent) @@ -1,158 +0,0 @@ -# Makefile for GNU patch. -# Copyright 1993, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, write to the Free Software Foundation, -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#### Start of system configuration section. #### - -srcdir = @srcdir@ -VPATH = @srcdir@ - -@SET_MAKE@ - -CC = @CC@ -ed_PROGRAM = @ed_PROGRAM@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -transform = @program_transform_name@ - -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -DEFS = @DEFS@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = $(exec_prefix)/bin - -# Where to put the manual pages. -man1dir = $(prefix)/man/man1 -# Extension (including `.') for the manual page filenames. -man1ext = .1 - -# Hook for nonstandard builds. -CONFIG_STATUS = config.status - -#### End of system configuration section. #### - -SHELL = /bin/sh - -LIBSRCS = getopt.c getopt1.c memchr.c rename.c -SRCS = addext.c argmatch.c backupfile.c basename.c inp.c maketime.c \ - partime.c patch.c pch.c quotearg.c util.c version.c $(LIBSRCS) -OBJS = addext.o argmatch.o backupfile.o basename.o inp.o maketime.o \ - partime.o patch.o pch.o quotearg.o util.o version.o $(LIBOBJS) -HDRS = argmatch.h backupfile.h common.h getopt.h \ - inp.h maketime.h partime.h pch.h quotearg.h util.h version.h -MISC = COPYING ChangeLog INSTALL Makefile.in NEWS README \ - acconfig.h config.hin configure configure.in \ - install-sh mkinstalldirs patch.man -DISTFILES = $(MISC) $(SRCS) $(HDRS) -DISTFILES_PC = pc/chdirsaf.c -DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \ - pc/djgpp/configure.bat pc/djgpp/configure.sed - -patch_name = `echo patch | sed '$(transform)'` - -all:: patch - -info:: -check:: -installcheck:: - -COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \ - -I. -I$(srcdir) $(CFLAGS) - -.c.o: - $(COMPILE) $< - -patch: $(OBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) - -install:: all installdirs - $(INSTALL_PROGRAM) patch $(bindir)/$(patch_name) - -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext) - -installdirs:: - $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir) - -install-strip:: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install - -uninstall:: - rm -f $(bindir)/$(patch_name) $(man1dir)/$(patch_name)$(man1ext) - -Makefile: Makefile.in $(CONFIG_STATUS) - $(SHELL) $(CONFIG_STATUS) -config.status: configure - $(SHELL) $(CONFIG_STATUS) --recheck -configure: configure.in - cd $(srcdir) && autoconf -config.hin: configure.in acconfig.h - cd $(srcdir) && rm -f config.hin && autoheader - -patchlevel.h: Makefile - echo '#define PATCH_VERSION "$(VERSION)"' >patchlevel.h - -TAGS: $(HDRS) patchlevel.h $(SRCS) - etags $(HDRS) patchlevel.h $(SRCS) - -clean:: - rm -f patch core* *core *.o - -mostlyclean:: clean - -distclean:: clean - rm -f Makefile config.cache config.log config.status config.h - rm -f patchlevel.h - -maintainer-clean:: - @echo "This command is intended for maintainers to use;" - @echo "rebuilding the deleted files requires special tools." - $(MAKE) distclean - rm -f TAGS - -PV = $(PACKAGE)-$(VERSION) - -dist:: $(DISTFILES) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP) - rm -rf $(PV) - mkdir $(PV) $(PV)/pc $(PV)/pc/djgpp - cp -p $(DISTFILES) $(PV) - cp -p $(DISTFILES_PC) $(PV)/pc - cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp - tar -chf - $(PV) | gzip -9 >$(PV).tar.gz - rm -rf $(PV) - -$(OBJS): config.h -addext.o: backupfile.h -argmatch.o: argmatch.h -backupfile.o: argmatch.h backupfile.h -basename.o: backupfile.h -getopt.o getopt1.o: getopt.h -maketime.o: maketime.h partime.h -inp.o: backupfile.h common.h inp.h pch.h util.h -partime.o: partime.h -patch.o: argmatch.h backupfile.h common.h getopt.h inp.h pch.h util.h version.h -pch.o: common.h inp.h pch.h util.h -quotearg.o: quotearg.h -util.o: backupfile.h common.h maketime.h partime.h quotearg.h util.h version.h -version.o: common.h patchlevel.h util.h version.h Property changes on: vendor/misc-GNU/patch/2.5/Makefile.in ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/pch.c =================================================================== --- vendor/misc-GNU/patch/2.5/pch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/pch.c (nonexistent) @@ -1,1865 +0,0 @@ -/* reading patches */ - -/* $Id: pch.c,v 1.26 1997/07/21 17:59:46 eggert Exp $ */ - -/* -Copyright 1986, 1987, 1988 Larry Wall -Copyright 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#define INITHUNKMAX 125 /* initial dynamic allocation size */ - -/* Patch (diff listing) abstract type. */ - -static FILE *pfp; /* patch file pointer */ -static int p_says_nonexistent[2]; /* [0] for old file, [1] for new; - value is 0 for nonempty, 1 for empty, 2 for nonexistent */ -static int p_rfc934_nesting; /* RFC 934 nesting level */ -static time_t p_timestamp[2]; /* timestamps in patch headers */ -static off_t p_filesize; /* size of the patch file */ -static LINENUM p_first; /* 1st line number */ -static LINENUM p_newfirst; /* 1st line number of replacement */ -static LINENUM p_ptrn_lines; /* # lines in pattern */ -static LINENUM p_repl_lines; /* # lines in replacement text */ -static LINENUM p_end = -1; /* last line in hunk */ -static LINENUM p_max; /* max allowed value of p_end */ -static LINENUM p_prefix_context; /* # of prefix context lines */ -static LINENUM p_suffix_context; /* # of suffix context lines */ -static LINENUM p_input_line; /* current line # from patch file */ -static char **p_line; /* the text of the hunk */ -static size_t *p_len; /* line length including \n if any */ -static char *p_Char; /* +, -, and ! */ -static LINENUM hunkmax = INITHUNKMAX; /* size of above arrays */ -static int p_indent; /* indent to patch */ -static file_offset p_base; /* where to intuit this time */ -static LINENUM p_bline; /* line # of p_base */ -static file_offset p_start; /* where intuit found a patch */ -static LINENUM p_sline; /* and the line number for it */ -static LINENUM p_hunk_beg; /* line number of current hunk */ -static LINENUM p_efake = -1; /* end of faked up lines--don't free */ -static LINENUM p_bfake = -1; /* beg of faked up lines */ - -enum nametype { OLD, NEW, INDEX, NONE }; - -static enum diff intuit_diff_type PARAMS ((void)); -static enum nametype best_name PARAMS ((char * const *, int const *)); -static int prefix_components PARAMS ((char *, int)); -static size_t pget_line PARAMS ((int, int)); -static size_t get_line PARAMS ((void)); -static bool incomplete_line PARAMS ((void)); -static bool grow_hunkmax PARAMS ((void)); -static void malformed PARAMS ((void)) __attribute__ ((noreturn)); -static void next_intuit_at PARAMS ((file_offset, LINENUM)); -static void skip_to PARAMS ((file_offset, LINENUM)); - -/* Prepare to look for the next patch in the patch file. */ - -void -re_patch() -{ - p_first = 0; - p_newfirst = 0; - p_ptrn_lines = 0; - p_repl_lines = 0; - p_end = -1; - p_max = 0; - p_indent = 0; -} - -/* Open the patch file at the beginning of time. */ - -void -open_patch_file(filename) - char const *filename; -{ - file_offset file_pos = 0; - struct stat st; - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -#if HAVE_SETMODE - if (binary_transput) - { - if (isatty (STDIN_FILENO)) - fatal ("cannot read binary data from tty on this platform"); - setmode (STDIN_FILENO, O_BINARY); - } -#endif - if (fstat (STDIN_FILENO, &st) != 0) - pfatal ("fstat"); - if (S_ISREG (st.st_mode) && (stdin_pos = file_tell (stdin)) != -1) - { - pfp = stdin; - file_pos = stdin_pos; - } - else - { - size_t charsread; - pfp = fopen (TMPPATNAME, "w+b"); - if (!pfp) - pfatal ("can't create `%s'", TMPPATNAME); - for (st.st_size = 0; - (charsread = fread (buf, 1, bufsize, stdin)) != 0; - st.st_size += charsread) - if (fwrite (buf, 1, charsread, pfp) != charsread) - write_fatal (); - if (ferror (stdin) || fclose (stdin) != 0) - read_fatal (); - if (fflush (pfp) != 0 - || file_seek (pfp, (file_offset) 0, SEEK_SET) != 0) - write_fatal (); - } - } - else - { - pfp = fopen (filename, binary_transput ? "rb" : "r"); - if (!pfp) - pfatal ("can't open patch file `%s'", filename); - if (fstat (fileno (pfp), &st) != 0) - pfatal ("fstat"); - } - p_filesize = st.st_size; - if (p_filesize != (file_offset) p_filesize) - fatal ("patch file is too long"); - next_intuit_at (file_pos, (LINENUM) 1); - set_hunkmax(); -} - -/* Make sure our dynamically realloced tables are malloced to begin with. */ - -void -set_hunkmax() -{ - if (!p_line) - p_line = (char **) malloc (hunkmax * sizeof *p_line); - if (!p_len) - p_len = (size_t *) malloc (hunkmax * sizeof *p_len); - if (!p_Char) - p_Char = malloc (hunkmax * sizeof *p_Char); -} - -/* Enlarge the arrays containing the current hunk of patch. */ - -static bool -grow_hunkmax() -{ - hunkmax *= 2; - assert (p_line && p_len && p_Char); - if ((p_line = (char **) realloc (p_line, hunkmax * sizeof (*p_line))) - && (p_len = (size_t *) realloc (p_len, hunkmax * sizeof (*p_len))) - && (p_Char = realloc (p_Char, hunkmax * sizeof (*p_Char)))) - return TRUE; - if (!using_plan_a) - memory_fatal (); - /* Don't free previous values of p_line etc., - since some broken implementations free them for us. - Whatever is null will be allocated again from within plan_a (), - of all places. */ - return FALSE; -} - -/* True if the remainder of the patch file contains a diff of some sort. */ - -bool -there_is_another_patch() -{ - if (p_base != 0 && p_base >= p_filesize) { - if (verbosity == VERBOSE) - say ("done\n"); - return FALSE; - } - if (verbosity == VERBOSE) - say ("Hmm..."); - diff_type = intuit_diff_type(); - if (diff_type == NO_DIFF) { - if (verbosity == VERBOSE) - say (p_base - ? " Ignoring the trailing garbage.\ndone\n" - : " I can't seem to find a patch in there anywhere.\n"); - if (! p_base && p_filesize) - fatal ("Only garbage was found in the patch input."); - return FALSE; - } - if (skip_rest_of_patch) - { - Fseek (pfp, p_start, SEEK_SET); - p_input_line = p_sline - 1; - return TRUE; - } - if (verbosity == VERBOSE) - say (" %sooks like %s to me...\n", - (p_base == 0 ? "L" : "The next patch l"), - diff_type == UNI_DIFF ? "a unified diff" : - diff_type == CONTEXT_DIFF ? "a context diff" : - diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : - diff_type == NORMAL_DIFF ? "a normal diff" : - "an ed script" ); - - if (verbosity != SILENT) - { - if (p_indent) - say ("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s"); - if (! inname) - { - say ("can't find file to patch at input line %ld\n", - p_sline); - say (strippath == INT_MAX - ? "Perhaps you should have used the -p or --strip option?\n" - : "Perhaps you used the wrong -p or --strip option?\n"); - } - } - - skip_to(p_start,p_sline); - while (!inname) { - if (force || batch) { - say ("No file to patch. Skipping patch.\n"); - skip_rest_of_patch = TRUE; - return TRUE; - } - ask ("File to patch: "); - inname = fetchname (buf, 0, (time_t *) 0); - if (inname) - { - if (stat (inname, &instat) == 0) - { - inerrno = 0; - invc = -1; - } - else - { - perror (inname); - free (inname); - inname = 0; - } - } - if (!inname) { - ask ("Skip this patch? [y] "); - if (*buf != 'n') { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - return TRUE; - } - } - } - return TRUE; -} - -/* Determine what kind of diff is in the remaining part of the patch file. */ - -static enum diff -intuit_diff_type() -{ - register char *s; - register char *t; - register int indent; - register file_offset this_line = 0; - register file_offset previous_line; - register file_offset first_command_line = -1; - LINENUM fcl_line = 0; /* Pacify `gcc -W'. */ - register bool last_line_was_command = FALSE; - register bool this_is_a_command = FALSE; - register bool stars_last_line = FALSE; - register bool stars_this_line = FALSE; - enum nametype i; - char *name[3]; - struct stat st[3]; - int stat_errno[3]; - int version_controlled[3]; - register enum diff retval; - - name[OLD] = name[NEW] = name[INDEX] = 0; - version_controlled[OLD] = -1; - version_controlled[NEW] = -1; - version_controlled[INDEX] = -1; - p_rfc934_nesting = 0; - p_timestamp[OLD] = p_timestamp[NEW] = (time_t) -1; - p_says_nonexistent[OLD] = p_says_nonexistent[NEW] = 0; - Fseek (pfp, p_base, SEEK_SET); - p_input_line = p_bline - 1; - for (;;) { - previous_line = this_line; - last_line_was_command = this_is_a_command; - stars_last_line = stars_this_line; - this_line = file_tell (pfp); - indent = 0; - if (! pget_line (0, 0)) { - if (first_command_line >= 0) { - /* nothing but deletes!? */ - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - else { - p_start = this_line; - p_sline = p_input_line; - return NO_DIFF; - } - } - for (s = buf; *s == ' ' || *s == '\t' || *s == 'X'; s++) { - if (*s == '\t') - indent = (indent + 8) & ~7; - else - indent++; - } - for (t = s; ISDIGIT (*t) || *t == ','; t++) - continue; - this_is_a_command = (ISDIGIT (*s) && - (*t == 'd' || *t == 'c' || *t == 'a') ); - if (first_command_line < 0 && this_is_a_command) { - first_command_line = this_line; - fcl_line = p_input_line; - p_indent = indent; /* assume this for now */ - } - if (!stars_last_line && strnEQ(s, "*** ", 4)) - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "+++ ", 4)) - /* Swap with NEW below. */ - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "Index:", 6)) - name[INDEX] = fetchname (s+6, strippath, (time_t *) 0); - else if (strnEQ(s, "Prereq:", 7)) { - for (t = s + 7; ISSPACE ((unsigned char) *t); t++) - continue; - revision = t; - for (t = revision; *t && !ISSPACE ((unsigned char) *t); t++) - continue; - if (t == revision) - revision = 0; - else { - char oldc = *t; - *t = '\0'; - revision = savestr (revision); - *t = oldc; - } - } else - { - for (t = s; t[0] == '-' && t[1] == ' '; t += 2) - continue; - if (strnEQ(t, "--- ", 4)) - { - time_t timestamp = (time_t) -1; - name[NEW] = fetchname (t+4, strippath, ×tamp); - if (timestamp != (time_t) -1) - { - p_timestamp[NEW] = timestamp; - p_rfc934_nesting = (t - s) >> 1; - } - } - } - if ((diff_type == NO_DIFF || diff_type == ED_DIFF) && - first_command_line >= 0 && - strEQ(s, ".\n") ) { - p_indent = indent; - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == UNI_DIFF) - && strnEQ(s, "@@ -", 4)) { - - /* `name' and `p_timestamp' are backwards; swap them. */ - time_t ti = p_timestamp[OLD]; - p_timestamp[OLD] = p_timestamp[NEW]; - p_timestamp[NEW] = ti; - t = name[OLD]; - name[OLD] = name[NEW]; - name[NEW] = t; - - s += 4; - if (! atol (s)) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - while (*s != ' ' && *s != '\n') - s++; - while (*s == ' ') - s++; - if (! atol (s)) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - p_indent = indent; - p_start = this_line; - p_sline = p_input_line; - retval = UNI_DIFF; - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW]))) - say ("missing header for unified diff at line %ld of patch\n", - p_sline); - goto scan_exit; - } - stars_this_line = strnEQ(s, "********", 8); - if ((diff_type == NO_DIFF - || diff_type == CONTEXT_DIFF - || diff_type == NEW_CONTEXT_DIFF) - && stars_last_line && strnEQ (s, "*** ", 4)) { - s += 4; - if (! atol (s)) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - /* if this is a new context diff the character just before */ - /* the newline is a '*'. */ - while (*s != '\n') - s++; - p_indent = indent; - p_start = previous_line; - p_sline = p_input_line - 1; - retval = (*(s-1) == '*' ? NEW_CONTEXT_DIFF : CONTEXT_DIFF); - - { - /* Scan the first hunk to see whether the file contents - appear to have been deleted. */ - file_offset saved_p_base = p_base; - LINENUM saved_p_bline = p_bline; - Fseek (pfp, previous_line, SEEK_SET); - p_input_line -= 2; - if (another_hunk (retval, 0) - && ! p_repl_lines && p_newfirst == 1) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - next_intuit_at (saved_p_base, saved_p_bline); - } - - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW]))) - say ("missing header for context diff at line %ld of patch\n", - p_sline); - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == NORMAL_DIFF) && - last_line_was_command && - (strnEQ(s, "< ", 2) || strnEQ(s, "> ", 2)) ) { - p_start = previous_line; - p_sline = p_input_line - 1; - p_indent = indent; - retval = NORMAL_DIFF; - goto scan_exit; - } - } - - scan_exit: - - /* To intuit `inname', the name of the file to patch, - use the algorithm specified by POSIX 1003.2b/D11 section 5.22.7.2 - (with some modifications if posixly_correct is zero): - - - Take the old and new names from the context header if present, - and take the index name from the `Index:' line if present and - if either the old and new names are both absent - or posixly_correct is nonzero. - Consider the file names to be in the order (old, new, index). - - If some named files exist, use the first one if posixly_correct - is nonzero, the best one otherwise. - - If patch_get is nonzero, and no named files exist, - but an RCS or SCCS master file exists, - use the first named file with an RCS or SCCS master. - - If no named files exist, no RCS or SCCS master was found, - some names are given, posixly_correct is zero, - and the patch appears to create a file, then use the best name - requiring the creation of the fewest directories. - - Otherwise, report failure by setting `inname' to 0; - this causes our invoker to ask the user for a file name. */ - - i = NONE; - - if (!inname) - { - enum nametype i0 = NONE; - - if (! posixly_correct && (name[OLD] || name[NEW]) && name[INDEX]) - { - free (name[INDEX]); - name[INDEX] = 0; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - if (i0 != NONE && strcmp (name[i0], name[i]) == 0) - { - /* It's the same name as before; reuse stat results. */ - stat_errno[i] = stat_errno[i0]; - if (! stat_errno[i]) - st[i] = st[i0]; - } - else if (stat (name[i], &st[i]) != 0) - stat_errno[i] = errno; - else - { - stat_errno[i] = 0; - if (posixly_correct) - break; - } - i0 = i; - } - - if (! posixly_correct) - { - i = best_name (name, stat_errno); - - if (i == NONE && patch_get) - { - enum nametype nope = NONE; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - char const *cs; - char *getbuf; - char *diffbuf; - int readonly = outfile && strcmp (outfile, name[i]) != 0; - - if (nope == NONE || strcmp (name[nope], name[i]) != 0) - { - cs = (version_controller - (name[i], readonly, (struct stat *) 0, - &getbuf, &diffbuf)); - version_controlled[i] = !! cs; - if (cs) - { - if (version_get (name[i], cs, 0, readonly, - getbuf, &st[i])) - stat_errno[i] = 0; - else - version_controlled[i] = 0; - - free (getbuf); - free (diffbuf); - - if (! stat_errno[i]) - break; - } - } - - nope = i; - } - } - - if (p_says_nonexistent[reverse ^ (i == NONE || st[i].st_size == 0)]) - { - assert (i0 != NONE); - if (ok_to_reverse - ("The next patch%s would %s the file `%s',\nwhich %s!", - reverse ? ", when reversed," : "", - (i == NONE ? "delete" - : st[i].st_size == 0 ? "empty out" - : "create"), - name[i == NONE || st[i].st_size == 0 ? i0 : i], - (i == NONE ? "does not exist" - : st[i].st_size == 0 ? "is already empty" - : "already exists"))) - reverse ^= 1; - } - - if (i == NONE && p_says_nonexistent[reverse]) - { - int newdirs[3]; - int newdirs_min = INT_MAX; - int distance_from_minimum[3]; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - newdirs[i] = (prefix_components (name[i], 0) - - prefix_components (name[i], 1)); - if (newdirs[i] < newdirs_min) - newdirs_min = newdirs[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - distance_from_minimum[i] = newdirs[i] - newdirs_min; - - i = best_name (name, distance_from_minimum); - } - } - } - - if (i == NONE) - inerrno = -1; - else - { - inname = name[i]; - name[i] = 0; - inerrno = stat_errno[i]; - invc = version_controlled[i]; - instat = st[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - free (name[i]); - - return retval; -} - -/* Count the path name components in FILENAME's prefix. - If CHECKDIRS is nonzero, count only existing directories. */ -static int -prefix_components (filename, checkdirs) - char *filename; - int checkdirs; -{ - int count = 0; - struct stat stat_buf; - int stat_result; - char *f = filename + FILESYSTEM_PREFIX_LEN (filename); - - if (*f) - while (*++f) - if (ISSLASH (f[0]) && ! ISSLASH (f[-1])) - { - if (checkdirs) - { - *f = '\0'; - stat_result = stat (filename, &stat_buf); - *f = '/'; - if (! (stat_result == 0 && S_ISDIR (stat_buf.st_mode))) - break; - } - - count++; - } - - return count; -} - -/* Return the index of the best of NAME[OLD], NAME[NEW], and NAME[INDEX]. - Ignore null names, and ignore NAME[i] if IGNORE[i] is nonzero. - Return NONE if all names are ignored. */ -static enum nametype -best_name (name, ignore) - char *const *name; - int const *ignore; -{ - enum nametype i; - int components[3]; - int components_min = INT_MAX; - size_t basename_len[3]; - size_t basename_len_min = (size_t) -1; - size_t len[3]; - size_t len_min = (size_t) -1; - - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i]) - { - /* Take the names with the fewest prefix components. */ - components[i] = prefix_components (name[i], 0); - if (components_min < components[i]) - continue; - components_min = components[i]; - - /* Of those, take the names with the shortest basename. */ - basename_len[i] = strlen (base_name (name[i])); - if (basename_len_min < basename_len[i]) - continue; - basename_len_min = basename_len[i]; - - /* Of those, take the shortest names. */ - len[i] = strlen (name[i]); - if (len_min < len[i]) - continue; - len_min = len[i]; - } - - /* Of those, take the first name. */ - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i] - && components[i] == components_min - && basename_len[i] == basename_len_min - && len[i] == len_min) - break; - - return i; -} - -/* Remember where this patch ends so we know where to start up again. */ - -static void -next_intuit_at(file_pos,file_line) -file_offset file_pos; -LINENUM file_line; -{ - p_base = file_pos; - p_bline = file_line; -} - -/* Basically a verbose fseek() to the actual diff listing. */ - -static void -skip_to(file_pos,file_line) -file_offset file_pos; -LINENUM file_line; -{ - register FILE *i = pfp; - register FILE *o = stdout; - register int c; - - assert(p_base <= file_pos); - if ((verbosity == VERBOSE || !inname) && p_base < file_pos) { - Fseek (i, p_base, SEEK_SET); - say ("The text leading up to this was:\n--------------------------\n"); - - while (file_tell (i) < file_pos) - { - putc ('|', o); - do - { - if ((c = getc (i)) == EOF) - read_fatal (); - putc (c, o); - } - while (c != '\n'); - } - - say ("--------------------------\n"); - } - else - Fseek (i, file_pos, SEEK_SET); - p_input_line = file_line - 1; -} - -/* Make this a function for better debugging. */ -static void -malformed () -{ - fatal ("malformed patch at line %ld: %s", p_input_line, buf); - /* about as informative as "Syntax error" in C */ -} - -/* 1 if there is more of the current diff listing to process; - 0 if not; -1 if ran out of memory. */ - -int -another_hunk (difftype, rev) - enum diff difftype; - int rev; -{ - register char *s; - register LINENUM context = 0; - register size_t chars_read; - - while (p_end >= 0) { - if (p_end == p_efake) - p_end = p_bfake; /* don't free twice */ - else - free(p_line[p_end]); - p_end--; - } - assert(p_end == -1); - p_efake = -1; - - p_max = hunkmax; /* gets reduced when --- found */ - if (difftype == CONTEXT_DIFF || difftype == NEW_CONTEXT_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - LINENUM repl_beginning = 0; /* index of --- line */ - register LINENUM fillcnt = 0; /* #lines of missing ptrn or repl */ - register LINENUM fillsrc; /* index of first line to copy */ - register LINENUM filldst; /* index of first missing line */ - bool ptrn_spaces_eaten = FALSE; /* ptrn was slightly misformed */ - bool some_context = FALSE; /* (perhaps internal) context seen */ - register bool repl_could_be_missing = TRUE; - bool repl_missing = FALSE; /* we are now backtracking */ - file_offset repl_backtrack_position = 0; - /* file pos of first repl line */ - LINENUM repl_patch_line; /* input line number for same */ - LINENUM repl_context; /* context for same */ - LINENUM ptrn_prefix_context = -1; /* lines in pattern prefix context */ - LINENUM ptrn_suffix_context = -1; /* lines in pattern suffix context */ - LINENUM repl_prefix_context = -1; /* lines in replac. prefix context */ - register LINENUM ptrn_copiable = 0; - /* # of copiable lines in ptrn */ - - /* Pacify `gcc -Wall'. */ - fillsrc = filldst = repl_patch_line = repl_context = 0; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 8 - || strncmp (buf, "********", 8) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_hunk_beg = p_input_line + 1; - while (p_end < p_max) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - return -1; - if (!chars_read) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - if (p_max - p_end < 4) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 3; - } else { - fatal ("unexpected end of file in patch"); - } - } - p_end++; - if (p_end == hunkmax) - fatal ("unterminated hunk starting at line %ld; giving up at line %ld: %s", - pch_hunk_beg (), p_input_line, buf); - assert(p_end < hunkmax); - p_Char[p_end] = *buf; - p_len[p_end] = 0; - p_line[p_end] = 0; - switch (*buf) { - case '*': - if (strnEQ(buf, "********", 8)) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - else - fatal ("unexpected end of hunk at line %ld", - p_input_line); - } - if (p_end != 0) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - fatal ("unexpected `***' at line %ld: %s", - p_input_line, buf); - } - context = 0; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) { - p_end--; - return -1; - } - for (s = buf; *s && !ISDIGIT (*s); s++) - continue; - if (!*s) - malformed (); - if (strnEQ(s,"0,0",3)) - remove_prefix (s, 2); - p_first = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - while (*s && !ISDIGIT (*s)) - s++; - if (!*s) - malformed (); - p_ptrn_lines = ((LINENUM)atol(s)) - p_first + 1; - } - else if (p_first) - p_ptrn_lines = 1; - else { - p_ptrn_lines = 0; - p_first = 1; - } - p_max = p_ptrn_lines + 6; /* we need this much at least */ - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - p_max = hunkmax; - break; - case '-': - if (buf[1] != '-') - goto change_line; - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - ptrn_suffix_context = context; - if (repl_beginning - || (p_end - != p_ptrn_lines + 1 + (p_Char[p_end - 1] == '\n'))) - { - if (p_end == 1) - { - /* `Old' lines were omitted. Set up to fill - them in from `new' context lines. */ - p_end = p_ptrn_lines + 1; - ptrn_prefix_context = ptrn_suffix_context = -1; - fillsrc = p_end + 1; - filldst = 1; - fillcnt = p_ptrn_lines; - } - else if (! repl_beginning) - fatal ("%s `---' at line %ld; check line numbers at line %ld", - (p_end <= p_ptrn_lines - ? "Premature" - : "Overdue"), - p_input_line, p_hunk_beg); - else if (! repl_could_be_missing) - fatal ("duplicate `---' at line %ld; check line numbers at line %ld", - p_input_line, p_hunk_beg + repl_beginning); - else - { - repl_missing = TRUE; - goto hunk_done; - } - } - repl_beginning = p_end; - repl_backtrack_position = file_tell (pfp); - repl_patch_line = p_input_line; - repl_context = context; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) - { - p_end--; - return -1; - } - p_Char[p_end] = '='; - for (s = buf; *s && ! ISDIGIT (*s); s++) - continue; - if (!*s) - malformed (); - p_newfirst = (LINENUM) atol (s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') - { - do - { - if (!*++s) - malformed (); - } - while (! ISDIGIT (*s)); - p_repl_lines = (LINENUM) atol (s) - p_newfirst + 1; - } - else if (p_newfirst) - p_repl_lines = 1; - else - { - p_repl_lines = 0; - p_newfirst = 1; - } - p_max = p_repl_lines + p_end; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - if (p_repl_lines != ptrn_copiable - && (p_prefix_context != 0 - || context != 0 - || p_repl_lines != 1)) - repl_could_be_missing = FALSE; - context = 0; - break; - case '+': case '!': - repl_could_be_missing = FALSE; - change_line: - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, " \n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - if (! repl_beginning) - { - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - } - else - { - if (repl_prefix_context == -1) - repl_prefix_context = context; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (s, chars_read))) { - p_end--; - return -1; - } - context = 0; - break; - case '\t': case '\n': /* assume spaces got eaten */ - s = buf; - if (*buf == '\t') { - s++; - chars_read--; - } - if (repl_beginning && repl_could_be_missing && - (!ptrn_spaces_eaten || difftype == NEW_CONTEXT_DIFF) ) { - repl_missing = TRUE; - goto hunk_done; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf, chars_read))) { - p_end--; - return -1; - } - if (p_end != p_ptrn_lines + 1) { - ptrn_spaces_eaten |= (repl_beginning != 0); - some_context = TRUE; - context++; - if (!repl_beginning) - ptrn_copiable++; - p_Char[p_end] = ' '; - } - break; - case ' ': - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, "\n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - some_context = TRUE; - context++; - if (!repl_beginning) - ptrn_copiable++; - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf + 2, chars_read))) { - p_end--; - return -1; - } - break; - default: - if (repl_beginning && repl_could_be_missing) { - repl_missing = TRUE; - goto hunk_done; - } - malformed (); - } - } - - hunk_done: - if (p_end >=0 && !repl_beginning) - fatal ("no `---' found in patch at line %ld", pch_hunk_beg ()); - - if (repl_missing) { - - /* reset state back to just after --- */ - p_input_line = repl_patch_line; - context = repl_context; - for (p_end--; p_end > repl_beginning; p_end--) - free(p_line[p_end]); - Fseek (pfp, repl_backtrack_position, SEEK_SET); - - /* redundant 'new' context lines were omitted - set */ - /* up to fill them in from the old file context */ - fillsrc = 1; - filldst = repl_beginning+1; - fillcnt = p_repl_lines; - p_end = p_max; - } - else if (!some_context && fillcnt == 1) { - /* the first hunk was a null hunk with no context */ - /* and we were expecting one line -- fix it up. */ - while (filldst < p_end) { - p_line[filldst] = p_line[filldst+1]; - p_Char[filldst] = p_Char[filldst+1]; - p_len[filldst] = p_len[filldst+1]; - filldst++; - } -#if 0 - repl_beginning--; /* this doesn't need to be fixed */ -#endif - p_end--; - p_first++; /* do append rather than insert */ - fillcnt = 0; - p_ptrn_lines = 0; - } - - p_prefix_context = ((repl_prefix_context == -1 - || (ptrn_prefix_context != -1 - && ptrn_prefix_context < repl_prefix_context)) - ? ptrn_prefix_context : repl_prefix_context); - p_suffix_context = ((ptrn_suffix_context != -1 - && ptrn_suffix_context < context) - ? ptrn_suffix_context : context); - assert (p_prefix_context != -1 && p_suffix_context != -1); - - if (difftype == CONTEXT_DIFF - && (fillcnt - || (p_first > 1 - && p_prefix_context + p_suffix_context < ptrn_copiable))) { - if (verbosity == VERBOSE) - say ("%s\n%s\n%s\n", -"(Fascinating -- this is really a new-style context diff but without", -"the telltale extra asterisks on the *** line that usually indicate", -"the new style...)"); - diff_type = difftype = NEW_CONTEXT_DIFF; - } - - /* if there were omitted context lines, fill them in now */ - if (fillcnt) { - p_bfake = filldst; /* remember where not to free() */ - p_efake = filldst + fillcnt - 1; - while (fillcnt-- > 0) { - while (fillsrc <= p_end && fillsrc != repl_beginning - && p_Char[fillsrc] != ' ') - fillsrc++; - if (p_end < fillsrc || fillsrc == repl_beginning) - fatal ("replacement text or line numbers mangled in hunk at line %ld", - p_hunk_beg); - p_line[filldst] = p_line[fillsrc]; - p_Char[filldst] = p_Char[fillsrc]; - p_len[filldst] = p_len[fillsrc]; - fillsrc++; filldst++; - } - while (fillsrc <= p_end && fillsrc != repl_beginning) - { - if (p_Char[fillsrc] == ' ') - fatal ("replacement text or line numbers mangled in hunk at line %ld", - p_hunk_beg); - fillsrc++; - } - if (debug & 64) - printf("fillsrc %ld, filldst %ld, rb %ld, e+1 %ld\n", - fillsrc,filldst,repl_beginning,p_end+1); - assert(fillsrc==p_end+1 || fillsrc==repl_beginning); - assert(filldst==p_end+1 || filldst==repl_beginning); - } - } - else if (difftype == UNI_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - register LINENUM fillsrc; /* index of old lines */ - register LINENUM filldst; /* index of new lines */ - char ch = '\0'; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 4 - || strncmp (buf, "@@ -", 4) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = buf+4; - if (!*s) - malformed (); - p_first = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - p_ptrn_lines = (LINENUM) atol(++s); - while (ISDIGIT (*s)) - s++; - } else - p_ptrn_lines = 1; - if (*s == ' ') s++; - if (*s != '+' || !*++s) - malformed (); - p_newfirst = (LINENUM) atol(s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') { - p_repl_lines = (LINENUM) atol(++s); - while (ISDIGIT (*s)) - s++; - } else - p_repl_lines = 1; - if (*s == ' ') s++; - if (*s != '@') - malformed (); - if (!p_ptrn_lines) - p_first++; /* do append rather than insert */ - if (!p_repl_lines) - p_newfirst++; - p_max = p_ptrn_lines + p_repl_lines + 1; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - fillsrc = 1; - filldst = fillsrc + p_ptrn_lines; - p_end = filldst + p_repl_lines; - sprintf (buf,"*** %ld,%ld ****\n",p_first,p_first + p_ptrn_lines - 1); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - sprintf (buf,"--- %ld,%ld ----\n",p_newfirst,p_newfirst+p_repl_lines-1); - p_len[filldst] = strlen (buf); - if (! (p_line[filldst] = savestr (buf))) { - p_end = 0; - return -1; - } - p_Char[filldst++] = '='; - p_prefix_context = -1; - p_hunk_beg = p_input_line + 1; - while (fillsrc <= p_ptrn_lines || filldst <= p_end) { - chars_read = get_line (); - if (!chars_read) { - if (p_max - filldst < 3) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 2; - } else { - fatal ("unexpected end of file in patch"); - } - } - if (chars_read == (size_t) -1) - s = 0; - else if (*buf == '\t' || *buf == '\n') { - ch = ' '; /* assume the space got eaten */ - s = savebuf (buf, chars_read); - } - else { - ch = *buf; - s = savebuf (buf+1, --chars_read); - } - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - switch (ch) { - case '-': - if (fillsrc > p_ptrn_lines) { - free(s); - p_end = filldst-1; - malformed (); - } - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - break; - case '=': - ch = ' '; - /* FALL THROUGH */ - case ' ': - if (fillsrc > p_ptrn_lines) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - context++; - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - s = savebuf (s, chars_read); - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - /* FALL THROUGH */ - case '+': - if (filldst > p_end) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - chars_read -= filldst == p_end && incomplete_line (); - p_Char[filldst] = ch; - p_line[filldst] = s; - p_len[filldst++] = chars_read; - break; - default: - p_end = filldst; - malformed (); - } - if (ch != ' ') { - if (p_prefix_context == -1) - p_prefix_context = context; - context = 0; - } - }/* while */ - if (p_prefix_context == -1) - malformed (); - p_suffix_context = context; - } - else { /* normal diff--fake it up */ - char hunk_type; - register int i; - LINENUM min, max; - file_offset line_beginning = file_tell (pfp); - - p_prefix_context = p_suffix_context = 0; - chars_read = get_line (); - if (chars_read == (size_t) -1 || !chars_read || !ISDIGIT (*buf)) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_first = (LINENUM)atol(buf); - for (s = buf; ISDIGIT (*s); s++) - continue; - if (*s == ',') { - p_ptrn_lines = (LINENUM)atol(++s) - p_first + 1; - while (ISDIGIT (*s)) - s++; - } - else - p_ptrn_lines = (*s != 'a'); - hunk_type = *s; - if (hunk_type == 'a') - p_first++; /* do append rather than insert */ - min = (LINENUM)atol(++s); - while (ISDIGIT (*s)) - s++; - if (*s == ',') - max = (LINENUM)atol(++s); - else - max = min; - if (hunk_type == 'd') - min++; - p_end = p_ptrn_lines + 1 + max - min + 1; - while (p_end >= hunkmax) - if (! grow_hunkmax ()) - { - p_end = -1; - return -1; - } - p_newfirst = min; - p_repl_lines = max - min + 1; - sprintf (buf, "*** %ld,%ld\n", p_first, p_first + p_ptrn_lines - 1); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - for (i=1; i<=p_ptrn_lines; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (buf[0] != '<' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`<' expected at line %ld of patch", p_input_line); - chars_read -= 2 + (i == p_ptrn_lines && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '-'; - } - if (hunk_type == 'c') { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (! chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (*buf != '-') - fatal ("`---' expected at line %ld of patch", p_input_line); - } - sprintf (buf, "--- %ld,%ld\n", min, max); - p_len[i] = strlen (buf); - if (! (p_line[i] = savestr (buf))) { - p_end = i-1; - return -1; - } - p_Char[i] = '='; - for (i++; i<=p_end; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %ld", - p_input_line); - if (buf[0] != '>' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`>' expected at line %ld of patch", p_input_line); - chars_read -= 2 + (i == p_end && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '+'; - } - } - if (rev) /* backwards patch? */ - if (!pch_swap()) - say ("Not enough memory to swap next hunk!\n"); - if (debug & 2) { - LINENUM i; - char special; - - for (i=0; i <= p_end; i++) { - if (i == p_ptrn_lines) - special = '^'; - else - special = ' '; - fprintf (stderr, "%3ld %c %c ", i, p_Char[i], special); - pch_write_line (i, stderr); - fflush (stderr); - } - } - if (p_end+1 < hunkmax) /* paranoia reigns supreme... */ - p_Char[p_end+1] = '^'; /* add a stopper for apply_hunk */ - return 1; -} - -static size_t -get_line () -{ - return pget_line (p_indent, p_rfc934_nesting); -} - -/* Input a line from the patch file, worrying about indentation. - Strip up to INDENT characters' worth of leading indentation. - Then remove up to RFC934_NESTING instances of leading "- ". - Ignore any partial lines at end of input, but warn about them. - Succeed if a line was read; it is terminated by "\n\0" for convenience. - Return the number of characters read, including '\n' but not '\0'. - Return -1 if we ran out of memory. */ - -static size_t -pget_line (indent, rfc934_nesting) - int indent; - int rfc934_nesting; -{ - register FILE *fp = pfp; - register int c; - register int i = 0; - register char *b; - register size_t s; - - for (;;) - { - c = getc (fp); - if (c == EOF) - { - if (ferror (fp)) - read_fatal (); - return 0; - } - if (indent <= i) - break; - if (c == ' ' || c == 'X') - i++; - else if (c == '\t') - i = (i + 8) & ~7; - else - break; - } - - i = 0; - b = buf; - - while (c == '-' && 0 <= --rfc934_nesting) - { - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - if (c != ' ') - { - i = 1; - b[0] = '-'; - break; - } - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - s = bufsize; - - for (;;) - { - if (i == s - 1) - { - s *= 2; - b = realloc (b, s); - if (!b) - { - if (!using_plan_a) - memory_fatal (); - return (size_t) -1; - } - buf = b; - bufsize = s; - } - b[i++] = c; - if (c == '\n') - break; - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - b[i] = '\0'; - p_input_line++; - return i; - - patch_ends_in_middle_of_line: - if (ferror (fp)) - read_fatal (); - say ("patch unexpectedly ends in middle of line\n"); - return 0; -} - -static bool -incomplete_line () -{ - register FILE *fp = pfp; - register int c; - register file_offset line_beginning = file_tell (fp); - - if (getc (fp) == '\\') - { - while ((c = getc (fp)) != '\n' && c != EOF) - continue; - return TRUE; - } - else - { - /* We don't trust ungetc. */ - Fseek (pfp, line_beginning, SEEK_SET); - return FALSE; - } -} - -/* Reverse the old and new portions of the current hunk. */ - -bool -pch_swap() -{ - char **tp_line; /* the text of the hunk */ - size_t *tp_len; /* length of each line */ - char *tp_char; /* +, -, and ! */ - register LINENUM i; - register LINENUM n; - bool blankline = FALSE; - register char *s; - - i = p_first; - p_first = p_newfirst; - p_newfirst = i; - - /* make a scratch copy */ - - tp_line = p_line; - tp_len = p_len; - tp_char = p_Char; - p_line = 0; /* force set_hunkmax to allocate again */ - p_len = 0; - p_Char = 0; - set_hunkmax(); - if (!p_line || !p_len || !p_Char) { - if (p_line) - free (p_line); - p_line = tp_line; - if (p_len) - free (p_len); - p_len = tp_len; - if (p_Char) - free (p_Char); - p_Char = tp_char; - return FALSE; /* not enough memory to swap hunk! */ - } - - /* now turn the new into the old */ - - i = p_ptrn_lines + 1; - if (tp_char[i] == '\n') { /* account for possible blank line */ - blankline = TRUE; - i++; - } - if (p_efake >= 0) { /* fix non-freeable ptr range */ - if (p_efake <= i) - n = p_end - i + 1; - else - n = -i; - p_efake += n; - p_bfake += n; - } - for (n=0; i <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '+') - p_Char[n] = '-'; - p_len[n] = tp_len[i]; - } - if (blankline) { - i = p_ptrn_lines + 1; - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - p_len[n] = tp_len[i]; - n++; - } - assert(p_Char[0] == '='); - p_Char[0] = '*'; - for (s=p_line[0]; *s; s++) - if (*s == '-') - *s = '*'; - - /* now turn the old into the new */ - - assert(tp_char[0] == '*'); - tp_char[0] = '='; - for (s=tp_line[0]; *s; s++) - if (*s == '*') - *s = '-'; - for (i=0; n <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '-') - p_Char[n] = '+'; - p_len[n] = tp_len[i]; - } - assert(i == p_ptrn_lines + 1); - i = p_ptrn_lines; - p_ptrn_lines = p_repl_lines; - p_repl_lines = i; - if (tp_line) - free (tp_line); - if (tp_len) - free (tp_len); - if (tp_char) - free (tp_char); - return TRUE; -} - -/* Return whether file WHICH (0 = old, 1 = new) appears to nonexistent. - Return 1 for empty, 2 for nonexistent. */ - -bool -pch_says_nonexistent (which) - int which; -{ - return p_says_nonexistent[which]; -} - -/* Return timestamp of patch header for file WHICH (0 = old, 1 = new), - or -1 if there was no timestamp or an error in the timestamp. */ - -time_t -pch_timestamp (which) - int which; -{ - return p_timestamp[which]; -} - -/* Return the specified line position in the old file of the old context. */ - -LINENUM -pch_first() -{ - return p_first; -} - -/* Return the number of lines of old context. */ - -LINENUM -pch_ptrn_lines() -{ - return p_ptrn_lines; -} - -/* Return the probable line position in the new file of the first line. */ - -LINENUM -pch_newfirst() -{ - return p_newfirst; -} - -/* Return the number of lines in the replacement text including context. */ - -LINENUM -pch_repl_lines() -{ - return p_repl_lines; -} - -/* Return the number of lines in the whole hunk. */ - -LINENUM -pch_end() -{ - return p_end; -} - -/* Return the number of context lines before the first changed line. */ - -LINENUM -pch_prefix_context () -{ - return p_prefix_context; -} - -/* Return the number of context lines after the last changed line. */ - -LINENUM -pch_suffix_context () -{ - return p_suffix_context; -} - -/* Return the length of a particular patch line. */ - -size_t -pch_line_len(line) -LINENUM line; -{ - return p_len[line]; -} - -/* Return the control character (+, -, *, !, etc) for a patch line. */ - -char -pch_char(line) -LINENUM line; -{ - return p_Char[line]; -} - -/* Return a pointer to a particular patch line. */ - -char * -pfetch(line) -LINENUM line; -{ - return p_line[line]; -} - -/* Output a patch line. */ - -bool -pch_write_line (line, file) - LINENUM line; - FILE *file; -{ - bool after_newline = p_line[line][p_len[line] - 1] == '\n'; - if (! fwrite (p_line[line], sizeof (*p_line[line]), p_len[line], file)) - write_fatal (); - return after_newline; -} - -/* Return where in the patch file this hunk began, for error messages. */ - -LINENUM -pch_hunk_beg() -{ - return p_hunk_beg; -} - -/* Apply an ed script by feeding ed itself. */ - -void -do_ed_script (ofp) - FILE *ofp; -{ - static char const ed_program[] = ed_PROGRAM; - - register char *t; - register file_offset beginning_of_this_line; - register bool this_line_is_command = FALSE; - register FILE *pipefp = 0; - register size_t chars_read; - - if (!skip_rest_of_patch) { - assert (! inerrno); - copy_file (inname, TMPOUTNAME, instat.st_mode); - sprintf (buf, "%s %s%s", ed_program, verbosity == VERBOSE ? "" : "- ", - TMPOUTNAME); - fflush (stdout); - pipefp = popen(buf, binary_transput ? "wb" : "w"); - if (!pipefp) - pfatal ("can't open pipe to `%s'", buf); - } - for (;;) { - beginning_of_this_line = file_tell (pfp); - chars_read = get_line (); - if (! chars_read) { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - for (t = buf; ISDIGIT (*t) || *t == ','; t++) - continue; - this_line_is_command = (ISDIGIT (*buf) && - (*t == 'd' || *t == 'c' || *t == 'a' || *t == 'i' || *t == 's') ); - if (this_line_is_command) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (*t != 'd' && *t != 's') { - while ((chars_read = get_line ()) != 0) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (chars_read == 2 && strEQ (buf, ".\n")) - break; - } - } - } - else { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - } - if (!pipefp) - return; - if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0 - || fflush (pipefp) != 0) - write_fatal (); - if (pclose (pipefp) != 0) - fatal ("%s FAILED", ed_program); - - if (ofp) - { - FILE *ifp = fopen (TMPOUTNAME, binary_transput ? "rb" : "r"); - int c; - if (!ifp) - pfatal ("can't open `%s'", TMPOUTNAME); - while ((c = getc (ifp)) != EOF) - if (putc (c, ofp) == EOF) - write_fatal (); - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - } -} Property changes on: vendor/misc-GNU/patch/2.5/pch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/acconfig.h =================================================================== --- vendor/misc-GNU/patch/2.5/acconfig.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/acconfig.h (nonexistent) @@ -1,14 +0,0 @@ -/* Local acconfig.h for autoheader. - Descriptive text for the C preprocessor macros that - the patch configure.in can define. - autoheader copies the comments into config.hin. */ - -/* Define if there is a member named d_ino in the struct describing - directory headers. */ -#undef D_INO_IN_DIRENT - -/* Define if memchr works. */ -#undef HAVE_MEMCHR - -/* Define if `struct utimbuf' is declared -- usually in . */ -#undef HAVE_STRUCT_UTIMBUF Property changes on: vendor/misc-GNU/patch/2.5/acconfig.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/INSTALL =================================================================== --- vendor/misc-GNU/patch/2.5/INSTALL (revision 358868) +++ vendor/misc-GNU/patch/2.5/INSTALL (nonexistent) @@ -1,183 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. - Property changes on: vendor/misc-GNU/patch/2.5/INSTALL ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/pch.h =================================================================== --- vendor/misc-GNU/patch/2.5/pch.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/pch.h (nonexistent) @@ -1,25 +0,0 @@ -/* reading patches */ - -/* $Id: pch.h,v 1.8 1997/06/13 06:28:37 eggert Exp $ */ - -LINENUM pch_end PARAMS ((void)); -LINENUM pch_first PARAMS ((void)); -LINENUM pch_hunk_beg PARAMS ((void)); -LINENUM pch_newfirst PARAMS ((void)); -LINENUM pch_prefix_context PARAMS ((void)); -LINENUM pch_ptrn_lines PARAMS ((void)); -LINENUM pch_repl_lines PARAMS ((void)); -LINENUM pch_suffix_context PARAMS ((void)); -bool pch_swap PARAMS ((void)); -bool pch_write_line PARAMS ((LINENUM, FILE *)); -bool there_is_another_patch PARAMS ((void)); -char *pfetch PARAMS ((LINENUM)); -char pch_char PARAMS ((LINENUM)); -int another_hunk PARAMS ((enum diff, int)); -int pch_says_nonexistent PARAMS ((int)); -size_t pch_line_len PARAMS ((LINENUM)); -time_t pch_timestamp PARAMS ((int)); -void do_ed_script PARAMS ((FILE *)); -void open_patch_file PARAMS ((char const *)); -void re_patch PARAMS ((void)); -void set_hunkmax PARAMS ((void)); Property changes on: vendor/misc-GNU/patch/2.5/pch.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/basename.c =================================================================== --- vendor/misc-GNU/patch/2.5/basename.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/basename.c (nonexistent) @@ -1,32 +0,0 @@ -/* basename.c -- return the last element in a path */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#ifndef FILESYSTEM_PREFIX_LEN -#define FILESYSTEM_PREFIX_LEN(f) 0 -#endif - -#ifndef ISSLASH -#define ISSLASH(c) ((c) == '/') -#endif - -/* In general, we can't use the builtin `basename' function if available, - since it has different meanings in different environments. - In some environments the builtin `basename' modifies its argument. */ - -char * -base_name (name) - char const *name; -{ - char const *base = name += FILESYSTEM_PREFIX_LEN (name); - - for (; *name; name++) - if (ISSLASH (*name)) - base = name + 1; - - return (char *) base; -} Property changes on: vendor/misc-GNU/patch/2.5/basename.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/config.hin =================================================================== --- vendor/misc-GNU/patch/2.5/config.hin (revision 358868) +++ vendor/misc-GNU/patch/2.5/config.hin (nonexistent) @@ -1,124 +0,0 @@ -/* config.hin. Generated automatically from configure.in by autoheader. */ - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif - -/* Define if the closedir function returns void instead of int. */ -#undef CLOSEDIR_VOID - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define if you don't have vprintf but do have _doprnt. */ -#undef HAVE_DOPRNT - -/* Define if you support file names longer than 14 characters. */ -#undef HAVE_LONG_FILE_NAMES - -/* Define if you have the vprintf function. */ -#undef HAVE_VPRINTF - -/* Define if on MINIX. */ -#undef _MINIX - -/* Define to `int' if doesn't define. */ -#undef mode_t - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -#undef _POSIX_1_SOURCE - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if there is a member named d_ino in the struct describing - directory headers. */ -#undef D_INO_IN_DIRENT - -/* Define if memchr works. */ -#undef HAVE_MEMCHR - -/* Define if `struct utimbuf' is declared -- usually in . */ -#undef HAVE_STRUCT_UTIMBUF - -/* Define if you have the _doprintf function. */ -#undef HAVE__DOPRINTF - -/* Define if you have the isascii function. */ -#undef HAVE_ISASCII - -/* Define if you have the memchr function. */ -#undef HAVE_MEMCHR - -/* Define if you have the memcmp function. */ -#undef HAVE_MEMCMP - -/* Define if you have the mkdir function. */ -#undef HAVE_MKDIR - -/* Define if you have the mktemp function. */ -#undef HAVE_MKTEMP - -/* Define if you have the pathconf function. */ -#undef HAVE_PATHCONF - -/* Define if you have the raise function. */ -#undef HAVE_RAISE - -/* Define if you have the rename function. */ -#undef HAVE_RENAME - -/* Define if you have the sigaction function. */ -#undef HAVE_SIGACTION - -/* Define if you have the sigprocmask function. */ -#undef HAVE_SIGPROCMASK - -/* Define if you have the sigsetmask function. */ -#undef HAVE_SIGSETMASK - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define if you have the header file. */ -#undef HAVE_VARARGS_H Property changes on: vendor/misc-GNU/patch/2.5/config.hin ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/version.c =================================================================== --- vendor/misc-GNU/patch/2.5/version.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/version.c (nonexistent) @@ -1,30 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.c,v 1.5 1997/05/21 18:29:20 eggert Exp $ */ - -#define XTERN extern -#include -#undef XTERN -#define XTERN -#include -#include - -static char const copyright_string[] = "\ -Copyright 1988 Larry Wall\n\ -Copyright 1997 Free Software Foundation, Inc."; - -static char const free_software_msgid[] = "\ -This program comes with NO WARRANTY, to the extent permitted by law.\n\ -You may redistribute copies of this program\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the file named COPYING."; - -static char const authorship_msgid[] = "\ -written by Larry Wall with lots o' patches by Paul Eggert"; - -void -version() -{ - printf ("%s %s\n%s\n\n%s\n\n%s\n", program_name, PATCH_VERSION, - copyright_string, free_software_msgid, authorship_msgid); -} Property changes on: vendor/misc-GNU/patch/2.5/version.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/configure.in =================================================================== --- vendor/misc-GNU/patch/2.5/configure.in (revision 358868) +++ vendor/misc-GNU/patch/2.5/configure.in (nonexistent) @@ -1,134 +0,0 @@ -# Configure `patch'. -# Copyright 1993, 1997 Free Software Foundation, Inc. -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.12) -AC_INIT(patch.c) -AC_CONFIG_HEADER(config.h:config.hin) -AC_ARG_PROGRAM - -PACKAGE=patch -VERSION=2.5 -AC_SUBST(PACKAGE) -AC_SUBST(VERSION) - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_MAKE_SET -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -AC_PATH_PROG(ed_PROGRAM, ed, ed) - -# If available, prefer support for large files unless the user specified -# one of the CPPFLAGS, LDFLAGS, or LIBS variables. -AC_MSG_CHECKING(whether large file support needs explicit enabling) -ac_getconfs='' -ac_result=yes -ac_set='' -ac_shellvars='CPPFLAGS LDFLAGS LIBS' -for ac_shellvar in $ac_shellvars; do - case $ac_shellvar in - CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; - *) ac_lfsvar=LFS_$ac_shellvar ;; - esac - eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar - (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } - ac_getconf=`getconf $ac_lfsvar` - ac_getconfs=$ac_getconfs$ac_getconf - eval ac_test_$ac_shellvar=\$ac_getconf -done -case "$ac_result$ac_getconfs" in -yes) ac_result=no ;; -esac -case "$ac_result$ac_set" in -yes?*) ac_result="yes, but $ac_set is already set, so use its settings" -esac -AC_MSG_RESULT($ac_result) -case $ac_result in -yes) - for ac_shellvar in $ac_shellvars; do - eval $ac_shellvar=\$ac_test_$ac_shellvar - done ;; -esac - -AC_AIX -AC_MINIX -AC_ISC_POSIX - -AC_C_CONST - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h string.h unistd.h utime.h varargs.h) - -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_SIGNAL -AC_TYPE_SIZE_T - -dnl Some systems have utime.h but don't declare the struct anywhere. -AC_MSG_CHECKING(for struct utimbuf) -AC_CACHE_VAL(patch_cv_sys_struct_utimbuf, -[AC_TRY_COMPILE([#include -#if HAVE_UTIME_H -#include -#endif], [static struct utimbuf x; x.actime = x.modtime;], - patch_cv_sys_struct_utimbuf=yes, - patch_cv_sys_struct_utimbuf=no)]) -AC_MSG_RESULT($patch_cv_sys_struct_utimbuf) -if test $patch_cv_sys_struct_utimbuf = yes; then - AC_DEFINE(HAVE_STRUCT_UTIMBUF) -fi - -# Check for NetBSD 1.0 bug, where memchr(..., 0) returns nonzero. -AC_MSG_CHECKING(for working memchr) -AC_CACHE_VAL(ac_cv_func_memchr, -[AC_TRY_RUN([#include -main () { exit (memchr ("", 0, 0) != 0 || memchr ("", 1, 0) != 0); }], - ac_cv_func_memchr=yes, - ac_cv_func_memchr=no, - AC_MSG_WARN([We are cross-compiling so we assume memchr does not work.]) - ac_cv_func_memchr=no)])dnl -AC_MSG_RESULT($ac_cv_func_memchr) -if test $ac_cv_func_memchr = yes; then - AC_DEFINE(HAVE_MEMCHR) -fi - -AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"]) -AC_SUBST(LIBOBJS) -AC_CHECK_FUNCS(_doprintf isascii memcmp mkdir mktemp pathconf raise sigaction sigprocmask sigsetmask) -AC_REPLACE_FUNCS(memchr rename) -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_VPRINTF - -AC_SYS_LONG_FILE_NAMES - -AC_MSG_CHECKING([for d_ino member in directory struct]) -AC_CACHE_VAL(patch_cv_sys_d_ino_in_dirent, -[AC_TRY_LINK([ -#include -#if HAVE_DIRENT_H -# include -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -#endif -], - [struct dirent dp; dp.d_ino = 0;], - patch_cv_sys_d_ino_in_dirent=yes, - patch_cv_sys_d_ino_in_dirent=no)]) -AC_MSG_RESULT($patch_cv_sys_d_ino_in_dirent) -if test $patch_cv_sys_d_ino_in_dirent = yes; then - AC_DEFINE(D_INO_IN_DIRENT) -fi - -AC_OUTPUT(Makefile) Property changes on: vendor/misc-GNU/patch/2.5/configure.in ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/quotearg.c =================================================================== --- vendor/misc-GNU/patch/2.5/quotearg.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/quotearg.c (nonexistent) @@ -1,125 +0,0 @@ -/* Shell command argument quoting. - Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -/* Place into QUOTED a quoted version of ARG suitable for `system'. - Return the length of the resulting string (which is not null-terminated). - If QUOTED is null, return the length without any side effects. */ - -size_t -quote_system_arg (quoted, arg) - char *quoted; - char const *arg; -{ - char const *a; - size_t len = 0; - - /* Scan ARG, copying it to QUOTED if QUOTED is not null, - looking for shell metacharacters. */ - - for (a = arg; ; a++) - { - char c = *a; - switch (c) - { - case 0: - /* ARG has no shell metacharacters. */ - return len; - - case '=': - if (*arg == '-') - break; - /* Fall through. */ - case '\t': case '\n': case ' ': - case '!': case '"': case '#': case '$': case '%': case '&': case '\'': - case '(': case ')': case '*': case ';': - case '<': case '>': case '?': case '[': case '\\': - case '^': case '`': case '|': case '~': - { - /* ARG has a shell metacharacter. - Start over, quoting it this time. */ - - len = 0; - c = *arg++; - - /* If ARG is an option, quote just its argument. - This is not necessary, but it looks nicer. */ - if (c == '-' && arg < a) - { - c = *arg++; - - if (quoted) - { - quoted[len] = '-'; - quoted[len + 1] = c; - } - len += 2; - - if (c == '-') - while (arg < a) - { - c = *arg++; - if (quoted) - quoted[len] = c; - len++; - if (c == '=') - break; - } - c = *arg++; - } - - if (quoted) - quoted[len] = '\''; - len++; - - for (; c; c = *arg++) - { - if (c == '\'') - { - if (quoted) - { - quoted[len] = '\''; - quoted[len + 1] = '\\'; - quoted[len + 2] = '\''; - } - len += 3; - } - if (quoted) - quoted[len] = c; - len++; - } - - if (quoted) - quoted[len] = '\''; - return len + 1; - } - } - - if (quoted) - quoted[len] = c; - len++; - } -} Property changes on: vendor/misc-GNU/patch/2.5/quotearg.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/version.h =================================================================== --- vendor/misc-GNU/patch/2.5/version.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/version.h (nonexistent) @@ -1,5 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.h,v 1.3 1997/04/07 01:07:00 eggert Exp $ */ - -void version PARAMS ((void)); Property changes on: vendor/misc-GNU/patch/2.5/version.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/quotearg.h =================================================================== --- vendor/misc-GNU/patch/2.5/quotearg.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/quotearg.h (nonexistent) @@ -1,9 +0,0 @@ -/* quote.h -- declarations for quoting system arguments */ - -#if defined __STDC__ || __GNUC__ -# define __QUOTEARG_P(args) args -#else -# define __QUOTEARG_P(args) () -#endif - -size_t quote_system_arg __QUOTEARG_P ((char *, char const *)); Property changes on: vendor/misc-GNU/patch/2.5/quotearg.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/maketime.c =================================================================== --- vendor/misc-GNU/patch/2.5/maketime.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/maketime.c (nonexistent) @@ -1,391 +0,0 @@ -/* Convert struct partime into time_t. */ - -/* Copyright 1992, 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif - /* MIPS RISCOS4.52 defines time_t in not . */ -# include -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#include - -char const maketId[] = - "$Id: maketime.c,v 5.15 1997/06/17 16:54:36 eggert Exp $"; - -static int isleap P ((int)); -static int month_days P ((struct tm const *)); -static time_t maketime P ((struct partime const *, time_t)); - -/* For maximum portability, use only localtime and gmtime. - Make no assumptions about the time_t epoch or the range of time_t values. - Avoid mktime because it's not universal and because there's no easy, - portable way for mktime to yield the inverse of gmtime. */ - -#define TM_YEAR_ORIGIN 1900 - -static int -isleap (y) - int y; -{ - return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); -} - -/* days in year before start of months 0-12 */ -static int const month_yday[] = -{ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 -}; - -/* Yield the number of days in TM's month. */ -static int -month_days (tm) - struct tm const *tm; -{ - int m = tm->tm_mon; - return (month_yday[m + 1] - month_yday[m] - + (m == 1 && isleap (tm->tm_year + TM_YEAR_ORIGIN))); -} - -/* Convert UNIXTIME to struct tm form. - Use gmtime if available and if !LOCALZONE, localtime otherwise. */ -struct tm * -time2tm (unixtime, localzone) - time_t unixtime; - int localzone; -{ - struct tm *tm; -#ifdef TZ_is_unset - static char const *TZ; - if (!TZ && !(TZ = getenv ("TZ"))) - TZ_is_unset ("The TZ environment variable is not set; please set it to your timezone"); -#endif - if (localzone || !(tm = gmtime (&unixtime))) - tm = localtime (&unixtime); - return tm; -} - -/* Yield A - B, measured in seconds. */ -time_t -difftm (a, b) - struct tm const *a; - struct tm const *b; -{ - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); - int ac = ay / 100 - (ay % 100 < 0); - int bc = by / 100 - (by % 100 < 0); - int difference_in_day_of_year = a->tm_yday - b->tm_yday; - int intervening_leap_days = (((ay >> 2) - (by >> 2)) - - (ac - bc) - + ((ac >> 2) - (bc >> 2))); - time_t difference_in_years = ay - by; - time_t difference_in_days - = (difference_in_years * 365 - + (intervening_leap_days + difference_in_day_of_year)); - return (((((difference_in_days * 24 - + (a->tm_hour - b->tm_hour)) - * 60) - + (a->tm_min - b->tm_min)) - * 60) - + (a->tm_sec - b->tm_sec)); -} - -/* - * Adjust time T by adding SECONDS. SECONDS must be at most 24 hours' worth. - * Adjust only T's year, mon, mday, hour, min and sec members; - * plus adjust wday if it is defined. - */ -void -adjzone (t, seconds) - register struct tm *t; - long seconds; -{ - /* - * This code can be off by a second if SECONDS is not a multiple of 60, - * if T is local time, and if a leap second happens during this minute. - * But this bug has never occurred, and most likely will not ever occur. - * Liberia, the last country for which SECONDS % 60 was nonzero, - * switched to UTC in May 1972; the first leap second was in June 1972. - */ - int leap_second = t->tm_sec == 60; - long sec = seconds + (t->tm_sec - leap_second); - if (sec < 0) - { - if ((t->tm_min -= (59 - sec) / 60) < 0) - { - if ((t->tm_hour -= (59 - t->tm_min) / 60) < 0) - { - t->tm_hour += 24; - if (TM_DEFINED (t->tm_wday) && --t->tm_wday < 0) - t->tm_wday = 6; - if (--t->tm_mday <= 0) - { - if (--t->tm_mon < 0) - { - --t->tm_year; - t->tm_mon = 11; - } - t->tm_mday = month_days (t); - } - } - t->tm_min += 24 * 60; - } - sec += 24L * 60 * 60; - } - else if (60 <= (t->tm_min += sec / 60)) - if (24 <= (t->tm_hour += t->tm_min / 60)) - { - t->tm_hour -= 24; - if (TM_DEFINED (t->tm_wday) && ++t->tm_wday == 7) - t->tm_wday = 0; - if (month_days (t) < ++t->tm_mday) - { - if (11 < ++t->tm_mon) - { - ++t->tm_year; - t->tm_mon = 0; - } - t->tm_mday = 1; - } - } - t->tm_min %= 60; - t->tm_sec = (int) (sec % 60) + leap_second; -} - -/* - * Convert TM to time_t, using localtime if LOCALZONE and gmtime otherwise. - * Use only TM's year, mon, mday, hour, min, and sec members. - * Ignore TM's old tm_yday and tm_wday, but fill in their correct values. - * Yield -1 on failure (e.g. a member out of range). - * Posix 1003.1-1990 doesn't allow leap seconds, but some implementations - * have them anyway, so allow them if localtime/gmtime does. - */ -time_t -tm2time (tm, localzone) - struct tm *tm; - int localzone; -{ - /* Cache the most recent t,tm pairs; 1 for gmtime, 1 for localtime. */ - static time_t t_cache[2]; - static struct tm tm_cache[2]; - - time_t d, gt; - struct tm const *gtm; - /* - * The maximum number of iterations should be enough to handle any - * combinations of leap seconds, time zone rule changes, and solar time. - * 4 is probably enough; we use a bigger number just to be safe. - */ - int remaining_tries = 8; - - /* Avoid subscript errors. */ - if (12 <= (unsigned) tm->tm_mon) - return -1; - - tm->tm_yday = month_yday[tm->tm_mon] + tm->tm_mday - - (tm->tm_mon < 2 || !isleap (tm->tm_year + TM_YEAR_ORIGIN)); - - /* Make a first guess. */ - gt = t_cache[localzone]; - gtm = gt ? &tm_cache[localzone] : time2tm (gt, localzone); - - /* Repeatedly use the error from the guess to improve the guess. */ - while ((d = difftm (tm, gtm)) != 0) - { - if (--remaining_tries == 0) - return -1; - gt += d; - gtm = time2tm (gt, localzone); - } - - /* - * Check that the guess actually matches; - * overflow can cause difftm to yield 0 even on differing times, - * or tm may have members out of range (e.g. bad leap seconds). - */ -#define TM_DIFFER(a,b) \ - ( \ - ((a)->tm_year ^ (b)->tm_year) | \ - ((a)->tm_mon ^ (b)->tm_mon) | \ - ((a)->tm_mday ^ (b)->tm_mday) | \ - ((a)->tm_hour ^ (b)->tm_hour) | \ - ((a)->tm_min ^ (b)->tm_min) | \ - ((a)->tm_sec ^ (b)->tm_sec) \ - ) - if (TM_DIFFER (tm, gtm)) - { - /* - * If gt is a leap second, try gt+1; if it is one greater than - * a leap second, try gt-1; otherwise, it doesn't matter. - * Leap seconds always fall at month end. - */ - int yd = tm->tm_year - gtm->tm_year; - gt += yd + (yd ? 0 : tm->tm_mon - gtm->tm_mon); - gtm = time2tm (gt, localzone); - if (TM_DIFFER (tm, gtm)) - return -1; - } - t_cache[localzone] = gt; - tm_cache[localzone] = *gtm; - - tm->tm_wday = gtm->tm_wday; - return gt; -} - -/* - * Check *PT and convert it to time_t. - * If it is incompletely specified, use DEFAULT_TIME to fill it out. - * Use localtime if PT->zone is the special value TM_LOCAL_ZONE. - * Yield -1 on failure. - * ISO 8601 day-of-year and week numbers are not yet supported. - */ -static time_t -maketime (pt, default_time) - struct partime const *pt; - time_t default_time; -{ - int localzone, wday; - struct tm tm; - struct tm *tm0 = 0; - time_t r; - - tm0 = 0; /* Keep gcc -Wall happy. */ - localzone = pt->zone == TM_LOCAL_ZONE; - - tm = pt->tm; - - if (TM_DEFINED (pt->ymodulus) || !TM_DEFINED (tm.tm_year)) - { - /* Get tm corresponding to default time. */ - tm0 = time2tm (default_time, localzone); - if (!localzone) - adjzone (tm0, pt->zone); - } - - if (TM_DEFINED (pt->ymodulus)) - tm.tm_year += - (tm0->tm_year + TM_YEAR_ORIGIN) / pt->ymodulus * pt->ymodulus; - else if (!TM_DEFINED (tm.tm_year)) - { - /* Set default year, month, day from current time. */ - tm.tm_year = tm0->tm_year + TM_YEAR_ORIGIN; - if (!TM_DEFINED (tm.tm_mon)) - { - tm.tm_mon = tm0->tm_mon; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = tm0->tm_mday; - } - } - - /* Convert from partime year (Gregorian) to Posix year. */ - tm.tm_year -= TM_YEAR_ORIGIN; - - /* Set remaining default fields to be their minimum values. */ - if (!TM_DEFINED (tm.tm_mon)) - tm.tm_mon = 0; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = 1; - if (!TM_DEFINED (tm.tm_hour)) - tm.tm_hour = 0; - if (!TM_DEFINED (tm.tm_min)) - tm.tm_min = 0; - if (!TM_DEFINED (tm.tm_sec)) - tm.tm_sec = 0; - - if (!localzone) - adjzone (&tm, -pt->zone); - wday = tm.tm_wday; - - /* Convert and fill in the rest of the tm. */ - r = tm2time (&tm, localzone); - - /* Check weekday. */ - if (r != -1 && TM_DEFINED (wday) && wday != tm.tm_wday) - return -1; - - return r; -} - -/* Parse a free-format date in SOURCE, yielding a Unix format time. */ -time_t -str2time (source, default_time, default_zone) - char const *source; - time_t default_time; - long default_zone; -{ - struct partime pt; - - if (*partime (source, &pt)) - return -1; - if (pt.zone == TM_UNDEFINED_ZONE) - pt.zone = default_zone; - return maketime (&pt, default_time); -} - -#if TEST -#include -int -main (argc, argv) - int argc; - char **argv; -{ - time_t default_time = time ((time_t *) 0); - long default_zone = argv[1] ? atol (argv[1]) : 0; - char buf[1000]; - while (fgets (buf, sizeof (buf), stdin)) - { - time_t t = str2time (buf, default_time, default_zone); - printf ("%s", asctime (gmtime (&t))); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/2.5/maketime.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/common.h =================================================================== --- vendor/misc-GNU/patch/2.5/common.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/common.h (nonexistent) @@ -1,307 +0,0 @@ -/* common definitions for `patch' */ - -/* $Id: common.h,v 1.18 1997/06/13 06:28:37 eggert Exp $ */ - -/* -Copyright 1986, 1988 Larry Wall -Copyright 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef DEBUGGING -#define DEBUGGING 1 -#endif - -/* We must define `volatile' and `const' first (the latter inside config.h), - so that they're used consistently in all system includes. */ -#ifndef __STDC__ -# ifndef volatile -# define volatile -# endif -#endif - -/* Enable support for fseeko and ftello on hosts - where it is available but is turned off by default. - This must be defined before any system file is included. */ -#define _LARGEFILE_SOURCE 1 - -#include - -#include -#include -#include -#include - -#include -#if ! defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if ! defined S_ISREG && defined S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#ifndef S_IXOTH -#define S_IXOTH 1 -#endif -#ifndef S_IWOTH -#define S_IWOTH 2 -#endif -#ifndef S_IROTH -#define S_IROTH 4 -#endif -#ifndef S_IXGRP -#define S_IXGRP (S_IXOTH << 3) -#endif -#ifndef S_IWGRP -#define S_IWGRP (S_IWOTH << 3) -#endif -#ifndef S_IRGRP -#define S_IRGRP (S_IROTH << 3) -#endif -#ifndef S_IXUSR -#define S_IXUSR (S_IXOTH << 6) -#endif -#ifndef S_IWUSR -#define S_IWUSR (S_IWOTH << 6) -#endif -#ifndef S_IRUSR -#define S_IRUSR (S_IROTH << 6) -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif -#ifndef LONG_MIN -#define LONG_MIN (-1-2147483647L) -#endif - -#include -/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to macros like `isspace'. */ -#if STDC_HEADERS -#define CTYPE_DOMAIN(c) 1 -#else -#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#ifndef ISSPACE -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#endif - -#ifndef ISDIGIT -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#endif - - -#ifndef FILESYSTEM_PREFIX_LEN -#define FILESYSTEM_PREFIX_LEN(f) 0 -#endif - -#ifndef ISSLASH -#define ISSLASH(c) ((c) == '/') -#endif - - -/* constants */ - -/* AIX predefines these. */ -#ifdef TRUE -#undef TRUE -#endif -#ifdef FALSE -#undef FALSE -#endif -#define TRUE 1 -#define FALSE 0 - -/* handy definitions */ - -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) - -/* typedefs */ - -typedef int bool; /* must promote to itself */ -typedef long LINENUM; /* must be signed */ - -/* globals */ - -extern char const program_name[]; - -XTERN char *buf; /* general purpose buffer */ -XTERN size_t bufsize; /* allocated size of buf */ - -XTERN bool using_plan_a; /* try to keep everything in memory */ - -XTERN char *inname; -XTERN char *outfile; -XTERN int inerrno; -XTERN int invc; -XTERN struct stat instat; -XTERN bool dry_run; -XTERN bool posixly_correct; - -XTERN char const *origprae; -XTERN char const *origbase; - -XTERN char const * volatile TMPOUTNAME; -XTERN char const * volatile TMPINNAME; -XTERN char const * volatile TMPPATNAME; - -#ifdef DEBUGGING -XTERN int debug; -#else -# define debug 0 -#endif -XTERN bool force; -XTERN bool batch; -XTERN bool noreverse; -XTERN int reverse; -XTERN enum { DEFAULT_VERBOSITY, SILENT, VERBOSE } verbosity; -XTERN bool skip_rest_of_patch; -XTERN int strippath; -XTERN bool canonicalize; -XTERN int patch_get; -XTERN int set_time; -XTERN int set_utc; - -enum diff - { - NO_DIFF, - CONTEXT_DIFF, - NORMAL_DIFF, - ED_DIFF, - NEW_CONTEXT_DIFF, - UNI_DIFF - }; - -XTERN enum diff diff_type; - -XTERN char *revision; /* prerequisite revision, if any */ - -#ifdef __STDC__ -# define GENERIC_OBJECT void -#else -# define GENERIC_OBJECT char -#endif - -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ -# define __attribute__(x) -#endif - -#ifndef PARAMS -# ifdef __STDC__ -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -GENERIC_OBJECT *xmalloc PARAMS ((size_t)); -void fatal_exit PARAMS ((int)) __attribute__ ((noreturn)); - -#include -#if !STDC_HEADERS && !defined errno -extern int errno; -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#else -# if !HAVE_MEMCHR -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# define memcpy(d, s, n) bcopy (s, d, n) -GENERIC_OBJECT *memchr (); -# endif -#endif - -#if STDC_HEADERS -# include -#else -long atol (); -char *getenv (); -GENERIC_OBJECT *malloc (); -GENERIC_OBJECT *realloc (); -#endif - -#if HAVE_UNISTD_H -# include -#endif -#ifndef lseek -off_t lseek (); -#endif -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif -#if _LFS_LARGEFILE - typedef off_t file_offset; -# define file_seek fseeko -# define file_tell ftello -#else - typedef long file_offset; -# define file_seek fseek -# define file_tell ftell -#endif - -#if HAVE_FCNTL_H -# include -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif -#ifndef O_WRONLY -#define O_WRONLY 1 -#endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif -#ifndef _O_BINARY -#define _O_BINARY 0 -#endif -#ifndef O_BINARY -#define O_BINARY _O_BINARY -#endif -#ifndef O_CREAT -#define O_CREAT 0 -#endif -#ifndef O_TRUNC -#define O_TRUNC 0 -#endif - -#if HAVE_SETMODE - XTERN int binary_transput; /* O_BINARY if binary i/o is desired */ -#else -# define binary_transput 0 -#endif - -#ifndef NULL_DEVICE -#define NULL_DEVICE "/dev/null" -#endif - -#ifndef TTY_DEVICE -#define TTY_DEVICE "/dev/tty" -#endif Property changes on: vendor/misc-GNU/patch/2.5/common.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/addext.c =================================================================== --- vendor/misc-GNU/patch/2.5/addext.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/addext.c (nonexistent) @@ -1,106 +0,0 @@ -/* addext.c -- add an extension to a file name - Copyright (C) 1990, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie and Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifndef HAVE_DOS_FILE_NAMES -#define HAVE_DOS_FILE_NAMES 0 -#endif -#ifndef HAVE_LONG_FILE_NAMES -#define HAVE_LONG_FILE_NAMES 0 -#endif - -#include - -#if HAVE_LIMITS_H -# include -#endif -#ifndef _POSIX_NAME_MAX -#define _POSIX_NAME_MAX 14 -#endif - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - -/* Append to FILENAME the extension EXT, unless the result would be too long, - in which case just append the character E. */ - -void -addext (filename, ext, e) - char *filename; - char const *ext; - int e; -{ - char *s = base_name (filename); - size_t slen = strlen (s), extlen = strlen (ext); - long slen_max = -1; - -#if HAVE_PATHCONF && defined _PC_NAME_MAX - if (slen + extlen <= _POSIX_NAME_MAX && ! HAVE_DOS_FILE_NAMES) - /* The file name is so short there's no need to call pathconf. */ - slen_max = _POSIX_NAME_MAX; - else if (s == filename) - slen_max = pathconf (".", _PC_NAME_MAX); - else - { - char c = *s; - *s = 0; - slen_max = pathconf (filename, _PC_NAME_MAX); - *s = c; - } -#endif - if (slen_max < 0) - slen_max = HAVE_LONG_FILE_NAMES ? 255 : 14; - - if (HAVE_DOS_FILE_NAMES && slen_max <= 12) - { - /* Live within DOS's 8.3 limit. */ - char *dot = strchr (s, '.'); - if (dot) - { - slen -= dot + 1 - s; - s = dot + 1; - slen_max = 3; - } - else - slen_max = 8; - extlen = 9; /* Don't use EXT. */ - } - - if (slen + extlen <= slen_max) - strcpy (s + slen, ext); - else - { - if (slen_max <= slen) - slen = slen_max - 1; - s[slen] = e; - s[slen + 1] = 0; - } -} Property changes on: vendor/misc-GNU/patch/2.5/addext.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/maketime.h =================================================================== --- vendor/misc-GNU/patch/2.5/maketime.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/maketime.h (nonexistent) @@ -1,39 +0,0 @@ -/* Yield time_t from struct partime yielded by partime. */ - -/* Copyright 1993, 1994, 1995 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if defined __STDC__ || has_prototypes -# define __MAKETIME_P(x) x -#else -# define __MAKETIME_P(x) () -#endif - -struct tm *time2tm __MAKETIME_P ((time_t, int)); -time_t difftm __MAKETIME_P ((struct tm const *, struct tm const *)); -time_t str2time __MAKETIME_P ((char const *, time_t, long)); -time_t tm2time __MAKETIME_P ((struct tm *, int)); -void adjzone __MAKETIME_P ((struct tm *, long)); Property changes on: vendor/misc-GNU/patch/2.5/maketime.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/memchr.c =================================================================== --- vendor/misc-GNU/patch/2.5/memchr.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/memchr.c (nonexistent) @@ -1,199 +0,0 @@ -/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc. - Based on strlen implementation by Torbjorn Granlund (tege@sics.se), - with help from Dan Sahlin (dan@sics.se) and - commentary by Jim Blandy (jimb@ai.mit.edu); - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), - and implemented by Roland McGrath (roland@ai.mit.edu). - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#undef __ptr_t -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -# define __ptr_t void * -#else /* Not C++ or ANSI C. */ -# define __ptr_t char * -#endif /* C++ or ANSI C. */ - -#if defined (_LIBC) -# include -#endif - -#if defined (HAVE_LIMITS_H) || defined (_LIBC) -# include -#endif - -#define LONG_MAX_32_BITS 2147483647 - -#ifndef LONG_MAX -#define LONG_MAX LONG_MAX_32_BITS -#endif - -#include - - -/* Search no more than N bytes of S for C. */ - -__ptr_t -memchr (s, c, n) - const __ptr_t s; - int c; - size_t n; -{ - const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; - - c = (unsigned char) c; - - /* Handle the first few characters by reading one character at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && ((unsigned long int) char_ptr - & (sizeof (longword) - 1)) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (__ptr_t) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to 8-byte longwords. */ - - longword_ptr = (unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - if (sizeof (longword) != 4 && sizeof (longword) != 8) - abort (); - -#if LONG_MAX <= LONG_MAX_32_BITS - magic_bits = 0x7efefeff; -#else - magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; -#endif - - /* Set up a longword, each of whose bytes is C. */ - charmask = c | (c << 8); - charmask |= charmask << 16; -#if LONG_MAX > LONG_MAX_32_BITS - charmask |= charmask << 32; -#endif - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof (longword)) - { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) - { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ - - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (__ptr_t) cp; - if (cp[1] == c) - return (__ptr_t) &cp[1]; - if (cp[2] == c) - return (__ptr_t) &cp[2]; - if (cp[3] == c) - return (__ptr_t) &cp[3]; -#if LONG_MAX > 2147483647 - if (cp[4] == c) - return (__ptr_t) &cp[4]; - if (cp[5] == c) - return (__ptr_t) &cp[5]; - if (cp[6] == c) - return (__ptr_t) &cp[6]; - if (cp[7] == c) - return (__ptr_t) &cp[7]; -#endif - } - - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - while (n-- > 0) - { - if (*char_ptr == c) - return (__ptr_t) char_ptr; - else - ++char_ptr; - } - - return 0; -} Property changes on: vendor/misc-GNU/patch/2.5/memchr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/patch.c =================================================================== --- vendor/misc-GNU/patch/2.5/patch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/patch.c (nonexistent) @@ -1,1302 +0,0 @@ -/* patch - a program to apply diffs to original files */ - -/* $Id: patch.c,v 1.23 1997/07/05 10:32:23 eggert Exp $ */ - -/* -Copyright 1984, 1985, 1986, 1987, 1988 Larry Wall -Copyright 1989, 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN -#include -#undef XTERN -#define XTERN extern -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_UTIME_H -# include -#endif -/* Some nonstandard hosts don't declare this structure even in . */ -#if ! HAVE_STRUCT_UTIMBUF -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif - -/* Output stream state. */ -struct outstate -{ - FILE *ofp; - int after_newline; - int zero_output; -}; - -/* procedures */ - -static FILE *create_output_file PARAMS ((char const *)); -static LINENUM locate_hunk PARAMS ((LINENUM)); -static bool apply_hunk PARAMS ((struct outstate *, LINENUM)); -static bool copy_till PARAMS ((struct outstate *, LINENUM)); -static bool patch_match PARAMS ((LINENUM, LINENUM, LINENUM, LINENUM)); -static bool similar PARAMS ((char const *, size_t, char const *, size_t)); -static bool spew_output PARAMS ((struct outstate *)); -static char const *make_temp PARAMS ((int)); -static int numeric_string PARAMS ((char const *, int, char const *)); -static void abort_hunk PARAMS ((void)); -static void cleanup PARAMS ((void)); -static void get_some_switches PARAMS ((void)); -static void init_output PARAMS ((char const *, struct outstate *)); -static void init_reject PARAMS ((char const *)); -static void reinitialize_almost_everything PARAMS ((void)); -static void usage PARAMS ((FILE *, int)) __attribute__((noreturn)); - -static int make_backups; -static int backup_if_mismatch; -static char const *version_control; -static int remove_empty_files; - -/* TRUE if -R was specified on command line. */ -static int reverse_flag_specified; - -/* how many input lines have been irretractably output */ -static LINENUM last_frozen_line; - -static char const *do_defines; /* symbol to patch using ifdef, ifndef, etc. */ -static char const if_defined[] = "\n#ifdef %s\n"; -static char const not_defined[] = "#ifndef %s\n"; -static char const else_defined[] = "\n#else\n"; -static char const end_defined[] = "\n#endif /* %s */\n"; - -static int Argc; -static char * const *Argv; - -static FILE *rejfp; /* reject file pointer */ - -static char const *patchname; -static char *rejname; -static char const * volatile TMPREJNAME; - -static LINENUM last_offset; -static LINENUM maxfuzz = 2; - -static char serrbuf[BUFSIZ]; - -char const program_name[] = "patch"; - -/* Apply a set of diffs as appropriate. */ - -int main PARAMS ((int, char **)); - -int -main(argc,argv) -int argc; -char **argv; -{ - char const *val; - bool somefailed = FALSE; - struct outstate outstate; - - init_time (); - - setbuf(stderr, serrbuf); - - bufsize = 8 * 1024; - buf = xmalloc (bufsize); - - strippath = INT_MAX; - - posixly_correct = getenv ("POSIXLY_CORRECT") != 0; - backup_if_mismatch = ! posixly_correct; - patch_get = ((val = getenv ("PATCH_GET")) - ? numeric_string (val, 1, "PATCH_GET value") - : posixly_correct - 1); - - { - char const *v = getenv ("SIMPLE_BACKUP_SUFFIX"); - if (v && *v) - simple_backup_suffix = v; - } - - version_control = getenv ("PATCH_VERSION_CONTROL"); - if (! version_control) - version_control = getenv ("VERSION_CONTROL"); - - /* Cons up the names of the global temporary files. - Do this before `cleanup' can possibly be called (e.g. by `pfatal'). */ - TMPOUTNAME = make_temp ('o'); - TMPINNAME = make_temp ('i'); - TMPREJNAME = make_temp ('r'); - TMPPATNAME = make_temp ('p'); - - /* parse switches */ - Argc = argc; - Argv = argv; - get_some_switches(); - - if (make_backups | backup_if_mismatch) - backup_type = get_version (version_control); - - init_output (outfile, &outstate); - - /* Make sure we clean up in case of disaster. */ - set_signals(0); - - for ( - open_patch_file (patchname); - there_is_another_patch(); - reinitialize_almost_everything() - ) { /* for each patch in patch file */ - int hunk = 0; - int failed = 0; - int mismatch = 0; - char *outname = outfile ? outfile : inname; - - if (!skip_rest_of_patch) - get_input_file (inname, outname); - - if (diff_type == ED_DIFF) { - outstate.zero_output = 0; - if (! dry_run) - { - do_ed_script (outstate.ofp); - if (! outfile) - { - struct stat statbuf; - if (stat (TMPOUTNAME, &statbuf) != 0) - pfatal ("%s", TMPOUTNAME); - outstate.zero_output = statbuf.st_size == 0; - } - } - } else { - int got_hunk; - int apply_anyway = 0; - - /* initialize the patched file */ - if (! skip_rest_of_patch && ! outfile) - init_output (TMPOUTNAME, &outstate); - - /* initialize reject file */ - init_reject(TMPREJNAME); - - /* find out where all the lines are */ - if (!skip_rest_of_patch) - scan_input (inname); - - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ - - /* apply each hunk of patch */ - while (0 < (got_hunk = another_hunk (diff_type, reverse))) { - LINENUM where = 0; /* Pacify `gcc -Wall'. */ - LINENUM newwhere; - LINENUM fuzz = 0; - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM mymaxfuzz = (maxfuzz < context ? maxfuzz : context); - hunk++; - if (!skip_rest_of_patch) { - do { - where = locate_hunk(fuzz); - if (! where || fuzz || last_offset) - mismatch = 1; - if (hunk == 1 && ! where && ! (force | apply_anyway) - && reverse == reverse_flag_specified) { - /* dwim for reversed patch? */ - if (!pch_swap()) { - say ( -"Not enough memory to try swapped hunk! Assuming unswapped.\n"); - continue; - } - /* Try again. */ - where = locate_hunk (fuzz); - if (where - && (ok_to_reverse - ("%s patch detected!", - (reverse - ? "Unreversed" - : "Reversed (or previously applied)")))) - reverse ^= 1; - else - { - /* Put it back to normal. */ - if (! pch_swap ()) - fatal ("lost hunk on alloc error!"); - if (where) - { - apply_anyway = 1; - fuzz--; /* Undo `++fuzz' below. */ - where = 0; - } - } - } - } while (!skip_rest_of_patch && !where - && ++fuzz <= mymaxfuzz); - - if (skip_rest_of_patch) { /* just got decided */ - if (outstate.ofp && ! outfile) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - } - } - - newwhere = pch_newfirst() + last_offset; - if (skip_rest_of_patch) { - abort_hunk(); - failed++; - if (verbosity == VERBOSE) - say ("Hunk #%d ignored at %ld.\n", hunk, newwhere); - } - else if (!where - || (where == 1 && pch_says_nonexistent (reverse) - && instat.st_size)) { - if (where) - say ("Patch attempted to create file `%s', which already exists.\n", inname); - abort_hunk(); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %ld.\n", hunk, newwhere); - } - else if (! apply_hunk (&outstate, where)) { - abort_hunk (); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %ld.\n", hunk, newwhere); - } else { - if (verbosity == VERBOSE - || (verbosity != SILENT && (fuzz || last_offset))) { - say ("Hunk #%d succeeded at %ld", hunk, newwhere); - if (fuzz) - say (" with fuzz %ld", fuzz); - if (last_offset) - say (" (offset %ld line%s)", - last_offset, last_offset==1?"":"s"); - say (".\n"); - } - } - } - - if (got_hunk < 0 && using_plan_a) { - if (outfile) - fatal ("out of memory using Plan A"); - say ("\n\nRan out of memory using Plan A -- trying again...\n\n"); - if (outstate.ofp) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - fclose (rejfp); - continue; - } - - /* finish spewing out the new file */ - if (!skip_rest_of_patch) - { - assert (hunk); - if (! spew_output (&outstate)) - { - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - } - } - } - - /* and put the output where desired */ - ignore_signals (); - if (! skip_rest_of_patch && ! outfile) { - if (outstate.zero_output - && (remove_empty_files - || (pch_says_nonexistent (reverse ^ 1) == 2 - && ! posixly_correct))) - { - if (verbosity == VERBOSE) - say ("Removing file `%s'%s.\n", outname, - dry_run ? " and any empty ancestor directories" : ""); - if (! dry_run) - { - move_file ((char *) 0, outname, (mode_t) 0, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - removedirs (outname); - } - } - else - { - if (! outstate.zero_output - && pch_says_nonexistent (reverse ^ 1)) - { - mismatch = 1; - if (verbosity != SILENT) - say ("File `%s' is not empty after patch, as expected.\n", - outname); - } - - if (! dry_run) - { - time_t t; - - move_file (TMPOUTNAME, outname, instat.st_mode, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - - if ((set_time | set_utc) - && (t = pch_timestamp (reverse ^ 1)) != (time_t) -1) - { - struct utimbuf utimbuf; - utimbuf.actime = utimbuf.modtime = t; - - if (! force && ! inerrno - && ! pch_says_nonexistent (reverse) - && (t = pch_timestamp (reverse)) != (time_t) -1 - && t != instat.st_mtime) - say ("not setting time of file `%s' (time mismatch)\n", - outname); - else if (! force && (mismatch | failed)) - say ("not setting time of file `%s' (contents mismatch)\n", - outname); - else if (utime (outname, &utimbuf) != 0) - pfatal ("can't set timestamp on file `%s'", outname); - } - - if (! inerrno && chmod (outname, instat.st_mode) != 0) - pfatal ("can't set permissions on file `%s'", outname); - } - } - } - if (diff_type != ED_DIFF) { - if (fclose (rejfp) != 0) - write_fatal (); - if (failed) { - somefailed = TRUE; - say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1), - skip_rest_of_patch ? "ignored" : "FAILED"); - if (outname) { - char *rej = rejname; - if (!rejname) { - rej = xmalloc (strlen (outname) + 5); - strcpy (rej, outname); - addext (rej, ".rej", '#'); - } - say (" -- saving rejects to %s", rej); - if (! dry_run) - { - move_file (TMPREJNAME, rej, instat.st_mode, FALSE); - if (! inerrno - && (chmod (rej, (instat.st_mode - & ~(S_IXUSR|S_IXGRP|S_IXOTH))) - != 0)) - pfatal ("can't set permissions on file `%s'", rej); - } - if (!rejname) - free (rej); - } - say ("\n"); - } - } - set_signals (1); - } - if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) - write_fatal (); - cleanup (); - if (somefailed) - exit (1); - return 0; -} - -/* Prepare to find the next patch to do in the patch file. */ - -static void -reinitialize_almost_everything() -{ - re_patch(); - re_input(); - - input_lines = 0; - last_frozen_line = 0; - - if (inname) { - free (inname); - inname = 0; - } - - last_offset = 0; - - diff_type = NO_DIFF; - - if (revision) { - free(revision); - revision = 0; - } - - reverse = reverse_flag_specified; - skip_rest_of_patch = FALSE; -} - -static char const shortopts[] = "bB:cd:D:eEfF:g:i:lnNo:p:r:RstTuvV:x:Y:z:Z"; -static struct option const longopts[] = -{ - {"backup", no_argument, NULL, 'b'}, - {"prefix", required_argument, NULL, 'B'}, - {"context", no_argument, NULL, 'c'}, - {"directory", required_argument, NULL, 'd'}, - {"ifdef", required_argument, NULL, 'D'}, - {"ed", no_argument, NULL, 'e'}, - {"remove-empty-files", no_argument, NULL, 'E'}, - {"force", no_argument, NULL, 'f'}, - {"fuzz", required_argument, NULL, 'F'}, - {"get", no_argument, NULL, 'g'}, - {"input", required_argument, NULL, 'i'}, - {"ignore-whitespace", no_argument, NULL, 'l'}, - {"normal", no_argument, NULL, 'n'}, - {"forward", no_argument, NULL, 'N'}, - {"output", required_argument, NULL, 'o'}, - {"strip", required_argument, NULL, 'p'}, - {"reject-file", required_argument, NULL, 'r'}, - {"reverse", no_argument, NULL, 'R'}, - {"quiet", no_argument, NULL, 's'}, - {"silent", no_argument, NULL, 's'}, - {"batch", no_argument, NULL, 't'}, - {"set-time", no_argument, NULL, 'T'}, - {"unified", no_argument, NULL, 'u'}, - {"version", no_argument, NULL, 'v'}, - {"version-control", required_argument, NULL, 'V'}, - {"debug", required_argument, NULL, 'x'}, - {"basename-prefix", required_argument, NULL, 'Y'}, - {"suffix", required_argument, NULL, 'z'}, - {"set-utc", no_argument, NULL, 'Z'}, - {"dry-run", no_argument, NULL, 129}, - {"verbose", no_argument, NULL, 130}, - {"binary", no_argument, NULL, 131}, - {"help", no_argument, NULL, 132}, - {"backup-if-mismatch", no_argument, NULL, 133}, - {"no-backup-if-mismatch", no_argument, NULL, 134}, - {NULL, no_argument, NULL, 0} -}; - -static char const *const option_help[] = -{ -"Input options:", -"", -" -p NUM --strip=NUM Strip NUM leading components from file names.", -" -F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.", -" -l --ignore-whitespace Ignore white space changes between patch and input.", -"", -" -c --context Interpret the patch as a context difference.", -" -e --ed Interpret the patch as an ed script.", -" -n --normal Interpret the patch as a normal difference.", -" -u --unified Interpret the patch as a unified difference.", -"", -" -N --forward Ignore patches that appear to be reversed or already applied.", -" -R --reverse Assume patches were created with old and new files swapped.", -"", -" -i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.", -"", -"Output options:", -"", -" -o FILE --output=FILE Output patched files to FILE.", -" -r FILE --reject-file=FILE Output rejects to FILE.", -"", -" -D NAME --ifdef=NAME Make merged if-then-else output using NAME.", -" -E --remove-empty-files Remove output files that are empty after patching.", -"", -" -Z --set-utc Set times of patched files, assuming diff uses UTC (GMT).", -" -T --set-time Likewise, assuming local time.", -"", -"Backup and version control options:", -"", -" -b --backup Back up the original contents of each file.", -" --backup-if-mismatch Back up if the patch does not match exactly.", -" --no-backup-if-mismatch Back up mismatches only if otherwise requested.", -"", -" -V STYLE --version-control=STYLE Use STYLE version control.", -" STYLE is either 'simple', 'numbered', or 'existing'.", -" -B PREFIX --prefix=PREFIX Prepend PREFIX to backup file names.", -" -Y PREFIX --basename-prefix=PREFIX Prepend PREFIX to backup file basenames.", -" -z SUFFIX --suffix=SUFFIX Append SUFFIX to backup file names.", -"", -" -g NUM --get=NUM Get files from RCS or SCCS if positive; ask if negative.", -"", -"Miscellaneous options:", -"", -" -t --batch Ask no questions; skip bad-Prereq patches; assume reversed.", -" -f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.", -" -s --quiet --silent Work silently unless an error occurs.", -" --verbose Output extra information about the work being done.", -" --dry-run Do not actually change any files; just print what would happen.", -"", -" -d DIR --directory=DIR Change the working directory to DIR first.", -#if HAVE_SETMODE -" --binary Read and write data in binary mode.", -#else -" --binary Read and write data in binary mode (no effect on this platform).", -#endif -"", -" -v --version Output version info.", -" --help Output this help.", -"", -"Report bugs to .", -0 -}; - -static void -usage (stream, status) - FILE *stream; - int status; -{ - char const * const *p; - - if (status != 0) - { - fprintf (stream, "%s: Try `%s --help' for more information.\n", - program_name, Argv[0]); - } - else - { - fprintf (stream, "Usage: %s [OPTION]... [ORIGFILE [PATCHFILE]]\n\n", - Argv[0]); - for (p = option_help; *p; p++) - fprintf (stream, "%s\n", *p); - } - - exit (status); -} - -/* Process switches and filenames. */ - -static void -get_some_switches() -{ - register int optc; - - if (rejname) - free (rejname); - rejname = 0; - if (optind == Argc) - return; - while ((optc = getopt_long (Argc, Argv, shortopts, longopts, (int *) 0)) - != -1) { - switch (optc) { - case 'b': - make_backups = 1; - /* Special hack for backward compatibility with CVS 1.9. - If the last 4 args are `-b SUFFIX ORIGFILE PATCHFILE', - treat `-b' as if it were `-b -z'. */ - if (Argc - optind == 3 - && strcmp (Argv[optind - 1], "-b") == 0 - && ! (Argv[optind + 0][0] == '-' && Argv[optind + 0][1]) - && ! (Argv[optind + 1][0] == '-' && Argv[optind + 1][1]) - && ! (Argv[optind + 2][0] == '-' && Argv[optind + 2][1])) - { - optarg = Argv[optind++]; - if (verbosity != SILENT) - say ("warning: the `-b %s' option is obsolete; use `-b -z %s' instead\n", - optarg, optarg); - goto case_z; - } - break; - case 'B': - if (!*optarg) - fatal ("backup prefix is empty"); - origprae = savestr (optarg); - break; - case 'c': - diff_type = CONTEXT_DIFF; - break; - case 'd': - if (chdir(optarg) < 0) - pfatal ("can't change directory to `%s'", optarg); - break; - case 'D': - do_defines = savestr (optarg); - break; - case 'e': - diff_type = ED_DIFF; - break; - case 'E': - remove_empty_files = TRUE; - break; - case 'f': - force = TRUE; - break; - case 'F': - maxfuzz = numeric_string (optarg, 0, "fuzz factor"); - break; - case 'g': - patch_get = numeric_string (optarg, 1, "get option value"); - break; - case 'i': - patchname = savestr (optarg); - break; - case 'l': - canonicalize = TRUE; - break; - case 'n': - diff_type = NORMAL_DIFF; - break; - case 'N': - noreverse = TRUE; - break; - case 'o': - if (strcmp (optarg, "-") == 0) - fatal ("can't output patches to standard output"); - outfile = savestr (optarg); - break; - case 'p': - strippath = numeric_string (optarg, 0, "strip count"); - break; - case 'r': - rejname = savestr (optarg); - break; - case 'R': - reverse = 1; - reverse_flag_specified = 1; - break; - case 's': - verbosity = SILENT; - break; - case 't': - batch = TRUE; - break; - case 'T': - set_time = 1; - break; - case 'u': - diff_type = UNI_DIFF; - break; - case 'v': - version(); - exit (0); - break; - case 'V': - version_control = optarg; - break; -#if DEBUGGING - case 'x': - debug = numeric_string (optarg, 1, "debugging option"); - break; -#endif - case 'Y': - if (!*optarg) - fatal ("backup basename prefix is empty"); - origbase = savestr (optarg); - break; - case 'z': - case_z: - if (!*optarg) - fatal ("backup suffix is empty"); - simple_backup_suffix = savestr (optarg); - break; - case 'Z': - set_utc = 1; - break; - case 129: - dry_run = TRUE; - break; - case 130: - verbosity = VERBOSE; - break; - case 131: -#if HAVE_SETMODE - binary_transput = O_BINARY; -#endif - break; - case 132: - usage (stdout, 0); - case 133: - backup_if_mismatch = 1; - break; - case 134: - backup_if_mismatch = 0; - break; - default: - usage (stderr, 2); - } - } - - /* Process any filename args. */ - if (optind < Argc) - { - inname = savestr (Argv[optind++]); - invc = -1; - if (optind < Argc) - { - patchname = savestr (Argv[optind++]); - if (optind < Argc) - { - fprintf (stderr, "%s: extra operand `%s'\n", - program_name, Argv[optind]); - usage (stderr, 2); - } - } - } -} - -/* Handle STRING (possibly negative if NEGATIVE_ALLOWED is nonzero) - of type ARGTYPE_MSGID by converting it to an integer, - returning the result. */ -static int -numeric_string (string, negative_allowed, argtype_msgid) - char const *string; - int negative_allowed; - char const *argtype_msgid; -{ - int value = 0; - char const *p = string; - int sign = *p == '-' ? -1 : 1; - - p += *p == '-' || *p == '+'; - - do - { - int v10 = value * 10; - int digit = *p - '0'; - int signed_digit = sign * digit; - int next_value = v10 + signed_digit; - - if (9 < (unsigned) digit) - fatal ("%s `%s' is not a number", argtype_msgid, string); - - if (v10 / 10 != value || (next_value < v10) != (signed_digit < 0)) - fatal ("%s `%s' is too large", argtype_msgid, string); - - value = next_value; - } - while (*++p); - - if (value < 0 && ! negative_allowed) - fatal ("%s `%s' is negative", argtype_msgid, string); - - return value; -} - -/* Attempt to find the right place to apply this hunk of patch. */ - -static LINENUM -locate_hunk(fuzz) -LINENUM fuzz; -{ - register LINENUM first_guess = pch_first () + last_offset; - register LINENUM offset; - LINENUM pat_lines = pch_ptrn_lines(); - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM prefix_fuzz = fuzz + prefix_context - context; - LINENUM suffix_fuzz = fuzz + suffix_context - context; - LINENUM max_where = input_lines - (pat_lines - suffix_fuzz) + 1; - LINENUM min_where = last_frozen_line + 1 - (prefix_context - prefix_fuzz); - LINENUM max_pos_offset = max_where - first_guess; - LINENUM max_neg_offset = first_guess - min_where; - LINENUM max_offset = (max_pos_offset < max_neg_offset - ? max_neg_offset : max_pos_offset); - - if (!pat_lines) /* null range matches always */ - return first_guess; - - /* Do not try lines <= 0. */ - if (first_guess <= max_neg_offset) - max_neg_offset = first_guess - 1; - - if (prefix_fuzz < 0) - { - /* Can only match start of file. */ - - if (suffix_fuzz < 0) - /* Can only match entire file. */ - if (pat_lines != input_lines || prefix_context < last_frozen_line) - return 0; - - offset = 1 - first_guess; - if (last_frozen_line <= prefix_context - && offset <= max_pos_offset - && patch_match (first_guess, offset, (LINENUM) 0, suffix_fuzz)) - { - last_offset = offset; - return first_guess + offset; - } - else - return 0; - } - - if (suffix_fuzz < 0) - { - /* Can only match end of file. */ - offset = first_guess - (input_lines - pat_lines + 1); - if (offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, (LINENUM) 0)) - { - last_offset = - offset; - return first_guess - offset; - } - else - return 0; - } - - for (offset = 0; offset <= max_offset; offset++) { - if (offset <= max_pos_offset - && patch_match (first_guess, offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %ld to %ld\n", last_offset, offset); - last_offset = offset; - return first_guess+offset; - } - if (0 < offset && offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %ld to %ld\n", last_offset, -offset); - last_offset = -offset; - return first_guess-offset; - } - } - return 0; -} - -/* We did not find the pattern, dump out the hunk so they can handle it. */ - -static void -abort_hunk() -{ - register LINENUM i; - register LINENUM pat_end = pch_end (); - /* add in last_offset to guess the same as the previous successful hunk */ - LINENUM oldfirst = pch_first() + last_offset; - LINENUM newfirst = pch_newfirst() + last_offset; - LINENUM oldlast = oldfirst + pch_ptrn_lines() - 1; - LINENUM newlast = newfirst + pch_repl_lines() - 1; - char const *stars = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : ""; - char const *minuses = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----"; - - fprintf(rejfp, "***************\n"); - for (i=0; i<=pat_end; i++) { - switch (pch_char(i)) { - case '*': - if (oldlast < oldfirst) - fprintf(rejfp, "*** 0%s\n", stars); - else if (oldlast == oldfirst) - fprintf(rejfp, "*** %ld%s\n", oldfirst, stars); - else - fprintf(rejfp, "*** %ld,%ld%s\n", oldfirst, oldlast, stars); - break; - case '=': - if (newlast < newfirst) - fprintf(rejfp, "--- 0%s\n", minuses); - else if (newlast == newfirst) - fprintf(rejfp, "--- %ld%s\n", newfirst, minuses); - else - fprintf(rejfp, "--- %ld,%ld%s\n", newfirst, newlast, minuses); - break; - case ' ': case '-': case '+': case '!': - fprintf (rejfp, "%c ", pch_char (i)); - /* fall into */ - case '\n': - pch_write_line (i, rejfp); - break; - default: - fatal ("fatal internal error in abort_hunk"); - } - if (ferror (rejfp)) - write_fatal (); - } -} - -/* We found where to apply it (we hope), so do it. */ - -static bool -apply_hunk (outstate, where) - struct outstate *outstate; - LINENUM where; -{ - register LINENUM old = 1; - register LINENUM lastline = pch_ptrn_lines (); - register LINENUM new = lastline+1; - register enum {OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE} def_state = OUTSIDE; - register char const *R_do_defines = do_defines; - register LINENUM pat_end = pch_end (); - register FILE *fp = outstate->ofp; - - where--; - while (pch_char(new) == '=' || pch_char(new) == '\n') - new++; - - while (old <= lastline) { - if (pch_char(old) == '-') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFNDEF; - } - else if (def_state == IN_IFDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->after_newline = pch_write_line (old, fp); - outstate->zero_output = 0; - } - last_frozen_line++; - old++; - } - else if (new > pat_end) { - break; - } - else if (pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - else if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - if (ferror (fp)) - write_fatal (); - } - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = 0; - new++; - } - else if (pch_char(new) != pch_char(old)) { - if (debug & 1) - say ("oldchar = '%c', newchar = '%c'\n", - pch_char (old), pch_char (new)); - fatal ("Out-of-sync patch, lines %ld,%ld -- mangled text or line numbers, maybe?", - pch_hunk_beg() + old, - pch_hunk_beg() + new); - } - else if (pch_char(new) == '!') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return FALSE; - assert (outstate->after_newline); - if (R_do_defines) { - fprintf (fp, not_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_IFNDEF; - } - - do - { - if (R_do_defines) { - outstate->after_newline = pch_write_line (old, fp); - } - last_frozen_line++; - old++; - } - while (pch_char (old) == '!'); - - if (R_do_defines) { - fprintf (fp, outstate->after_newline + else_defined); - if (ferror (fp)) - write_fatal (); - def_state = IN_ELSE; - } - - do - { - outstate->after_newline = pch_write_line (new, fp); - new++; - } - while (pch_char (new) == '!'); - outstate->zero_output = 0; - } - else { - assert(pch_char(new) == ' '); - old++; - new++; - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined, - R_do_defines); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = 1; - def_state = OUTSIDE; - } - } - } - if (new <= pat_end && pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return FALSE; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - else if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->zero_output = 0; - } - - do - { - if (! outstate->after_newline && putc ('\n', fp) == EOF) - write_fatal (); - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = 0; - new++; - } - while (new <= pat_end && pch_char (new) == '+'); - } - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = 1; - } - return TRUE; -} - -/* Create an output file. */ - -static FILE * -create_output_file (name) - char const *name; -{ - int fd = create_file (name, O_WRONLY | binary_transput, instat.st_mode); - FILE *f = fdopen (fd, binary_transput ? "wb" : "w"); - if (! f) - pfatal ("can't create `%s'", name); - return f; -} - -/* Open the new file. */ - -static void -init_output (name, outstate) - char const *name; - struct outstate *outstate; -{ - outstate->ofp = name ? create_output_file (name) : (FILE *) 0; - outstate->after_newline = 1; - outstate->zero_output = 1; -} - -/* Open a file to put hunks we can't locate. */ - -static void -init_reject(name) - char const *name; -{ - rejfp = create_output_file (name); -} - -/* Copy input file to output, up to wherever hunk is to be applied. */ - -static bool -copy_till (outstate, lastline) - register struct outstate *outstate; - register LINENUM lastline; -{ - register LINENUM R_last_frozen_line = last_frozen_line; - register FILE *fp = outstate->ofp; - register char const *s; - size_t size; - - if (R_last_frozen_line > lastline) - { - say ("misordered hunks! output would be garbled\n"); - return FALSE; - } - while (R_last_frozen_line < lastline) - { - s = ifetch (++R_last_frozen_line, 0, &size); - if (size) - { - if ((! outstate->after_newline && putc ('\n', fp) == EOF) - || ! fwrite (s, sizeof *s, size, fp)) - write_fatal (); - outstate->after_newline = s[size - 1] == '\n'; - outstate->zero_output = 0; - } - } - last_frozen_line = R_last_frozen_line; - return TRUE; -} - -/* Finish copying the input file to the output file. */ - -static bool -spew_output (outstate) - struct outstate *outstate; -{ - if (debug & 256) - say ("il=%ld lfl=%ld\n", input_lines, last_frozen_line); - - if (last_frozen_line < input_lines) - if (! copy_till (outstate, input_lines)) - return FALSE; - - if (outstate->ofp && ! outfile) - { - if (fclose (outstate->ofp) != 0) - write_fatal (); - outstate->ofp = 0; - } - - return TRUE; -} - -/* Does the patch pattern match at line base+offset? */ - -static bool -patch_match (base, offset, prefix_fuzz, suffix_fuzz) -LINENUM base; -LINENUM offset; -LINENUM prefix_fuzz; -LINENUM suffix_fuzz; -{ - register LINENUM pline = 1 + prefix_fuzz; - register LINENUM iline; - register LINENUM pat_lines = pch_ptrn_lines () - suffix_fuzz; - size_t size; - register char const *p; - - for (iline=base+offset+prefix_fuzz; pline <= pat_lines; pline++,iline++) { - p = ifetch (iline, offset >= 0, &size); - if (canonicalize) { - if (!similar(p, size, - pfetch(pline), - pch_line_len(pline) )) - return FALSE; - } - else if (size != pch_line_len (pline) - || memcmp (p, pfetch (pline), size) != 0) - return FALSE; - } - return TRUE; -} - -/* Do two lines match with canonicalized white space? */ - -static bool -similar (a, alen, b, blen) - register char const *a; - register size_t alen; - register char const *b; - register size_t blen; -{ - /* Ignore presence or absence of trailing newlines. */ - alen -= alen && a[alen - 1] == '\n'; - blen -= blen && b[blen - 1] == '\n'; - - for (;;) - { - if (!blen || (*b == ' ' || *b == '\t')) - { - while (blen && (*b == ' ' || *b == '\t')) - b++, blen--; - if (alen) - { - if (!(*a == ' ' || *a == '\t')) - return FALSE; - do a++, alen--; - while (alen && (*a == ' ' || *a == '\t')); - } - if (!alen || !blen) - return alen == blen; - } - else if (!alen || *a++ != *b++) - return FALSE; - else - alen--, blen--; - } -} - -/* Make a temporary file. */ - -#if HAVE_MKTEMP -char *mktemp PARAMS ((char *)); -#endif - -#ifndef TMPDIR -#define TMPDIR "/tmp" -#endif - -static char const * -make_temp (letter) - int letter; -{ - char *r; -#if HAVE_MKTEMP - char const *tmpdir = getenv ("TMPDIR"); /* Unix tradition */ - if (!tmpdir) tmpdir = getenv ("TMP"); /* DOS tradition */ - if (!tmpdir) tmpdir = getenv ("TEMP"); /* another DOS tradition */ - if (!tmpdir) tmpdir = TMPDIR; - r = xmalloc (strlen (tmpdir) + 10); - sprintf (r, "%s/p%cXXXXXX", tmpdir, letter); - mktemp (r); - if (!*r) - pfatal ("mktemp"); -#else - r = xmalloc (L_tmpnam); - if (! (tmpnam (r) == r && *r)) - pfatal ("tmpnam"); -#endif - return r; -} - -/* Fatal exit with cleanup. */ - -void -fatal_exit (sig) - int sig; -{ - cleanup (); - - if (sig) - exit_with_signal (sig); - - exit (2); -} - -static void -cleanup () -{ - unlink (TMPINNAME); - unlink (TMPOUTNAME); - unlink (TMPPATNAME); - unlink (TMPREJNAME); -} Property changes on: vendor/misc-GNU/patch/2.5/patch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/README =================================================================== --- vendor/misc-GNU/patch/2.5/README (revision 358868) +++ vendor/misc-GNU/patch/2.5/README (nonexistent) @@ -1,52 +0,0 @@ -This version of `patch' has many changes made by the Free Software Foundation. -They add support for: - * handling arbitrary binary data and large files - * the unified context diff format that GNU diff can produce - * making GNU Emacs-style backup files - * improved interaction with RCS and SCCS - * the GNU conventions for option parsing and configuring and compilation. - * better POSIX.2 compliance -They also fix some bugs. See the NEWS and ChangeLog files for details. - -Tutorial-style documentation for patch is included in the GNU -diffutils package. Unfortunately, the diffutils 2.7 documentation -for `patch' is obsolete; this should be fixed in diffutils 2.8. -In the mean time, see `patch --help', or consult the man page -in this distribution. - -For GNU and Unix build and installation instructions, see the file INSTALL. -For MS-DOS using DJGPP tools, see the file pc/djgpp/README. -For other systems, copy config.hin to config.h and change -#undef statements in it to #define as appropriate for your system, -and copy Makefile.in to Makefile and set the variables that are -enclosed in @ signs as appropriate for your system. - -Please send bug reports for this version of patch to -bug-gnu-utils@prep.ai.mit.edu. - -The Free Software Foundation is distributing this version of patch -independently because as of this writing, Larry Wall has not released a -new version of patch since mid-1988. We have heard that he has been -too busy working on other things, like Perl. He has graciously agreed -to let GNU `patch' be distributed under the terms of the GNU General -Public License. - ------- - -Copyright 1984, 1985, 1986, 1987, 1988 Larry Wall -Copyright 1989, 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this file; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/2.5/README ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/inp.c =================================================================== --- vendor/misc-GNU/patch/2.5/inp.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/inp.c (nonexistent) @@ -1,462 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.c,v 1.18 1997/07/21 17:59:46 eggert Exp $ */ - -/* -Copyright 1986, 1988 Larry Wall -Copyright 1991, 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -/* Input-file-with-indexable-lines abstract type */ - -static char *i_buffer; /* plan A buffer */ -static char const **i_ptr; /* pointers to lines in plan A buffer */ - -static size_t tibufsize; /* size of plan b buffers */ -#ifndef TIBUFSIZE_MINIMUM -#define TIBUFSIZE_MINIMUM (8 * 1024) /* minimum value for tibufsize */ -#endif -static int tifd = -1; /* plan b virtual string array */ -static char *tibuf[2]; /* plan b buffers */ -static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ -static LINENUM lines_per_buf; /* how many lines per buffer */ -static size_t tireclen; /* length of records in tmp file */ -static size_t last_line_size; /* size of last input line */ - -static bool plan_a PARAMS ((char const *));/* yield FALSE if memory runs out */ -static void plan_b PARAMS ((char const *)); -static void report_revision PARAMS ((int)); -static void too_many_lines PARAMS ((char const *)) __attribute__((noreturn)); - -/* New patch--prepare to edit another file. */ - -void -re_input() -{ - if (using_plan_a) { - free (i_buffer); - free (i_ptr); - } - else { - close (tifd); - tifd = -1; - free(tibuf[0]); - tibuf[0] = 0; - tiline[0] = tiline[1] = -1; - tireclen = 0; - } -} - -/* Construct the line index, somehow or other. */ - -void -scan_input(filename) -char *filename; -{ - using_plan_a = ! (debug & 16) && plan_a (filename); - if (!using_plan_a) - plan_b(filename); - switch (verbosity) - { - case SILENT: - break; - - case VERBOSE: - say ("Patching file `%s' using Plan %s...\n", - filename, using_plan_a ? "A" : "B"); - break; - - case DEFAULT_VERBOSITY: - say ("patching file `%s'\n", filename); - break; - } -} - -/* Report whether a desired revision was found. */ - -static void -report_revision (found_revision) - int found_revision; -{ - if (found_revision) - { - if (verbosity == VERBOSE) - say ("Good. This file appears to be the %s version.\n", revision); - } - else if (force) - { - if (verbosity != SILENT) - say ("Warning: this file doesn't appear to be the %s version -- patching anyway.\n", - revision); - } - else if (batch) - { - fatal ("This file doesn't appear to be the %s version -- aborting.", - revision); - } - else - { - ask ("This file doesn't appear to be the %s version -- patch anyway? [n] ", - revision); - if (*buf != 'y') - fatal ("aborted"); - } -} - - -static void -too_many_lines (filename) - char const *filename; -{ - fatal ("File `%s' has too many lines.", filename); -} - - -void -get_input_file (filename, outname) - char const *filename; - char const *outname; -{ - int elsewhere = strcmp (filename, outname); - char const *cs; - char *diffbuf; - char *getbuf; - - if (inerrno == -1) - inerrno = stat (inname, &instat) == 0 ? 0 : errno; - - /* Perhaps look for RCS or SCCS versions. */ - if (patch_get - && invc != 0 - && (inerrno - || (! elsewhere - && (/* No one can write to it. */ - (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0 - /* Only the owner (who's not me) can write to it. */ - || ((instat.st_mode & (S_IWGRP|S_IWOTH)) == 0 - && instat.st_uid != geteuid ())))) - && (invc = !! (cs = (version_controller - (filename, elsewhere, - inerrno ? (struct stat *) 0 : &instat, - &getbuf, &diffbuf))))) { - - if (!inerrno) { - if (!elsewhere - && (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) != 0) - /* Somebody can write to it. */ - fatal ("file `%s' seems to be locked by somebody else under %s", - filename, cs); - /* It might be checked out unlocked. See if it's safe to - check out the default version locked. */ - if (verbosity == VERBOSE) - say ("Comparing file `%s' to default %s version...\n", - filename, cs); - if (systemic (diffbuf) != 0) - { - say ("warning: patching file `%s', which does not match default %s version\n", - filename, cs); - cs = 0; - } - } - - if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, - &instat)) - inerrno = 0; - - free (getbuf); - free (diffbuf); - - } else if (inerrno && !pch_says_nonexistent (reverse)) - { - errno = inerrno; - pfatal ("can't find file `%s'", filename); - } - - if (inerrno) - { - instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; - instat.st_size = 0; - } - else if (! S_ISREG (instat.st_mode)) - fatal ("`%s' is not a regular file -- can't patch", filename); -} - - -/* Try keeping everything in memory. */ - -static bool -plan_a(filename) - char const *filename; -{ - register char const *s; - register char const *lim; - register char const **ptr; - register char *buffer; - register LINENUM iline; - size_t size = instat.st_size; - - /* Fail if the file size doesn't fit in a size_t, - or if storage isn't available. */ - if (! (size == instat.st_size - && (buffer = malloc (size ? size : (size_t) 1)))) - return FALSE; - - /* Read the input file, but don't bother reading it if it's empty. - When creating files, the files do not actually exist. */ - if (size) - { - int ifd = open (filename, O_RDONLY|binary_transput); - size_t buffered = 0, n; - if (ifd < 0) - pfatal ("can't open file `%s'", filename); - - while (size - buffered != 0) - { - n = read (ifd, buffer + buffered, size - buffered); - if (n == 0) - { - /* Some non-POSIX hosts exaggerate st_size in text mode; - or the file may have shrunk! */ - size = buffered; - break; - } - if (n == (size_t) -1) - { - /* Perhaps size is too large for this host. */ - close (ifd); - free (buffer); - return FALSE; - } - buffered += n; - } - - if (close (ifd) != 0) - read_fatal (); - } - - /* Scan the buffer and build array of pointers to lines. */ - lim = buffer + size; - iline = 3; /* 1 unused, 1 for SOF, 1 for EOF if last line is incomplete */ - for (s = buffer; (s = (char *) memchr (s, '\n', lim - s)); s++) - if (++iline < 0) - too_many_lines (filename); - if (! (iline == (size_t) iline - && (size_t) iline * sizeof *ptr / sizeof *ptr == (size_t) iline - && (ptr = (char const **) malloc ((size_t) iline * sizeof *ptr)))) - { - free (buffer); - return FALSE; - } - iline = 0; - for (s = buffer; ; s++) - { - ptr[++iline] = s; - if (! (s = (char *) memchr (s, '\n', lim - s))) - break; - } - if (size && lim[-1] != '\n') - ptr[++iline] = lim; - input_lines = iline - 1; - - if (revision) - { - char const *rev = revision; - int rev0 = rev[0]; - int found_revision = 0; - size_t revlen = strlen (rev); - - if (revlen <= size) - { - char const *limrev = lim - revlen; - - for (s = buffer; (s = (char *) memchr (s, rev0, limrev - s)); s++) - if (memcmp (s, rev, revlen) == 0 - && (s == buffer || ISSPACE ((unsigned char) s[-1])) - && (s + 1 == limrev || ISSPACE ((unsigned char) s[revlen]))) - { - found_revision = 1; - break; - } - } - - report_revision (found_revision); - } - - /* Plan A will work. */ - i_buffer = buffer; - i_ptr = ptr; - return TRUE; -} - -/* Keep (virtually) nothing in memory. */ - -static void -plan_b(filename) - char const *filename; -{ - register FILE *ifp; - register int c; - register size_t len; - register size_t maxlen; - register int found_revision; - register size_t i; - register char const *rev; - register size_t revlen; - register LINENUM line = 1; - - if (instat.st_size == 0) - filename = NULL_DEVICE; - if (! (ifp = fopen (filename, binary_transput ? "rb" : "r"))) - pfatal ("can't open file `%s'", filename); - tifd = create_file (TMPINNAME, O_RDWR | O_BINARY, (mode_t) 0); - i = 0; - len = 0; - maxlen = 1; - rev = revision; - found_revision = !rev; - revlen = rev ? strlen (rev) : 0; - - while ((c = getc (ifp)) != EOF) - { - len++; - - if (c == '\n') - { - if (++line < 0) - too_many_lines (filename); - if (maxlen < len) - maxlen = len; - len = 0; - } - - if (!found_revision) - { - if (i == revlen) - { - found_revision = ISSPACE ((unsigned char) c); - i = (size_t) -1; - } - else if (i != (size_t) -1) - i = rev[i]==c ? i + 1 : (size_t) -1; - - if (i == (size_t) -1 && ISSPACE ((unsigned char) c)) - i = 0; - } - } - - if (revision) - report_revision (found_revision); - Fseek (ifp, (off_t) 0, SEEK_SET); /* rewind file */ - for (tibufsize = TIBUFSIZE_MINIMUM; tibufsize < maxlen; tibufsize <<= 1) - continue; - lines_per_buf = tibufsize / maxlen; - tireclen = maxlen; - tibuf[0] = xmalloc (2 * tibufsize); - tibuf[1] = tibuf[0] + tibufsize; - - for (line = 1; ; line++) - { - char *p = tibuf[0] + maxlen * (line % lines_per_buf); - char const *p0 = p; - if (! (line % lines_per_buf)) /* new block */ - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - if ((c = getc (ifp)) == EOF) - break; - - for (;;) - { - *p++ = c; - if (c == '\n') - { - last_line_size = p - p0; - break; - } - - if ((c = getc (ifp)) == EOF) - { - last_line_size = p - p0; - line++; - goto EOF_reached; - } - } - } - EOF_reached: - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - - if (line % lines_per_buf != 0) - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - input_lines = line - 1; -} - -/* Fetch a line from the input file. */ - -char const * -ifetch (line, whichbuf, psize) -register LINENUM line; -int whichbuf; /* ignored when file in memory */ -size_t *psize; -{ - register char const *q; - register char const *p; - - if (line < 1 || line > input_lines) { - *psize = 0; - return ""; - } - if (using_plan_a) { - p = i_ptr[line]; - *psize = i_ptr[line + 1] - p; - return p; - } else { - LINENUM offline = line % lines_per_buf; - LINENUM baseline = line - offline; - - if (tiline[0] == baseline) - whichbuf = 0; - else if (tiline[1] == baseline) - whichbuf = 1; - else { - tiline[whichbuf] = baseline; - if (lseek (tifd, (off_t) (baseline/lines_per_buf * tibufsize), - SEEK_SET) == -1 - || read (tifd, tibuf[whichbuf], tibufsize) < 0) - read_fatal (); - } - p = tibuf[whichbuf] + (tireclen*offline); - if (line == input_lines) - *psize = last_line_size; - else { - for (q = p; *q++ != '\n'; ) - continue; - *psize = q - p; - } - return p; - } -} Property changes on: vendor/misc-GNU/patch/2.5/inp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/ChangeLog =================================================================== --- vendor/misc-GNU/patch/2.5/ChangeLog (revision 358868) +++ vendor/misc-GNU/patch/2.5/ChangeLog (nonexistent) @@ -1,1704 +0,0 @@ -1997-08-31 Paul Eggert - - * configure.in (VERSION): Version 2.5 released. - -1997-07-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.4. - * pch.c (there_is_another_patch), NEWS: Report an error if the patch - input contains garbage but no patches. - - * pch.c (open_patch_file): - Check for patch file too long (i.e., its size - doesn't fit in a `long', and LFS isn't available). - - * inp.c (plan_a): - Cast malloc return value, in case malloc returns char *. - -1997-07-16 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.3. - - * NEWS, patch.man, pch.c (intuit_diff_type, get_line, pget_line): - Now demangles RFC 934 encapsulation. - * pch.c (p_rfc934_nesting): New var. - - * pch.c (intuit_diff_type): Don't bother to check file names carefully - if we're going to return NO_DIFF. - - * inp.c (plan_a): Count the number of lines before allocating - pointer-to-line buffer; this reduces memory requirements - considerably (roughly by a factor of 5 on 32-bit hosts). - Decrease `size' only when read unexpectedly reports EOF. - (i_buffer): New var. - (too_many_lines): New fn. - (re_input): Free i_buffer if using plan A. - Free buffers unconditionally; they can't be zero. - - * inp.c (plan_a, plan_b): Check for overflow of line counter. - - * pch.c (malformed), util.h (memory_fatal, read_fatal, write_fatal): - Declare as noreturn. - -1997-07-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.2. - - * util.c (ok_to_reverse), NEWS: The default answer is now `n'; - this is better for Emacs. - - * Makefile.in (dist): Use cp -p, not ln; - some hosts do the wrong thing with ln if the source is a symbolic link. - - * patch.man: Fix typo: -y -> -Y. - -1997-07-05 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.1. - - * patch.c: (main, get_some_switches), NEWS, patch.man: - Version control is now independent of whether backups are made. - * patch.c (option_help): Put version control options together. - (get_some_switches): With CVS 1.9 hack, treat -b foo like -b -z foo, - not just -z foo. This change is needed due to recent change in -z. - * backupfile.c (find_backup_file_name): - backup_type == none causes undefined behavior; - this undoes the previous change to this file. - - * patch.c (locate_hunk): Fix bug when locating context diff hunks - near end of file with nonzero fuzz. - - * util.c (move_file): Don't assume that ENOENT is reported when both - ENOENT and EXDEV apply; this isn't true with DJGPP, and - Posix doesn't require it. - - * pch.c (there_is_another_patch): - Suggest -p when we can't intuit a file. - -1997-06-19 Paul Eggert - - * configure.in (VERSION): Version 2.4 released. - * NEWS: Patch is now verbose when patches do not match exactly. - -1997-06-17 Paul Eggert - - * pc/djgpp/configure.sed (config.h): Remove redundant $(srcdir). - - * configure.in (VERSION): Bump to 2.3.9. - * patch.c (main): By default, warn about hunks that succeed - with nonzero offset. - * patch.man: Add LC_ALL=C advice for making patches. - * pc/djgpp/configure.sed (config.h): Fix paths to dependent files. - -1997-06-17 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.8. - - * pch.c (open_patch_file): Test stdin for fseekability. - (intuit_diff_type): Missing context diff headers are now warnings, - not errors; some people use patches with them (e.g. when retrying - rejects). - - * patch.c (struct outstate): - New type, collecting together some output state vars. - (apply_hunk, copy_till, spew_output, init_output): Use it. - Keep track of whether some output has been generated. - (backup_if_mismatch): New var. - (ofp): Remove, in favor of local struct outstate vars. - (main): Use struct outstate. Initialize backup_if_mismatch to - be the inverse of posixly_correct. Keep track of whether mismatches - occur, and use this to implement backup_if_mismatch. - Report files that are not empty after patching, but should be. - (longopts, option_help, get_some_switches): New options - --backup-if-mismatch, --no-backup-if-mismatch. - (get_some_switches): -B, -Y, -z no longer set backup_type. - * backupfile.c (find_backup_file_name): - Treat backup_type == none like simple. - - * Makefile.in (CONFIG_HDRS): - Remove var; no longer needed by djgpp port. - (DISTFILES_PC_DJGPP): Rename pc/djgpp/config.sed to - pc/djgpp/configure.sed; remove pc/djgpp/config.h in favor of - new file that edits it, called pc/djgpp/config.sed. - * pc/djgpp/configure.bat: Rename config.sed to configure.sed. - * pc/djgpp/configure.sed (CONFIG_HDRS): Remove. - (config.h): Add rule to build this from config.hin and - pc/djgpp/config.sed. - * pc/djgpp/config.sed: - Convert from .h file to .sed script that generates .h file. - - * NEWS: Describe --backup-if-mismatch, --no-backup-if-mismatch. - * patch.man: - Describe new options --backup-if-mismatch, --no-backup-if-mismatch - and their ramifications. Use unreadable backup to represent - nonexistent file. - -1997-06-12 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.7. - (AC_CHECK_FUNCS): Add `raise'. - - * Makefile.in (inp.o): No longer depends on quotearg.h. - - * common.h (outfile): New decl (was private var named `output'). - (invc): New decl. - (GENERIC_OBJECT): Renamed from VOID. - (NULL_DEVICE, TTY_DEVICE): New macros. - - * patch.c (output): Remove; renamed to `outfile' and moved to common.h. - (main): `failed' is count, not boolean. - Say "Skipping patch." when deciding to skip patch. - (get_some_switches): Set invc when setting inname. - - * inp.c: Do not include . - (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF1, SCCSDIFF2, SCCSDIFF3, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1, RCSDIFF2): - Move to util.c. - (get_input_file): Invoke new functions version_controller and - version_get to simplify this code. - (plan_b): "/dev/tty" -> NULL_DEVICE - - * pch.h (pch_timestamp): New decl. - * pch.c (p_timestamp): New var; takes over from global timestamp array. - (pch_timestamp): New function to export p_timestamp. - (there_is_another_patch): Use blander wording when you can't intuit - the file name. - Say "Skipping patch." when deciding to skip patch. - (intuit_diff_type): Look for version-controlled but nonexistent files - when intuiting file names; set invc accordingly. - Ignore Index: line if either old or new line is present, and if - POSIXLY_CORRECT is not set. - (do_ed_script): Flush stdout before invoking popen, since it may - send output to stdout. - - * util.h (version_controller, version_get): New decls. - * util.c: Include earlier. - (raise): New macro, if ! HAVE_RAISE. - (move_file): Create empty unreadable file when backing up a nonexistent - file. - (DEV_NULL): New constant. - (SCCSPREFIX, GET. GET_LOCKED, SCCSDIFF1, SCCSDIFF2, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c. - (version_controller, version_get): New functions. - (ask): Look only at /dev/tty for answers; and when standard output is - not a terminal and ! posixly_correct, don't even look there. - Remove unnecessary fflushes of stdout. - (ok_to_reverse): Say "Skipping patch." when deciding to skip patch.. - (sigs): SIGPIPE might not be defined. - (exit_with_signal): Use `raise' instead of `kill'. - (systemic): fflush stdout before invoking subsidiary command. - - * patch.man: Document recent changes. - Add "COMPATIBILITY ISSUES" section. - - * NEWS: New COMPATIBILITY ISSUES for man page. - Changed verbosity when fuzz is found. - File name intuition is changed, again. - Backups are made unreadable when the file did not exist. - - * pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): Define. - (HAVE_RAISE): New macro. - (HAVE_UTIME_H): Define. - (TZ_is_unset): Do not define; it's not a serious problem with `patch' - to have TZ be unset in DOS. - -1997-06-08 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.6. - (AC_CHECK_HEADERS): Add utime.h. - * acconfig.h, configure.in, pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): - New macro. - * pc/djgpp/config.h (HAVE_UTIME_H, TZ_is_unset): New macros. - - * NEWS, patch.man: Describe new -Z, -T options, new numeric - option for -G, retired -G, and more verbose default behavior - with fuzz. - - * pch.c (intuit_diff_type): Record times reported for files in headers. - Remove head_says_nonexistent[x], since it's now equivalent to - !timestamp[x]. - * util.h (fetchname): Change argument head_says_nonexistent to - timestamp. - * util.c: #include for TM_LOCAL_ZONE. - Don't include since common.h now includes it. - (ok_to_reverse): noreverse and batch cases now output regardless of - verbosity. - (fetchname): Change argument head_says_nonexistent to pstamp, and - store header timestamp into *pstamp. - If -T or -Z option is given, match time stamps more precisely. - (ask): Remove unnecessary close of ttyfd. - When there is no terminal at all, output a newline to make the - output look nicer. After reporting EOF, flush stdout; - when an input error, report the error type. - - * inp.c (get_input_file): - Ask user whether to get file if patch_get is negative. - - * Makefile.in (clean): Don't clean */*.o; clean core* and *core. - -1997-06-04 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.5. - - * util.c (ok_to_reverse): - Be less chatty if verbosity is SILENT and we don't - have to ask the user. If force is nonzero, apply the patch anyway. - - * pch.c (there_is_another_patch): - Before skipping rest of patch, skip to - the patch start, so that another_hunk can skip it properly. - (intuit_diff_type): Slight wording change for missing headers, to - regularize with other diagnostics. Fix off-by-one error when setting - p_input_line when scanning the first hunk to check for deleted files. - -1997-06-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.4. - - * NEWS: Now matches more generously against nonexistent or empty files. - - * pch.c (there_is_another_patch): Move warning about not being - able to intuit file names here from skip_to. - (intuit_diff_type): Fatal error if we find a headless unified - or context diff. - - * util.c (ask): Null-terminate buffer properly even if it grew. - (fetchname): No need to test for null first argument. - -1997-06-02 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.3. - * pch.c (p_says_nonexistent, pch_says_nonexistent): Is now 1 for empty, - 2 for nonexistent. - (intuit_diff_type): Set p_says_nonexistent according to new meaning. - Treat empty files like nonexistent files when reversing. - (skip_to): Output better diagnostic when we can't intuit a file name. - * patch.c (main): - Count bytes, not lines, when testing whether a file is empty, - since it may contain only non-newline chars. - pch_says_nonexistent now returns 2 for nonexistent files. - -1997-06-01 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.2. - * pch.c (open_patch_file): - Fix bug when computing size of patch read from a pipe. - -1997-05-30 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.1. - - * Makefile.in (transform, patch_name): New vars, - for proper implementation of AC_ARG_PROGRAM. - (install, uninstall): Use them. - (install-strip): New rule. - * pc/djgpp/config.sed (program_transform_name): Set to empty. - -1997-05-30 Paul Eggert - - * configure.in (VERSION), NEWS: Version 2.3 released. - * patch.man: Fix two font typos. - * util.c (doprogram): Fix misspelled decl. - -1997-05-26 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.93. - - * pch.c (open_patch_file): - Fatal error if binary_transput and stdin is a tty. - - * pc/djgpp/config.sed (chdirsaf.c): - Use sed instead of cp, since cp might not be installed. - * pc/djgpp/configure.bat: - Prepend %srcdir% to pathname of config.sed, for crosscompiles. - -1997-05-25 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.92. - (D_INO_IN_DIRENT): New macro. - * pc/djgpp/config.h, acconfig.h (D_INO_IN_DIRENT): New macro. - * backupfile.c (REAL_DIR_ENTRY): - Depend on D_INO_IN_DIRENT, not _POSIX_VERSION. - - * addext.c (addext): Adjust slen when adjusting s for DOS 8.3 limit. - Do not use xxx.h -> xxxh~ hack. - - * util.c: (move_file): Avoid makedirs test when possible even - if FILESYSTEM_PREFIX_LEN (p) is nonzero. Don't play - case-changing tricks to come up with backup file name; it's - not portable to case-insensitive file systems. - * common.h (ISLOWER): Remove. - - * inp.c (scan_input): Don't use Plan A if (debug & 16). - - * patch.c (shortopts): Add -g, -G. - (longopts): --help now maps to 132, not 'h', to avoid confusion. - (get_some_switches): Likewise. - Don't invoke setmode on input if --binary; wait until needed. - Don't ever invoke setmode on stdout. - * pch.c (open_patch_file): Setmode stdin to binary if binary_transput. - - * patch.man: Fix documentation of backup file name to match behavior. - Add advice for ordering of patches of derived files. - Add /dev/tty to list of files used. - * README: Adjust instructions for building on DOS. - * pc/djgpp/README: Remove tentative wording. - * NEWS: The DOS port is now tested. - Backup file names are no longer computed by switching case. - - * pc/chdirsaf.c (ERANGE): Include to define it. - (restore_wd): chdir unconditionally. - (chdir_safer): Invoke atexit successfully at most once. - * pc/djgpp/config.sed: Use chdirsaf.o, not pc/chdirsaf.o. - Replace CONFIG_HDRS, don't append. - Use $(srcdir) in CONFIG_STATUS. - Don't apply $(SHELL) to $(CONFIG_STATUS). - Append rules for chdirsaf.o, chdirsaf.c; clean chdirsaf.c at the end. - * pc/djgpp/configure.bat: Append CR to each line; DOS needs this. - Don't use | as sed s delimiter; DOS can't handle it. - -1997-05-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.91. - - * pch.c (another_hunk): - Fix bug with computing size of prefix and suffix context - with ordinary context diffs. Report malformed patch if a unified diff - has nothing but context. - - * inp.c (get_input_file): - Use patch_get, not backup_type, to decide whether to - get from RCS or SCCS. Use the word `get' in diagnostics. - * patch.c (main): Initialize patch_get from PATCH_GET. - Omit DEFAULT_VERSION_CONTROL hook; it just leads to nonstandarization. - (longopts, option_help, get_some_switches): Add support for -g, -G. - (option_help): Add bug report address. - * common.h (patch_get): New decl. - * patch.man: Add -g and -G options; use `get' instead of `check out'. - Add PATCH_GET. Recommend -Naur instead of -raNU2 for diff. - * NEWS: Describe -g, -G, PATCH_GET. - - * version.c (copyright_string): Use only most recent copyright year, - as per GNU standards. - - * Makefile.in (DISTFILES_PC): Remove pc/quotearg.c. - * pc/djgpp/config.sed: Remove unnecessary hooks for quotearg and SHELL. - -1997-05-18 Paul Eggert - - * configure.in (VERSION): Increase to 2.2.9. - (AC_TYPE_MODE_T): Add. - - * pch.h (another_hunk): New parameter REV. - * pch.c (hunkmax): Now of type LINENUM. - (malformed): Add decl. - (there_is_another_patch): Skip inname-detection if skip_rest_of_patch. - (intuit_diff_type): To determine whether file appears to have been - deleted, look at replacement, not pattern. - If there is a mismatch between existence of file and whether the - patch claims to change whether the file exists, ask whether to - reverse the patch. - (another_hunk): New parameter REV specifying whether to reverse the - hunk. All callers changed. - (do_ed_script): Add assertion to ensure input file exists. - - * util.h (create_file): New function. - (copy_file): Now takes mode, not struct stat. - (makedirs): No longer exported. - (move_file): Now takes mode, not struct stat. - * util.c (makedirs): No longer exported. - (move_file): Accept mode of destination, not struct stat. - All callers changed. - Quote file names in diagnostics. - Create parent dir of destination if necessary. - Don't use ENOTDIR. - Don't unlink source; it will be unlinked later. - Unlink destination if FROM is zero. - (create_file): New function. - (copy_file): Accept mode of destination, not struct stat. - All callers changed. - Use create_file to create file. - (ok_to_reverse): Moved here from patch.c. Now accepts format and args; - all callers changed. - (mkdir): 2nd arg is now mode_t, for better compatibility. - (replace_slashes): Ignore slashes at the end of the filename. - - * common.h (noreverse): New decl. - (ok_to_reverse): Remove decl. - - * patch.c (noreverse): Now extern. - (main): New environment var PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - Don't assert(hunk) if we're skipping the patch; we may not have any hunks. - When removing a file, back it up if backups are desired. - Don't chmod output file if input file did not exist. - chmod rej file to input file's mode minus executable bits. - (locate_hunk): Go back to old way of a single fuzz parameter, but - handle it more precisely: context diffs with partial contexts - can only match file ends, since the partial context can occur - only at the start or end of file. - All callers changed. - (create_output_file): Use create_file to create files. - (ok_to_reverse): Move to util.c. - - * inp.c (scan_input, get_input_file): Quote file names in diagnostics. - (get_input_file): Set inerrno if it's not already set. - Don't create file; it's now the caller's responsibility. - (plan_b): Use /dev/null if input size is zero, since it might not exist. - Use create_file to create temporary file. - - * NEWS: Add PATCH_VERSION_CONTROL; DOS port is untested. - - * pc/djgpp/config.h: Add comment for mode_t. - - * pc/djgpp/README: Note that it's not tested. - - * patch.man: PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - -1997-05-15 Paul Eggert - - * configure.in: Add AC_PREREQ(2.12). - (VERSION): Bump to 2.2.8. - (ed_PROGRAM): Rename from ED_PROGRAM. - - * pch.c (prefix_components): Support DOS file names better. - Fix typo that caused fn to almost always yield 0. - - * util.c (, ): Include. - (move_file, copy_file): Add support for DOS filenames. - Preserve mode of input files when creating temp files. - Add binary file support. - (doprogram, rmdir): New functions. - (mkdir): Use doprogram. - (replace_slashes): Add support for DOS filenames. - (removedirs): New function. - (init_time)): New function. - (initial_time): New var. - (fetchname): Add support for deleted files, DOS filenames. - - * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): - New macros, for DOS port. - (base_name): Use them. - - * addext.c (HAVE_DOS_FILE_NAMES): New macro. - : Include if HAVE_LIMITS_H. - (addext): Handle hosts with DOS file name limits. - - * common.h (LONG_MIN): New macro. - (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. - (ok_to_create_file): Remove. - (reverse): Now int. - (ok_to_reverse): New function decl. - (O_WRONLY, _O_BINARY, O_BINARY, O_CREAT, O_TRUNC): New macros. - (binary_transput): New var decl. - - * Makefile.in (ed_PROGRAM): Renamed from ED_PROGRAM. - (CONFIG_HDRS, CONFIG_STATUS): New vars. - (SRCS): Add maketime.c, partime.c. - (OBJS): Likewise. - (HDRS): Add maketime.h, partime.h. - (DISTFILES_PC, DISTFILES_PC_DJGPP): New vars. - (Makefile, config.status): Use CONFIG_STATUS, not config.status. - (clean): Remove */*.o. - (dist): Add pc and pc/djgpp subdirectories. - ($(OBJS)): Depend on $(CONFIG_HDRS) instead of config.h. - (maketime.o, partime.o): New rules. - (util.o): Depend on maketime.h. - - * patch.c (main): - Call init_time. Add DEFAULT_VERSION_CONTROL hook for people who - prefer the old ways. Build temp file names before we might invoke cleanup. - Add support for deleted files and clean up the patch-swapping code a bit. - Delete empty ancestors of deleted files. - When creating temporaries, use file modes of original files. - (longopts, get_some_switches): New option --binary. - (get_some_switches): Report non-errno errors with `fatal', not `pfatal'. - (create_output_file): New function, which preserves modes of original files - and supports binary transput. - (init_output, init_reject): Use it. - (ok_to_reverse): New function. - (TMPDIR): New macro. - (make_temp): Use $TMPDIR, $TMP, $TEMP, or TMPDIR, whichever comes first. - - * pch.c (p_says_nonexistent): New var. - (open_patch_file): Add binary transput support. - Apply stat to file names retrieved from user. - Reject them if they don't exist. - (intuit_diff_type): Add support for deleting files. - Don't treat trivial directories any differently. - Avoid stating the same file twice in common case of context diffs. - (prefix_components): Don't treat trivial directories any differently. - Add support for DOS filenames. - (pch_says_nonexistent): New function. - (do_ed_script): Preserve mode of input files when creating temp files. - Add support for binary transput. - - * pch.h (pch_says_nonexistent): New decl. - - * util.h (replace_slashes): No longer exported. - (fetchname): Add support for deleted files. - (copy_file, move_file): Add support for preserving file modes. - (init_time, removedirs): New functions. - - * argmatch.c: Converge with fileutils. - - * backupfile.c: Converge with fileutils. - (find_backup_file_name): Treat .~N~ suffix just like any other suffix - when handling file names that are too long. - - * inp.c: - In messages, put quotes around file names and spaces around "--". - (get_input_file): Allow files to be deleted. Do the expense of - makedirs only if we can't create the file. - (plan_a, plan_b): Add support for binary transput. - - * pc/chdirsaf.c, pc/djgpp/README, pc/djgpp/config.h, pc/djgpp/config.sed, pc/djgpp/configure.bat, pc/quotearg.c: - New file. - - * NEWS: - New methods for removing files; adjust file name intuition again. - Add description of MS-DOS and MS-Windows ports. - - * patch.man: - Simplify file name intuition slightly (no distinction for trivial dirs). - Add --binary. Describe how files and directories are deleted. - Suggest diff -a. Include caveats about what context diffs cannot represent. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.7. - (CPPFLAGS, LDFLAGS, LIBS): If the user has not set any of these vars, - prefer support for large files if available. - - * common.h (_LARGEFILE_SOURCE): Define. - (file_offset): New typedef. - (file_seek, file_tell): New macros. - - * patch.c (main): - Remove empty files by default unless POSIXLY_CORRECT is set. - - * util.c, util.h (Fseek): - Use file_offset instead of long, for portability to large-file hosts. - - * pch.c: (p_base, p_start, next_intuit_at, skip_to, open_patch_file, - intuit_diff_type, another_hunk, incomplete_line, do_ed_script): - Use file_offset instead of long, for portability to large-file hosts. - (prefix_components): Renamed from path_name_components; count only - nontrivial prefix components, and take a 2nd EXISTING arg. - (existing_prefix_components): Remove; subsumed by prefix_components. - (intuit_diff_type): When creating files, try for the creation of the - fewest directories. - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: - When creating a file, use a name whose existing directory prefix - contains the most nontrivial path name components. - Add advice for creating patches and applying them. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: Describe above change to pch.c. - Add advice for creating patches and applying them. - -1997-05-05 Paul Eggert - - * configure.in (VERSION): Update to 2.2.5. - - * quotearg.h, quotearg.c: New files. - * Makefile.in (SRCS, OBJS, HDRS): Mention new files. - (inp.o, util.o): Now depends on quotearg.h. - (quotearg.o): New makefile rule. - - * common.h (posixly_correct): New var. - * patch.c (main): Initialize it. - If ! posixly_correct, default backup type is now `existing'. - SIMPLE_BACKUP_SUFFIX no longer affects backup type. - (backup): Remove var. - - * util.h: (countdirs): Remove. - (systemic): New decl. - * util.c (move_file): Try making the parent directory of TO - if backup prefix or suffix contain a slash. - (ask): Remove arbitrary limit on size of result. - (systemic): New function. - (mkdir): Work even if arg contains shell metacharacters. - (replace_slashes): Return 0 if none were replaced. - Don't replace slash after . or .. since it's redundant. - (countdirs): Remove. - (makedirs): Ignore mkdir failures. - - * NEWS, patch.man: More POSIXLY_CORRECT adjustments. - Describe new rules for how file names are intuited. - -1997-04-17 Paul Eggert - - * configure.in (VERSION): Version 2.2 released. - - * Makefile.in (config.hin): - Remove before building; we always want the timestamp updated. - - * inp.c (get_input_file): - Look for RCS files only if backup_type == numbered_existing. - - * NEWS, patch.man: - Remove mention of never-implemented -V rcs and -V sccs options. - * patch.man: `pathname' -> `file name' - Correct the description of how file names are found in diff headers. - Clarify the distinction between ordinary and unified context diffs. - -1997-04-13 Paul Eggert - - * configure.in (VERSION): Update to 2.1.7. - - * patch.c (numeric_optarg): New function. - (get_some_switches): Use it. - - * pch.c (intuit_diff_type): When creating a file, prefer a name whose - existing dir prefix is the longest. - - * util.h (countdirs): New function. - * util.c (replace_slashes, countdirs): New functions. - (makedirs): Use replace_slashes, to be more like countdirs. - - * patch.man: Explain -pN vs -p N. Recommend --new-file. - Explain possible incompatibility with strip count. - -1997-04-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.1.6. - (AC_CHECK_HEADERS): Remove stdlib.h (i.e. remove HAVE_STDLIB_H). - - * Makefile.in: (HDRS, patchlevel.h, TAGS, distclean, maintainer-clean): - Don't distribute patchlevel.h; let the user do it. - This works around some obscure (possibly nonexistent?) `make' bugs. - - * common.h (program_name): extern, not XTERN. - (): Include if STDC_HEADERS, not if HAVE_STDLIB_H. - (atol, getenv, malloc, realloc): Don't worry whether they're #defined. - - * patch.c (get_some_switches): - Add special hack for backwards compatibility with CVS 1.9. - (-B, -Y, -z): Now set backup_type = simple. - - * NEWS: Fix misspellings; minor reformatting. - * README: Report POSIX.2 compliance. - -1997-04-06 Paul Eggert - - Move all old RCS $Log entries into ChangeLog. - #include all files with < >, not " ". - - * addext.c, argmatch.c, argmatch.h, memchr.c, install-sh: - New files. - * EXTERN.h, INTERN.h: Removed. - * config.hin: Renamed from config.h.in. - - * acconfig.h (NODIR): Remove. - (HAVE_MEMCHR): Add. - - * configure.in (AC_ARG_PROGRAM, AC_PROG_MAKE_SET, HAVE_MEMCHR): Add. - (AC_CHECK_HEADERS): Replaces obsolescent AC_HAVE_HEADERS. - Add stdlib.h, string.h, unistd.h, varargs.h. - Delete obsolete call to AC_UNISTD_H. - (AC_CONFIG_HEADER): Rename config.h.in to config.hin. - (AC_C_CONST): Replaces obsolescent AC_CONST. - (AC_CHECK_FUNC): Check for getopt_long; define LIBOBJS and substitute - for it accordingly. - (AC_CHECK_FUNCS): Replaces obsolescent AC_HAVE_FUNCS. - Add _doprintf, isascii, mktemp, sigaction, sigprocmask, sigsetmask. - Remove strerror. - (AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VPRINTF): Add. - (AC_HEADER_DIRENT): Replaces obsolescent AC_DIR_HEADER. - (AC_HEADER_STDC): Replaces obsolescent AC_STDC_HEADERS. - (AC_SYS_LONG_FILE_NAMES): Replaces obsolescent AC_LONG_FILE_NAMES. - (AC_TYPE_OFF_T): Replaces obsolescent AC_OFF_T. - (AC_TYPE_SIGNAL): Replaces obsolescent AC_RETSIGTYPE. - (AC_TYPE_SIZE_T): Replaces obsolescent AC_SIZE_T. - (AC_XENIX_DIR): Remove. - (ED_PROGRAM): New var. - (NODIR): Remove. - (PACKAGE, VERSION): New vars; substitute them with AC_SUBST. - - * Makefile.in: Conform to current GNU build standards. - Redo dependencies. Use library getopt_long if available. - Use `&&' instead of `;' inside shell commands where applicable; - GNU make requires this. - Use double-colon rules for actions that do not build files. - (@SET_MAKE@): Added. - (CFLAGS, LDFLAGS, prefix, exec_prefix): Base on @ versions of symbols. - (COMPILE, CPPFLAGS, DEFS, ED_PROGRAM, LIBOBJS, LIBSRCS, PACKAGE, - VERSION): New symbols. - (SRCS, OBJS, HDRS, MISC): Add new files. - (man1dir): Renamed from mandir. - (man1ext): Renamed from manext. - (patch): Put -o first. - (install): Use $(transform) to allow program to be renamed by configure. - (patchlevel.h): Build from $(VERSION). - (dist): Get version number from $(VERSION) and package name from - $(PACKAGE). - (TAGS): Scan $(HDRS). - (maintainer-clean): Renamed from realclean. Remove patchlevel.h. - - * backupfile.h (simple_backup_suffix): Now const *. - (find_backup_file_name, base_name, get_version): Args are now const *. - (base_name): New decl. - * backupfile.c (): Include only if HAVE_CONFIG_H. - (): Include. - (): Include if HAVE_STRING_H, not if STDC_HEADERS. - (): Include if !HAVE_STRING_H. - (): Do not include. - (): Redo include as per current autoconf standards. - (): Include if HAVE_LIMITS_H. Define CHAR_BIT if not defined. - (NLENGTH): Now returns size_t. - (CLOSEDIR, INT_STRLEN_BOUND): New macros. - (ISDIGIT): Use faster method. - (find_backup_file_name): No longer depends on NODIR. - Remove redundant code. - (make_version_name): Remove; do it more portably. - (max_backup_version): Args are now const *. - (version_number): Simplify digit checking. - (basename, concat, dirname): Remove. - (argmatch, invalid_arg): Move to argmatch.c. Simplify test for - ambiguous args. When reporting an error, use program_name not "patch". - (addext): Move to addext.c. Treat all negative values from pathconf - like -1. Always use long extension if it fits, even if the filesystem - does not support long file names. - (backup_types): Now const. - - * common.h, inp.h (XTERN): Renamed from EXT to avoid collision - with errno.h reserved name space. - - * common.h (DEBUGGING): Now an integer; default is 1. - (enum diff): New type. - (diff_type): Use it instead of small integers. - (CONTEXT_DIFF, NORMAL_DIFF, ED_DIFF, NEW_CONTEXT_DIFF, UNI_DIFF): - Now enumerated values instead of macros. - (NO_DIFF): New enumerated value (used instead of 0). - (volatile): Default to the empty string if __STDC__ is not defined. - (): Do not include. - (Chmod, Close, Fclose, Fflush, Fputc, Signal, Sprintf, Strcat, - Strcpy, Unlink, Write): Remove these macros; casts to void are - not needed for GNU coding standards. - (INITHUNKMAX): Move to pch.c. - (malloc, realloc, INT_MIN, MAXLINELEN, strNE, strnNE, - Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, Reg8, Reg9, Reg10, Reg11, - Reg12, Reg13, Reg14, Reg15, Reg16): Remove these macros. - (S_IXOTH, S_IWOTH, S_IROTH, S_IXGRP, S_IWGRP, - S_IRGRP, S_IXUSR, S_IWUSR, S_IRUSR, O_RDONLY, O_RDWR): - Define these macros, if not defined. - (CTYPE_DOMAIN, ISLOWER, ISSPACE, ISDIGIT, PARAMS): New macros. - (instat): Renamed from filestat; used for input file now. - (bufsize, using_plan_a, debug, strippath): Not statically initialized. - (debug): #define to 0 if not DEBUGGING, so that users of `debug' - no longer need to be surrounded by `#if DEBUGGING'. - (out_of_mem, filec, filearg, outname, toutkeep, trejkeep): Remove. - (inname, inerrno, dry_run, origbase): New variables. - (origprae): Now const*. - (TMPOUTNAME, TMPINNAME, TMPPATNAME): Now const*volatile. - (verbosity): New variable; subsumes `verbose'. - (DEFAULT_VERBOSITY, SILENT, VERBOSE): Values in a new enum. - (verbose): Removed. - (VOID): Use `#ifdef __STDC__' instead of`#if __STDC__', - for consistency elsewhere. - (__attribute__): New macro (empty if not a recent GCC). - (fatal_exit): Renamed from my_exit. - (errno): Don't define if STDC_HEADERS. - (): Include if either STDC_HEADERS or HAVE_STRING_H. - (memcmp, memcpy): Define if !STDC_HEADERS && !HAVE_STRING_H - && !HAVE_MEMCHR. - (): Include if HAVE_STDLIB_H, not if STDC_HEADERS. - (atol, getenv, malloc, realloc, lseek): Declare only if not defined - as a macro. - (popen, strcpy, strcat, mktemp): Do not declare. - (lseek): Declare to yield off_t, not long. - (): Include only if HAVE_FCNTL_H. - - * inp.h (get_input_file): New decl. - * inp.c (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF, RCSSUFFIX, CHECKOUT, - CHECKOUT_LOCKED, RCSDIFF): Moved here from common.h. - (i_ptr): Now char const **. - (i_size): Remove. - (TIBUFSIZE_MINIMUM): Define only if not already defined. - (plan_a, plan_b): Arg is now const *. - (report_revision): Declare before use. It's now the caller's - responsibility to test whether revision is 0. - (scan_input, report_revision, get_input_file): - Be less chatty unless --verbose. - (get_input_file): New function, split off from plan_a. - Reuse file status gotten by pch if possible. Allow for dry run. - Use POSIX bits for creat, not number. Check for creation and - close failure, and use fstat not stat. Use memcpy not strncpy. - (plan_a): Rewrite for speed. - Caller now assigns result to using_plan_a. - Don't bother reading empty files; during dry runs they might not exist. - Use ISSPACE, not isspace. - (plan_b): Allow for dry runs. Use ISSPACE, and handle sign extension - correctly on arg. Use POSIX symbol for open arg. - - * patch.c (backup, output, patchname, program_name): New vars. - (last_frozen_line): Moved here from inp.h. - (TMPREJNAME): Moved here from common.h. - (optind_last): Removed. - (do_defines, if_defined, not_defined, else_defined, end_defined): - Now char const. Prepend with \n (except for not_defined) to - allow for files ending in non-newline. - (Argv): Now char*const*. - (main, get_some_switches): Exit status 0 means success, - 1 means hunks were rejected, 2 means trouble. - (main, locate_hunk, patch_match): Keep track of patch prefix context - separately from suffix context; this fixes several bugs. - (main): Initialize bufsize, strippath. - Be less chatty unless --verbose. - No more NODIR; always have version control available. - Require environment variables to be nonempty to have effect. - Add support for --dry-run, --output, --verbose. - Invoke get_input_file first, before deciding among do_ed_script, - plan_a, or plan_b. - Clear ofp after closing it, to keep discipline that ofp is either - 0 or open, to avoid file descriptor leaks. Conversely, rejfp doesn't - need this trick since static analysis is enough to show when it - needs to be closed. - Don't allow file-creation patches to be applied to existing files. - Misordered hunks are now not fatal errors; just go on to the next file. - It's a fatal error to fall back on plan B when --output is given, - since the moving hand has writ. - Add support for binary files. - Check for I/O errors. - chmod output file ourselves, rather than letting move_file do it; - this saves global state. - Use better grammar when outputting hunks messages, e.g. avoid - `1 hunks'. - (main, reinitialize_almost_everything): - Remove support for multiple file arguments. - Move get_some_switches call from reinitialize_almost_everything - to main. - (reinitialize_almost_everything): No need to reinitialize things - that are no longer global variables, e.g. outname. - (shortopts): Remove leading "-"; it's no longer important to - return options and arguments in order. '-b' no longer takes operand. - -p's operand is no longer optional. Add -i, -Y, -z. Remove -S. - (longopts): --suffix is now pared with -z, not -b. --backup now - means -b. Add --input, --basename-prefix, --dry-run, --verbose. - Remove --skip. --strip's operand is now required. - (option_help): New variable. Use style of current coding standards. - Change to match current option set. - (usage): Use it. - (get_some_switches): Get all switches, since `+' is defunct. - New options -i, -Y, -z, --verbose, --dry-run. - Option -S removed. - -b now means backup (backup_type == simple), not simple_backup_suffix. - -B now implies backup, and requires nonempty operand. - -D no longer requires first char of argument to be an identifier. - `-o -' is now disallowed (formerly output to regular file named "-"). - -p operand is now required. - -v no longer needs to cleanup (no temp files can exist at that point). - -V now implies backup. - Set inname, patchname from file name arguments, if any; - do not set filearg. It's now an error if extra operands are given. - (abort_junk): Check for write errors in reject file. - (apply_hunk, copy_till): Return error flag, so that failure to apply - out-of-order hunk is no longer fatal. - (apply_hunk): New arg after_newline, - for patching files not ending in newline. - Cache ofp for speed. Check for write errors. - (OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE): Now part of an enumerated type - instead of being #defined to small integers. - Change while-do to do-while when copying !-part for R_do_defines, - since condition is always true the first time through the loop. - (init_output, init_reject): Arg is now const *. - (copy_till, spew_output): Do not insert ``missing'' newlines; - propagate them via new after_newline argument. - (spew_output): Nothing to copy if last_frozen_line == input lines. - Do not close (ofp) if it's null. - (dump_line): Remove. - (similar): Ignore presence or absence of trailing newlines. - Check for only ' ' or '\t', not isspace (as per POSIX.2). - (make_temp): Use tmpnam if mktemp is not available. - (cleanup): New function. - (fatal_exit): Use it. Renamed from my_exit. - Take signal to exit with, not exit status (which is now always 2). - - * pch.h, pch.c (pch_prefix_context, pch_suffix_context): - New fns replacing pch_context. - (another_hunk): Now yields int, not bool; -1 means out of memory. - Now takes difftype as argument. - (pch_write_line): Now returns boolean indicating whether we're after - a newline just after the write, for supporting non-text files. - * pch.c (isdigit): Remove; use ISDIGIT instead. - (INITHUNKMAX): Moved here from common.h. - (p_context): Removed. We need to keep track of the pre- and post- - context separately, in: - (p_prefix_context, p_suffix_context): New variables. - (bestguess): Remove. - (open_patch_file): Arg is now char const *. - Copy file a buffer at a time, not a char at a time, for speed. - (grow_hunkmax): Now returns success indicator. - (there_is_another_patch, skip_to, another_hunk, do_ed_script): - Be less chatty unless --verbose. - (there_is_another_patch): - Avoid infinite loop if user input keeps yielding EOF. - (intuit_diff_type): New returns enum diff, not int. - Strip paths as they're being fetched. - Set ok_to_create_file correctly even if patch is reversed. - Set up file names correctly with unidiff output. - Use algorithm specified by POSIX 1003.2b/D11 to deduce - name of file to patch, with the exception of patches - that can create files. - (skip_to): Be verbose if !inname, since we're about to ask the - user for a file name and the context will help the user choose. - (another_hunk): Keep context as LINENUM, not int. - If the replacement is missing, calculate its context correctly. - Don't assume input ends in newline. - Keep track of patch prefix context separately from suffix context; - this fixes several bugs. - Don't assume blank lines got chopped if the replacement is missing. - Report poorly-formed hunks instead of aborting. - Do not use strcpy on overlapping strings; it's not portable. - Work even if lines are incomplete. - Fix bugs associated with context-less context hunks, - particularly when patching in reverse. - (pget_line): Now takes just 1 arg; instead of second arg, - just examine using_plan_a global. Return -1 if we ran out - of memory. - (do_ed_script): Now takes output FILE * argument. - Take name of editor from ED_PROGRAM instead of hardwiring /bin/ed. - Don't bother unlinking TMPOUTNAME. - Check for popen failure. - Flush pipe to check for output errors. - If ofp is nonzero, copy result to it, instead of trying to - move the result. - - * util.h, util.c (say1, say2, say3, say4, fatal1, fatal2, fatal3, - fatal4, pfatal1, pfatal2, pfatal3, pfatal4, ask1, ask2, ask3, ask4): - Remove; replaced with following. - (ask, say, fatal, pfatal): New stdarg functions. - (fetchname): Remove last, `assume_exists' parameter. - (savebuf, savestr, move_file, copy_file): Args are now const *. - (exit_with_signal): New function, for proper process status if - a signal is received as per POSIX.2. - (basename): Rename to `base_name' and move to backupfile. - * util.c (): Include here, not in common.h. - (vararg_start): New macro. - (va_dcl, va_start, va_arg, va_end): Define if neither - nor are available. - (SIGCHLD): Define to SIGCLD if SIGCLD is defined and - SIGCHLD isn't. - (private_strerror): Remove. - (move_file): Remove option of moving to stdout. - Add support for -Y, -z. - Don't assume chars in file name are nonnegative. - Use copy_file if rename fails due to EXDEV; - report failure if rename fails for any other reason. - (copy_file, makedirs): Use POSIX symbols for permissions. - (copy_file): Open source before destination. - (remove_prefix): New function. - (vfprintf): New function, if !HAVE_VPRINTF. - (afatal, apfatal, zfatal, zpfatal, errnum): Remove. - (fatal, pfatal, say): New functions that use stdarg. - All callers changed. - (zask): Renamed from `ask'. Now uses stdarg. Output to stdout, - and read from /dev/tty, or if that cannot be opened, from - stderr, stdout, stdin, whichever is first a tty. - Print "EOF" when an EOF is read. Do not echo input. - (sigs): New array. - (sigset_t, sigemptyset, sigmask, sigaddset, sigismember, SIG_BLOCK, - SIG_UNBLOCK, SIG_SETMASK, sigprocmask, sigblock, sigsetmask): - Define substitutes if not available. - (initial_signal_mask, signals_to_block): New vars. - (fatal_exit_handler): New function, if !HAVE_SIGACTION. - (set_signals, ignore_signals): Use sigaction and sigprocmask style - signal-handling if possible; it doesn't lose signals. - (set_signals): Default SIGCHLD to work around SysV fork+wait bug. - (mkdir): First arg is now const *. - (makedirs): Handle multiple adjacent slashes correctly. - (fetchname): Do not worry about whether the file exists - (that is now the caller's responsibility). - Treat a sequence of one or more slashes like one slash. - Do not unstrip leading directories if they all exist and if - no -p option was given; POSIX doesn't allow this. - (memcmp): Remove (now a macro in common.h). - - * version.c (copyright_string, free_software_msgid, authorship_msgid): - New constants. - (version): Use them. Use program_name instead of hardwiring it. - - * patch.man: Generate date from RCS Id. - Rewrite to match the above changes. - -Fri Jul 30 02:02:51 1993 Paul Eggert (eggert@twinsun.com) - - * configure.in (AC_HAVE_FUNCS): Add mkdir. - - * common.h (Chmod, Fputc, Write, VOID): New macros. - (malloc, realloc): Yield `VOID *', not `char *'. - - * util.h (makedirs): Omit `striplast' argument. Remove `aask'. - - * inp.c (plan_a): Remove fixed internal buffer. Remove lint. - - * util.c (set_signals, ignore_signals): Trap SIGTERM, too. - (makedirs): Removed fixed internal buffer. Omit `striplast' argument. - (mkdir): New function, if !HAVE_MKDIR. - (fetchname): Remove fixed internal buffer. - Remove lint from various functions. - - * patch.c, pch.c: Remove lint. - -Thu Jul 29 20:52:07 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * Makefile.in (config.status): Run config.status --recheck, not - configure, to get the right args passed. - -Thu Jul 29 07:46:16 1993 Paul Eggert (eggert@twinsun.com) - - * The following changes remove all remaining fixed limits on memory, - and fix bugs in patch's handling of null bytes and files that do not - end in newline. `Patch' now works on binary files. - - * backupfile.c (find_backup_file_name): Don't dump core if malloc fails. - - * EXTERN.h, INTERN.h (EXITING): New macro. - * backupfile.[ch], patch.c, pch.c: Add PARAMS to function declarations. - - * common.h (bool): Change to int, so ANSI C prototype promotion works. - (CANVARARG): Remove varargs hack; it wasn't portable. - (filearg): Now a pointer, not an array, so that it can be reallocated. - (GET*, SCCSDIFF, CHECKOUT*, RCSDIFF): Quote operands to commands. - (my_exit): Declare here. - (BUFFERSIZE, Ctl, filemode, Fseek, Fstat, Lseek, MAXFILEC, MAXHUNKSIZE, - Mktemp, myuid, Null, Nullch, Nullfp, Nulline, Pclose, VOIDUSED): Remove. - All invokers changed. - (Argc, Argv, *define[sd], last_offset, maxfuzz, noreverse, ofp, - optind_last, rejfp, rejname): No longer externally visible; all - definers changed. - (INT_MAX, INT_MIN, STD*_FILENO, SEEK_SET): Define if the underlying - system doesn't. Include for this. - - * configure.in: Add limits.h, memcmp. Delete getline. - - * inp.c (tibufsize): New variable; buffers grow as needed. - (TIBUFSIZE_MINIMUM): New macro. - (report_revision): New function. - (plan_a): Do not search patch as a big string, since that fails - if it contains null bytes. - Prepend `./' to filenames starting with `-', for RCS and SCCS. - If file does not match default RCS/SCCS version, go ahead and patch - it anyway; warn about the problem but do not report a fatal error. - (plan_b): Do not use a fixed buffer to read lines; read byte by byte - instead, so that the lines can be arbitrarily long. Do not search - lines as strings, since they may contain null bytes. - (plan_a, plan_b): Report I/O errors. - - * inp.c, inp.h (rev_in_string): Remove. - (ifetch): Yield size of line too, since strlen no longer applies. - (plan_a, plan_b): No longer exported. - - * patch.c (abort_hunk, apply_hunk, patch_match, similar): - Lines may contain NUL and need not end in newline. - (copy_till, dump_line): Insert newline if appending after partial line. - All invokers changed. - (main, get_some_switches, apply_hunk): Allocate *_define[ds], filearg, - rejname dynamically. - (make_temp): New function. - (main): Use it. - (main, spew_output, dump_line) Check for I/O errors. - - * pch.c (open_patch_file): Don't copy stdin to a temporary file if - it's a regular file, since we can seek on it directly. - (open_patch_file, skip_to, another_hunk): The patch file may contain - NULs. - (another_hunk): The patch file may contain lines starting with '\', - which means the preceding line lacked a trailing newline. - (pgetline): Rename to pget_line. - (get_line, incomplete_line, pch_write_line): New functions. - (pch_line_len): Return size_t, not short; lines may be very long. - (do_ed_script): Check for I/O errors. Allow scripts to contain - 'i' and 's' commands, too. - - * pch.h (pfp, grow_hunkmax, intuit_diff_type, next_intuit_at, skip_to, - pfetch, pgetline): No longer exported. - (pch_write_line): New declaration. - (getline): Removed. - - * util.c (move_file, fetchname): Use private stat buffer, so that - filestat isn't lost. Check for I/O errors. - (savestr): Use savebuf. - (zask): Use STD*_FILENO instead of 0, 1, 2. - (fetchname): strip_leading defaults to INT_MAX instead of 957 (!). - (memcmp): Define if !HAVE_MEMCMP. - - * util.c, util.h (say*, fatal*, pfatal*, ask*): Delete; these - pseudo-varargs functions weren't ANSI C. Replace by macros - that invoke [fs]printf directly, and invoke new functions - [az]{say,fatal,pfatal,ask} before and after. - (savebuf, read_fatal, write_fatal, memory_fatal, Fseek): New functions. - (fatal*): Output trailing newline after message. All invokers changed. - - * version.c (version): Don't exit. - - * Makefile.in (SRCS): Remove getline.c. - -Thu Jul 22 15:24:24 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * EXTERN.h, INTERN.h (PARAMS): Define. - * backupfile.h, common.h, inp.h, pch.h, util.h: Use. - * backupfile.c: Include EXTERN.h. - -Wed Jul 21 13:14:05 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * getline.c: New file. - * configure.in: Check for getline (GNU libc has it). - * pch.c: Use it instead of fgets. - (pgetline): Renamed from pgets. Change callers. - * pch.h: Change decl. - - * pch.c (pgets): Tab adjusts by 8 - (indent % 8), not % 7. - Be consistent with similar code in pch.c::intuit_diff_type. - - * common.h (MEM): Typedef removed. - inp.c, pch.c, util.c: Use size_t instead of MEM. - inp.c, pch.c: Use off_t. - configure.in: Add AC_SIZE_T and AC_OFF_T. - - * common.h: Make buf a pointer and add a bufsize variable. - * util.c, pch.c, inp.c: Replace sizeof buf with bufsize. - * patch.c: malloc buf to bufsize bytes. - -Tue Jul 20 20:40:03 1993 Paul Eggert (eggert@twinsun.com) - - * common.h (BUFFERSIZE): Grow it to 8k too, just in case. - (buf): Turn `buf' back into an array; making it a pointer broke - things seriously. - * patch.c (main): Likewise. - -Tue Jul 20 20:02:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Move Reg[1-16] and CANVARARG decls from config.h.in to common.h. - * acconfig.h: New file. - * Makefile (HDRS): Add it. - -Tue Jul 20 16:35:27 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in: Remove alloca.[co]; getopt no longer needs it. - * configure.in (AC_ALLOCA): Remove. - - * util.c (set_signals, ignore_signals): Do nothing if SIGHUP - and SIGINT aren't defined. - -Tue Jul 20 17:59:56 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (main): Call xmalloc, not malloc. xmalloc buf. - * common.h: Declare xmalloc. Make buf a pointer, not an array. - - * util.c (xmalloc): Call fatal1, not fatal. - - * common.h [MAXLINELEN]: Bump from 1k to 8k. - -Thu Jul 8 19:56:16 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in (installdirs): New target. - (install): Use it. - (Makefile, config.status, configure): New targets. - -Wed Jul 7 13:25:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (get_some_switches, longopts): Recognize --help - option, and call usage. - (usage): New function. - -Fri Jun 25 07:49:45 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Don't use .orig if - numbered_existing with no existing numbered backup. - (addext): Don't use ext if !HAVE_LONG_FILE_NAMES, - even if it would fit. This matches patch's historical behavior. - (simple_backup_suffix): Default to ".orig". - * patch.c (main): Just use that default. - -Tue Jun 15 22:32:14 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (HAVE_ALLOCA_H): This #undef was missing. - * Makefile.in (info, check, installcheck): New rules. - -Sun Jun 13 14:31:29 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (index, rindex): Remove unused macro - definitions; they get in the way when porting to AIX. - * config.h.in, configure.in (HAVE_STRING_H): Remove unused defn. - -Thu Jun 10 21:13:47 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCH_VERSION 2.1. - (The name `patch-2.0.12g12' is too long for traditional Unix.) - - * patchlevel.h (PATCH_VERSION): Renamed from PATCHLEVEL. - Now contains the entire patch version number. - * version.c (version): Use it. - -Wed Jun 9 21:43:23 1993 Paul Eggert (eggert@twinsun.com) - - * common.h: Remove declarations of index and rindex. - * backupfile.c: Likewise. - (addext, basename, dirname): Avoid rindex. - -Tue Jun 8 15:24:14 1993 Paul Eggert (eggert@twinsun.com) - - * inp.c (plan_a): Check that RCS and working files are not the - same. This check is needed on hosts that do not report file - name length limits and have short limits. - -Sat Jun 5 22:56:07 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in (.c.o): Put $(CFLAGS) after other options. - (dist): Switch from .z to .gz. - -Wed Jun 2 10:37:15 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Initialize copy of - file name properly. - -Mon May 31 21:55:21 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g11. - - * pch.c (p_Char): Renamed from p_char, which is a system type - in Tex XD88's . - - * backupfile.c: Include "config.h" first, so that `const' is - treated consistently in system headers. - -Mon May 31 16:06:23 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g10. - - * configure.in: Add AC_CONST. - * config.h.in: Add `const'. - * Makefile.in (.c.o): Add -DHAVE_CONFIG_H. - (getopt.o getopt1.o): Depend on config.h. - - * util.c (xmalloc): New function; alloca.c needs this. - -Mon May 31 00:49:40 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCHLEVEL 12g9. - - * backupfile.c, backupfile.h (addext): New function. - It uses pathconf(), if available, to determine maximum file - name length. - * patch.c (main): Use it for reject file name. - * common.h (ORIGEXT): Moved to patch.c. - * config.h.in (HAVE_PATHCONF): New macro. - * configure.in: Define it. - - * Makefile.in (dist): Use gzip, not compress. - -Sat May 29 09:42:18 1993 Paul Eggert (eggert@twinsun.com) - - * patch.c (main): Use pathconf to decide reject file name. - * common.h (REJEXT): Remove. - - * inp.c (plan_a): Don't lock the checked-out file if `patch -o' - redirected the output elsewhere. - * common.h (CHECKOUT_LOCKED, GET_LOCKED): New macros. GET and - CHECKOUT now just checkout unlocked copies. - -Fri May 28 08:44:50 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (basename): Define even if NODIR isn't defined. - * patch.c (main): Ask just once to apply a reversed patch. - -Tue Nov 24 08:09:04 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * config.h.in, common.h: Use HAVE_FCNTL_H and HAVE_STRING_H - instead of USG. - - * backupfile.c: Use SYSDIR and NDIR instead of USG. - Define direct as dirent, not vice-versa. - -Wed Sep 16 17:11:48 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (get_some_switches): optc should be int, not char. - -Tue Sep 15 00:36:46 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12g8. - -Mon Sep 14 22:01:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Makefile.in: Add uninstall target. - - * util.c (fatal, pfatal): Add some asterisks to make fatal - messages stand out more. - -Tue Aug 25 22:13:36 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main, get_some_switches), common.h, inp.c (plan_a, - plan_b), pch.c (there_is_another_patch): Add -t --batch - option, similar to -f --force. - -Mon Jul 27 11:27:07 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * common.h: Define SCCSDIFF and RCSDIFF. - * inp.c (plan_a): Use them to make sure it's safe to check out - the default RCS or SCCS version. - From Paul Eggert. - -Mon Jul 20 14:10:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.h: Declare basename. - * inp.c (plan_a), util.c (fetchname): Use it to isolate the - leading path when testing for RCS and SCCS files. - -Fri Jul 10 16:03:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (makedirs): Only make the directories that don't exist. - From chip@tct.com (Chip Salzenberg). - -Wed Jul 8 01:20:56 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main): Open ofp after checking for ed script. - Close ofp and rejfp before trying plan B. - From epang@sfu.ca (Eugene Pang). - - * util.c (fatal, pfatal): Print "patch: " before message. - * pch.c, inp.c, patch.c, util.c: Remove "patch: " from the - callers that had it. - - * common.h (myuid): New variable. - * patch.c (main): Initialize it. - * inp.c (myuid): Function removed. - (plan_a): Use the variable, not the function. - - * patch.c: Add back -E --remove-empty-files option. - -Tue Jul 7 23:19:28 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (myuid): New function. - (plan_a): Call it. Optimize stat calls. Be smarter about - detecting checked out RCS and SCCS files. - From Paul Eggert (eggert@twinsun.com). - - * inp.c, util.c, patch.c: Don't bother checking for stat() > 0. - -Mon Jul 6 13:01:52 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (move_file): Use rename instead of link and copying. - - * util.c (pfatal): New function. - * util.h: Declare it and pfatal[1-4] macros. - * various files: Use it instead of fatal where appropriate. - - * common.h, patch.c: Replace Arg[cv]_last with optind_last. - - * patch.c (main, get_some_switches): Use getopt_long. Update - usage message. - (nextarg): Function removed. - - * Rename FLEXFILENAMES to HAVE_LONG_FILE_NAMES, - VOIDSIG to RETSIGTYPE. - - * backupfile.c, common.h: Use STDC header files if available. - backupfile.h: Declare get_version. - - * COPYING, COPYING.LIB, INSTALL, Makefile.in, alloca.c, - config.h.in, configure, configure.in, getopt.[ch], getopt1.c, - rename.c: New files. - * Configure, MANIFEST, Makefile.SH, config.H, config.h.SH, - malloc.c: Files removed. - - * version.c (version): Don't print the RCS stuff, since we're - not updating it regularly. - - * patchlevel.h: PATCHLEVEL 12u7. - - * Makefile.SH (dist): New target. - Makedist: File removed. - - * inp.c (plan_a): Check whether the user can write to the - file, not whether anyone can write to the file. - -Sat Jul 4 00:06:58 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (plan_a): Try to check out read-only files from RCS or SCCS. - - * util.c (move_file): If backing up by linking fails, try copying. - From cek@sdc.boeing.com (Conrad Kimball). - - * patch.c (get_some_switches): Eliminate -E option; always - remove empty output files. - - * util.c (fetchname): Only undo slash removal for relative - paths if -p was not given. - - * Makefile.sh: Add mostlyclean target. - -Fri Jul 3 23:48:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (fetchname): Accept whitespace between `Index:' and filename. - Also plug a small memory leak for diffs against /dev/null. - From eggert@twinsun.com (Paul Eggert). - - * common.h: Don't define TRUE and FALSE if already defined. - From phk@data.fls.dk (Poul-Henning Kamp). - -Wed Apr 29 10:19:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - - * backupfile.c (get_version): Exit if given a bad backup type. - -Fri Mar 27 09:57:14 1992 Karl Berry (karl at hayley) - - * common.h (S_ISDIR, S_ISREG): define these. - * inp.c (plan_a): use S_ISREG, not S_IFREG. - * util.c (fetchname): use S_ISDIR, not S_IFDIR. - -Mon Mar 16 14:10:42 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u6. - -Sat Mar 14 13:13:29 1992 David J. MacKenzie (djm at frob.eng.umd.edu) - - * Configure, config.h.SH: Check for directory header and unistd.h. - - * patch.c (main): If -E was given and output file is empty after - patching, remove it. - (get_some_switches): Recognize -E option. - - * patch.c (copy_till): Make garbled output an error, not a warning - that doesn't change the exit status. - - * common.h: Protect against system declarations of malloc and realloc. - - * Makedist: Add backupfile.[ch]. - - * Configure: Look for C library where NeXT and SVR4 put it. - Look in /usr/ucb after /bin and /usr/bin for utilities, - and look in /usr/ccs/bin, to make SVR4 happier. - Recognize m68k predefine. - - * util.c (fetchname): Test of stat return value was backward. - From csss@scheme.cs.ubc.ca. - - * version.c (version): Exit with status 0, not 1. - - * Makefile.SH: Add backupfile.[cho]. - * patch.c (main): Initialize backup file generation. - (get_some_switches): Add -V option. - * common.h, util,c, patch.c: Replace origext with simple_backup_suffix. - * util.c (move_file): Use find_backup_file_name. - -Tue Dec 3 11:27:16 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u5. - - * Makefile.SH: Change clean, distclean, and realclean targets a - little so they agree with the GNU coding standards. - Add Makefile to addedbyconf, so distclean removes it. - - * Configure: Recognize Domain/OS C library in /lib/libc. - From mmuegel@mot.com (Michael S. Muegel). - - * pch.c: Fixes from Wayne Davison: - Patch now accepts no-context context diffs that are - specified with an assumed one line hunk (e.g. "*** 10 ****"). - Fixed a bug in both context and unified diff processing that would - put a zero-context hunk in the wrong place (one line too soon). - Fixed a minor problem with p_max in unified diffs where it would - set p_max to hunkmax unnecessarily (the only adverse effect was to - not supply empty lines at eof by assuming they were truncated). - -Tue Jul 2 03:25:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Configure: Check for signal declaration in - /usr/include/sys/signal.h as well as /usr/include/signal.h. - - * Configure, common.h, config.h.SH: Comment out the sprintf - declaration and tests to determine its return value type. It - conflicts with ANSI C systems' prototypes in stdio.h and the - return value of sprintf is never used anyway -- it's always cast - to void. - -Thu Jun 27 13:05:32 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u4. - -Thu Feb 21 15:18:14 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * pch.c (another_hunk): Fix off by 1 error. From - iverson@xstor.com (Tim Iverson). - -Sun Jan 20 20:18:58 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * Makefile.SH (all): Don't make a dummy `all' file. - - * patchlevel.h: PATCHLEVEL 12u3. - - * patch.c (nextarg): New function. - (get_some_switches): Use it, to prevent dereferencing a null - pointer if an option that takes an arg is not given one (is last - on the command line). From Paul Eggert. - - * pch.c (another_hunk): Fix from Wayne Davison to recognize - single-line hunks in unified diffs (with a single line number - instead of a range). - - * inp.c (rev_in_string): Don't use `s' before defining it. From - Wayne Davison. - -Mon Jan 7 06:25:11 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u2. - - * pch.c (intuit_diff_type): Recognize `+++' in diff headers, for - unified diff format. From unidiff patch 1. - -Mon Dec 3 00:14:25 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * patch.c (get_some_switches): Make the usage message more - informative. - -Sun Dec 2 23:20:18 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * Configure: When checking for C preprocessor, look for 'abc.*xyz' - instead of 'abc.xyz', so ANSI C preprocessors work. - - * Apply fix for -D from ksb@mentor.cc.purdue.edu (Kevin Braunsdorf). - -1990-05-01 Wayne Davison - * patch.c, pch.c: unidiff support added - -Wed Mar 7 23:47:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * pch.c: Call malformed instead of goto malformed - (just allows easier debugging). - -Tue Jan 23 21:27:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * common.h (TMP*NAME): Make these char *, not char []. - patch.c (main): Use TMPDIR (if present) to set TMP*NAME. - common.h: Declare getenv. - -Sun Dec 17 17:29:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) - - * patch.c (reverse_flag_specified): New variable. - (get_some_switches, reinitialize_almost_everything): Use it. - -1988-06-22 Larry Wall - patch12: - * common.h: sprintf was declared wrong - * patch.c: rindex() wasn't declared - * patch.man: now avoids Bell System Logo - -1988-06-03 Larry Wall - patch10: - * common.h: support for shorter extensions. - * inp.c: made a little smarter about sccs files - * patch.c: exit code improved. - better support for non-flexfilenames. - * patch.man: -B switch was contributed. - * pch.c: Can now find patches in shar scripts. - Hunks that swapped and then swapped back could core dump. - -1987-06-04 Larry Wall - * pch.c: pch_swap didn't swap p_bfake and p_efake. - -1987-02-16 Larry Wall - * patch.c: Short replacement caused spurious "Out of sync" message. - -1987-01-30 Larry Wall - * patch.c: Improved diagnostic on sync error. - Moved do_ed_script() to pch.c. - * pch.c: Improved responses to mangled patches. - * pch.h: Added do_ed_script(). - -1987-01-05 Larry Wall - * pch.c: New-style context diffs caused double call to free(). - -1986-11-21 Larry Wall - * patch.c: Fuzz factor caused offset of installed lines. - -1986-11-14 Larry Wall - * pch.c: Fixed problem where a long pattern wouldn't grow the hunk. - Also restored p_input_line when backtracking so error messages are - right. - -1986-11-03 Larry Wall - * pch.c: New-style delete triggers spurious assertion error. - -1986-10-29 Larry Wall - * patch.c: Backwards search could terminate prematurely. - * pch.c: Could falsely report new-style context diff. - -1986-09-17 Larry Wall - * common.h, inp.c, inp.h, patch.c, patch.man, pch.c, pch.h, - util.h, version.c, version.h: Baseline for netwide release. - -1986-08-01 Larry Wall - * patch.c: Fixes for machines that can't vararg. - Added fuzz factor. Generalized -p. General cleanup. - Changed some %d's to %ld's. Linted. - * patch.man: Documented -v, -p, -F. - Added notes to patch senders. - -1985-08-15 van%ucbmonet@berkeley - Changes for 4.3bsd diff -c. - -1985-03-26 Larry Wall - * patch.c: Frozen. - * patch.man: Frozen. - -1985-03-12 Larry Wall - * patch.c: Now checks for normalness of file to patch. - Check i_ptr and i_womp to make sure they aren't null before freeing. - Also allow ed output to be suppressed. - Changed pfp->_file to fileno(pfp). - Added -p option from jromine@uci-750a. - Added -D (#ifdef) option from joe@fluke. - * patch.man: Documented -p, -D. - -1984-12-06 Larry Wall - * patch.c: Made smarter about SCCS subdirectories. - -1984-12-05 Larry Wall - * patch.c: Added -l switch to do loose string comparison. - * patch.man: Added -l switch, and noted bistability bug. - -1984-12-04 Larry Wall - Branch for sdcrdcf changes. - * patch.c: Failed hunk count not reset on multiple patch file. - * patch.man: Baseline version. - -1984-11-29 Larry Wall - * patch.c: Linted. Identifiers uniquified. Fixed i_ptr malloc() bug. - Fixed multiple calls to mktemp(). Will now work on machines that can - only read 32767 chars. Added -R option for diffs with new and old - swapped. Various cosmetic changes. - -1984-11-09 Larry Wall - * patch.c: Initial revision - -Local Variables: -mode: indented-text -left-margin: 8 -version-control: never -end: Property changes on: vendor/misc-GNU/patch/2.5/ChangeLog ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/partime.c =================================================================== --- vendor/misc-GNU/patch/2.5/partime.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/partime.c (nonexistent) @@ -1,742 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#if STDC_HEADERS -# define CTYPE_DOMAIN(c) 1 -#else -# define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#define ISALNUM(c) (CTYPE_DOMAIN (c) && isalnum (c)) -#define ISALPHA(c) (CTYPE_DOMAIN (c) && isalpha (c)) -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c)) -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#include - -char const partimeId[] = - "$Id: partime.c,v 5.16 1997/05/19 06:33:53 eggert Exp $"; - - -/* Lookup tables for names of months, weekdays, time zones. */ - -#define NAME_LENGTH_MAXIMUM 4 - -struct name_val - { - char name[NAME_LENGTH_MAXIMUM]; - int val; - }; - - -static char const *parse_decimal P ((char const *, int, int, int, int, int *, int *)); -static char const *parse_fixed P ((char const *, int, int *)); -static char const *parse_pattern_letter P ((char const *, int, struct partime *)); -static char const *parse_prefix P ((char const *, struct partime *, int *)); -static char const *parse_ranged P ((char const *, int, int, int, int *)); -static int lookup P ((char const *, struct name_val const[])); -static int merge_partime P ((struct partime *, struct partime const *)); -static void undefine P ((struct partime *)); - - -static struct name_val const month_names[] = -{ - {"jan", 0}, - {"feb", 1}, - {"mar", 2}, - {"apr", 3}, - {"may", 4}, - {"jun", 5}, - {"jul", 6}, - {"aug", 7}, - {"sep", 8}, - {"oct", 9}, - {"nov", 10}, - {"dec", 11}, - {"", TM_UNDEFINED} -}; - -static struct name_val const weekday_names[] = -{ - {"sun", 0}, - {"mon", 1}, - {"tue", 2}, - {"wed", 3}, - {"thu", 4}, - {"fri", 5}, - {"sat", 6}, - {"", TM_UNDEFINED} -}; - -#define hr60nonnegative(t) ((t)/100 * 60 + (t)%100) -#define hr60(t) ((t)<0 ? -hr60nonnegative(-(t)) : hr60nonnegative(t)) -#define zs(t,s) {s, hr60(t)} -#define zd(t,s,d) zs(t, s), zs((t)+100, d) - -static struct name_val const zone_names[] = -{ - zs (-1000, "hst"), /* Hawaii */ - zd (-1000, "hast", "hadt"), /* Hawaii-Aleutian */ - zd (- 900, "akst", "akdt"), /* Alaska */ - zd (- 800, "pst" , "pdt" ), /* Pacific */ - zd (- 700, "mst" , "mdt" ), /* Mountain */ - zd (- 600, "cst" , "cdt" ), /* Central */ - zd (- 500, "est" , "edt" ), /* Eastern */ - zd (- 400, "ast" , "adt" ), /* Atlantic */ - zd (- 330, "nst" , "ndt" ), /* Newfoundland */ - zs ( 000, "utc" ), /* Coordinated Universal */ - zs ( 000, "uct" ), /* " */ - zs ( 000, "cut" ), /* " */ - zs ( 000, "ut"), /* Universal */ - zs ( 000, "z"), /* Zulu (required by ISO 8601) */ - zd ( 000, "gmt" , "bst" ), /* Greenwich Mean, British Summer */ - zd ( 000, "wet" , "west"), /* Western European */ - zd ( 100, "cet" , "cest"), /* Central European */ - zd ( 100, "met" , "mest"), /* Middle European (bug in old tz versions) */ - zd ( 100, "mez" , "mesz"), /* Mittel-Europaeische Zeit */ - zd ( 200, "eet" , "eest"), /* Eastern European */ - zs ( 530, "ist" ), /* India */ - zd ( 900, "jst" , "jdt" ), /* Japan */ - zd ( 900, "kst" , "kdt" ), /* Korea */ - zd ( 1200, "nzst", "nzdt"), /* New Zealand */ - {"lt", 1}, -#if 0 - /* The following names are duplicates or are not well attested. - There are lots more where these came from. */ - zs (-1100, "sst" ), /* Samoan */ - zd (- 900, "yst" , "ydt" ), /* Yukon - name is no longer used */ - zd (- 500, "ast" , "adt" ), /* Acre */ - zd (- 400, "wst" , "wdt" ), /* Western Brazil */ - zd (- 400, "cst" , "cdt" ), /* Chile */ - zd (- 200, "fst" , "fdt" ), /* Fernando de Noronha */ - zs ( 000, "wat" ), /* West African */ - zs ( 100, "cat" ), /* Central African */ - zs ( 200, "sat" ), /* South African */ - zd ( 200, "ist" , "idt" ), /* Israel */ - zs ( 300, "eat" ), /* East African */ - zd ( 300, "msk" , "msd" ), /* Moscow */ - zd ( 330, "ist" , "idt" ), /* Iran */ - zs ( 800, "hkt" ), /* Hong Kong */ - zs ( 800, "sgt" ), /* Singapore */ - zd ( 800, "cst" , "cdt" ), /* China */ - zd ( 800, "wst" , "wst" ), /* Western Australia */ - zd ( 930, "cst" , "cst" ), /* Central Australia */ - zs ( 1000, "gst" ), /* Guam */ - zd ( 1000, "est" , "est" ), /* Eastern Australia */ -#endif - {"", -1} -}; - -/* Look for a prefix of S in TABLE, returning val for first matching entry. */ -static int -lookup (s, table) - char const *s; - struct name_val const table[]; -{ - int j; - char buf[NAME_LENGTH_MAXIMUM]; - - for (j = 0; j < NAME_LENGTH_MAXIMUM; j++) - { - unsigned char c = *s++; - if (! ISALPHA (c)) - { - buf[j] = '\0'; - break; - } - buf[j] = ISUPPER (c) ? tolower (c) : c; - } - - for (;; table++) - for (j = 0; ; j++) - if (j == NAME_LENGTH_MAXIMUM || ! table[0].name[j]) - return table[0].val; - else if (buf[j] != table[0].name[j]) - break; -} - - -/* Set *T to ``undefined'' values. */ -static void -undefine (t) - struct partime *t; -{ - t->tm.tm_sec = t->tm.tm_min = t->tm.tm_hour = t->tm.tm_mday = t->tm.tm_mon - = t->tm.tm_year = t->tm.tm_wday = t->tm.tm_yday - = t->ymodulus = t->yweek - = TM_UNDEFINED; - t->zone = TM_UNDEFINED_ZONE; -} - -/* Array of patterns to look for in a date string. - Order is important: we look for the first matching pattern - whose values do not contradict values that we already know about. - See `parse_pattern_letter' below for the meaning of the pattern codes. */ -static char const *const patterns[] = -{ - /* These traditional patterns must come first, - to prevent an ISO 8601 format from misinterpreting their prefixes. */ - "E_n_y", "x", /* RFC 822 */ - "E_n", "n_E", "n", "t:m:s_A", "t:m_A", "t_A", /* traditional */ - "y/N/D$", /* traditional RCS */ - - /* ISO 8601:1988 formats, generalized a bit. */ - "y-N-D$", "4ND$", "Y-N$", - "RND$", "-R=N$", "-R$", "--N=D$", "N=DT", - "--N$", "---D$", "DT", - "Y-d$", "4d$", "R=d$", "-d$", "dT", - "y-W-X", "yWX", "y=W", - "-r-W-X", "r-W-XT", "-rWX", "rWXT", "-W=X", "W=XT", "-W", - "-w-X", "w-XT", "---X$", "XT", "4$", - "T", - "h:m:s$", "hms$", "h:m$", "hm$", "h$", "-m:s$", "-ms$", "-m$", "--s$", - "Y", "Z", - - 0 -}; - -/* Parse an initial prefix of STR, setting *T accordingly. - Return the first character after the prefix, or 0 if it couldn't be parsed. - Start with pattern *PI; if success, set *PI to the next pattern to try. - Set *PI to -1 if we know there are no more patterns to try; - if *PI is initially negative, give up immediately. */ -static char const * -parse_prefix (str, t, pi) - char const *str; - struct partime *t; - int *pi; -{ - int i = *pi; - char const *pat; - unsigned char c; - - if (i < 0) - return 0; - - /* Remove initial noise. */ - while (! ISALNUM (c = *str) && c != '-' && c != '+') - { - if (! c) - { - undefine (t); - *pi = -1; - return str; - } - str++; - } - - /* Try a pattern until one succeeds. */ - while ((pat = patterns[i++]) != 0) - { - char const *s = str; - undefine (t); - do - { - if (! (c = *pat++)) - { - *pi = i; - return s; - } - } - while ((s = parse_pattern_letter (s, c, t)) != 0); - } - - return 0; -} - -/* Parse an initial prefix of S of length DIGITS; it must be a number. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_fixed (s, digits, res) - char const *s; - int digits, *res; -{ - int n = 0; - char const *lim = s + digits; - while (s < lim) - { - unsigned d = *s++ - '0'; - if (9 < d) - return 0; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_ranged (s, digits, lo, hi, res) - char const *s; - int digits, lo, hi, *res; -{ - s = parse_fixed (s, digits, res); - return s && lo <= *res && *res <= hi ? s : 0; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI - and it may be followed by a fraction to be computed using RESOLUTION. - Store the parsed number into *RES; store the fraction times RESOLUTION, - rounded to the nearest integer, into *FRES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_decimal (s, digits, lo, hi, resolution, res, fres) - char const *s; - int digits, lo, hi, resolution, *res, *fres; -{ - s = parse_fixed (s, digits, res); - if (s && lo <= *res && *res <= hi) - { - int f = 0; - if ((s[0] == ',' || s[0] == '.') && ISDIGIT (s[1])) - { - char const *s1 = ++s; - int num10 = 0, denom10 = 10, product; - while (ISDIGIT (*++s)) - { - int d = denom10 * 10; - if (d / 10 != denom10) - return 0; /* overflow */ - denom10 = d; - } - s = parse_fixed (s1, (int) (s - s1), &num10); - product = num10 * resolution; - f = (product + (denom10 >> 1)) / denom10; - f -= f & (product % denom10 == denom10 >> 1); /* round to even */ - if (f < 0 || product/resolution != num10) - return 0; /* overflow */ - } - *fres = f; - return s; - } - return 0; -} - -/* Parse an initial prefix of S; it must denote a time zone. - Set *ZONE to the number of seconds east of GMT, - or to TM_LOCAL_ZONE if it is the local time zone. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -char * -parzone (s, zone) - char const *s; - long *zone; -{ - char sign; - int hh, mm, ss; - int minutesEastOfUTC; - long offset, z; - - /* The formats are LT, n, n DST, nDST, no, o - where n is a time zone name - and o is a time zone offset of the form [-+]hh[:mm[:ss]]. */ - switch (*s) - { - case '-': - case '+': - z = 0; - break; - - default: - minutesEastOfUTC = lookup (s, zone_names); - if (minutesEastOfUTC == -1) - return 0; - - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - - /* Don't modify LT. */ - if (minutesEastOfUTC == 1) - { - *zone = TM_LOCAL_ZONE; - return (char *) s; - } - - z = minutesEastOfUTC * 60L; - - /* Look for trailing " DST". */ - if ((s[-1] == 'T' || s[-1] == 't') - && (s[-2] == 'S' || s[-2] == 's') - && (s[-3] == 'D' || s[-3] == 'd')) - goto trailing_dst; - while (ISSPACE ((unsigned char) *s)) - s++; - if ((s[0] == 'D' || s[0] == 'd') - && (s[1] == 'S' || s[1] == 's') - && (s[2] == 'T' || s[2] == 't')) - { - s += 3; - trailing_dst: - *zone = z + 60*60; - return (char *) s; - } - - switch (*s) - { - case '-': - case '+': - break; - - default: - *zone = z; - return (char *) s; - } - - break; - } - - sign = *s++; - - if (! (s = parse_ranged (s, 2, 0, 23, &hh))) - return 0; - mm = ss = 0; - if (*s == ':') - s++; - if (ISDIGIT (*s)) - { - if (! (s = parse_ranged (s, 2, 0, 59, &mm))) - return 0; - if (*s == ':' && s[-3] == ':' && ISDIGIT (s[1]) - && ! (s = parse_ranged (s + 1, 2, 0, 59, &ss))) - return 0; - } - if (ISDIGIT (*s)) - return 0; - offset = (hh * 60 + mm) * 60L + ss; - *zone = z + (sign == '-' ? -offset : offset); - /* ?? Are fractions allowed here? If so, they're not implemented. */ - return (char *) s; -} - -/* Parse an initial prefix of S, matching the pattern whose code is C. - Set *T accordingly. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_pattern_letter (s, c, t) - char const *s; - int c; - struct partime *t; -{ - switch (c) - { - case '$': /* The next character must be a non-digit. */ - if (ISDIGIT (*s)) - return 0; - break; - - case '-': - case '/': - case ':': - /* These characters stand for themselves. */ - if (*s++ != c) - return 0; - break; - - case '4': /* 4-digit year */ - s = parse_fixed (s, 4, &t->tm.tm_year); - break; - - case '=': /* optional '-' */ - s += *s == '-'; - break; - - case 'A': /* AM or PM */ - /* This matches the regular expression [AaPp][Mm]?. - It must not be followed by a letter or digit; - otherwise it would match prefixes of strings like "PST". */ - switch (*s++) - { - case 'A': - case 'a': - if (t->tm.tm_hour == 12) - t->tm.tm_hour = 0; - break; - - case 'P': - case 'p': - if (t->tm.tm_hour != 12) - t->tm.tm_hour += 12; - break; - - default: - return 0; - } - switch (*s) - { - case 'M': - case 'm': - s++; - break; - } - if (ISALNUM ((unsigned char) *s)) - return 0; - break; - - case 'D': /* day of month [01-31] */ - s = parse_ranged (s, 2, 1, 31, &t->tm.tm_mday); - break; - - case 'd': /* day of year [001-366] */ - s = parse_ranged (s, 3, 1, 366, &t->tm.tm_yday); - t->tm.tm_yday--; - break; - - case 'E': /* extended day of month [1-9, 01-31] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 31, - &t->tm.tm_mday); - break; - - case 'h': /* hour [00-23 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 23, 60 * 60, &t->tm.tm_hour, &frac); - t->tm.tm_min = frac / 60; - t->tm.tm_sec = frac % 60; - } - break; - - case 'm': /* minute [00-59 followed by optional fraction] */ - s = parse_decimal (s, 2, 0, 59, 60, &t->tm.tm_min, &t->tm.tm_sec); - break; - - case 'n': /* month name [e.g. "Jan"] */ - if (! TM_DEFINED (t->tm.tm_mon = lookup (s, month_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'N': /* month [01-12] */ - s = parse_ranged (s, 2, 1, 12, &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'r': /* year % 10 (remainder in origin-0 decade) [0-9] */ - s = parse_fixed (s, 1, &t->tm.tm_year); - t->ymodulus = 10; - break; - - case_R: - case 'R': /* year % 100 (remainder in origin-0 century) [00-99] */ - s = parse_fixed (s, 2, &t->tm.tm_year); - t->ymodulus = 100; - break; - - case 's': /* second [00-60 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 60, 1, &t->tm.tm_sec, &frac); - t->tm.tm_sec += frac; - } - break; - - case 'T': /* 'T' or 't' */ - switch (*s++) - { - case 'T': - case 't': - break; - default: - return 0; - } - break; - - case 't': /* traditional hour [1-9 or 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_hour); - break; - - case 'w': /* 'W' or 'w' only (stands for current week) */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - break; - - case 'W': /* 'W' or 'w', followed by a week of year [00-53] */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - s = parse_ranged (s, 2, 0, 53, &t->yweek); - break; - - case 'X': /* weekday (1=Mon ... 7=Sun) [1-7] */ - s = parse_ranged (s, 1, 1, 7, &t->tm.tm_wday); - t->tm.tm_wday--; - break; - - case 'x': /* weekday name [e.g. "Sun"] */ - if (! TM_DEFINED (t->tm.tm_wday = lookup (s, weekday_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'y': /* either R or Y */ - if (ISDIGIT (s[0]) && ISDIGIT (s[1]) && ! ISDIGIT (s[2])) - goto case_R; - /* fall into */ - case 'Y': /* year in full [4 or more digits] */ - { - int len = 0; - while (ISDIGIT (s[len])) - len++; - if (len < 4) - return 0; - s = parse_fixed (s, len, &t->tm.tm_year); - } - break; - - case 'Z': /* time zone */ - s = parzone (s, &t->zone); - break; - - case '_': /* possibly empty sequence of non-alphanumerics */ - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - break; - - default: /* bad pattern */ - return 0; - } - - return s; -} - -/* If there is no conflict, merge into *T the additional information in *U - and return 0. Otherwise do nothing and return -1. */ -static int -merge_partime (t, u) - struct partime *t; - struct partime const *u; -{ -# define conflict(a,b) ((a) != (b) && TM_DEFINED (a) && TM_DEFINED (b)) - if (conflict (t->tm.tm_sec, u->tm.tm_sec) - || conflict (t->tm.tm_min, u->tm.tm_min) - || conflict (t->tm.tm_hour, u->tm.tm_hour) - || conflict (t->tm.tm_mday, u->tm.tm_mday) - || conflict (t->tm.tm_mon, u->tm.tm_mon) - || conflict (t->tm.tm_year, u->tm.tm_year) - || conflict (t->tm.tm_wday, u->tm.tm_yday) - || conflict (t->ymodulus, u->ymodulus) - || conflict (t->yweek, u->yweek) - || (t->zone != u->zone - && t->zone != TM_UNDEFINED_ZONE - && u->zone != TM_UNDEFINED_ZONE)) - return -1; -# undef conflict -# define merge_(a,b) if (TM_DEFINED (b)) (a) = (b); - merge_ (t->tm.tm_sec, u->tm.tm_sec) - merge_ (t->tm.tm_min, u->tm.tm_min) - merge_ (t->tm.tm_hour, u->tm.tm_hour) - merge_ (t->tm.tm_mday, u->tm.tm_mday) - merge_ (t->tm.tm_mon, u->tm.tm_mon) - merge_ (t->tm.tm_year, u->tm.tm_year) - merge_ (t->tm.tm_wday, u->tm.tm_yday) - merge_ (t->ymodulus, u->ymodulus) - merge_ (t->yweek, u->yweek) -# undef merge_ - if (u->zone != TM_UNDEFINED_ZONE) - t->zone = u->zone; - return 0; -} - -/* Parse a date/time prefix of S, putting the parsed result into *T. - Return the first character after the prefix. - The prefix may contain no useful information; - in that case, *T will contain only undefined values. */ -char * -partime (s, t) - char const *s; - struct partime *t; -{ - struct partime p; - - undefine (t); - - while (*s) - { - int i = 0; - char const *s1; - - do - { - if (! (s1 = parse_prefix (s, &p, &i))) - return (char *) s; - } - while (merge_partime (t, &p) != 0); - - s = s1; - } - - return (char *) s; -} Property changes on: vendor/misc-GNU/patch/2.5/partime.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/getopt.c =================================================================== --- vendor/misc-GNU/patch/2.5/getopt.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/getopt.c (nonexistent) @@ -1,1053 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#include -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -extern pid_t __libc_pid; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -text_set_element (__libc_subinit, store_args_and_env); - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); - memset (&new_str[nonoption_flags_max_len], '\0', - top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - { - memcpy (__getopt_nonoption_flags, orig_str, len); - memset (&__getopt_nonoption_flags[len], '\0', - nonoption_flags_max_len - len); - } - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.5/getopt.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/getopt.h =================================================================== --- vendor/misc-GNU/patch/2.5/getopt.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/getopt.h (nonexistent) @@ -1,133 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ Property changes on: vendor/misc-GNU/patch/2.5/getopt.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/COPYING =================================================================== --- vendor/misc-GNU/patch/2.5/COPYING (revision 358868) +++ vendor/misc-GNU/patch/2.5/COPYING (nonexistent) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Property changes on: vendor/misc-GNU/patch/2.5/COPYING ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/inp.h =================================================================== --- vendor/misc-GNU/patch/2.5/inp.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/inp.h (nonexistent) @@ -1,10 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.h,v 1.4 1997/04/07 01:07:00 eggert Exp $ */ - -XTERN LINENUM input_lines; /* how long is input file in lines */ - -char const *ifetch PARAMS ((LINENUM, int, size_t *)); -void get_input_file PARAMS ((char const *, char const *)); -void re_input PARAMS ((void)); -void scan_input PARAMS ((char *)); Property changes on: vendor/misc-GNU/patch/2.5/inp.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/getopt1.c =================================================================== --- vendor/misc-GNU/patch/2.5/getopt1.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/getopt1.c (nonexistent) @@ -1,189 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "getopt.h" - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.5/getopt1.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/partime.h =================================================================== --- vendor/misc-GNU/patch/2.5/partime.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/partime.h (nonexistent) @@ -1,67 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#define TM_UNDEFINED (-1) -#define TM_DEFINED(x) (0 <= (x)) - -/* #include if you want to use these symbols. */ -#define TM_LOCAL_ZONE LONG_MIN -#define TM_UNDEFINED_ZONE (LONG_MIN + 1) - -struct partime - { - /* This structure describes the parsed time. - Only the following tm_* values in it are used: - sec, min, hour, mday, mon, year, wday, yday. - If TM_UNDEFINED (value), the parser never found the value. - The tm_year field is the actual year, not the year - 1900; - but see ymodulus below. */ - struct tm tm; - - /* If !TM_UNDEFINED (ymodulus), - then tm.tm_year is actually modulo ymodulus. */ - int ymodulus; - - /* Week of year, ISO 8601 style. - If TM_UNDEFINED (yweek), the parser never found yweek. - Weeks start on Mondays. - Week 1 includes Jan 4. */ - int yweek; - - /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */ - long zone; - }; - -#if defined __STDC__ || has_prototypes -# define __PARTIME_P(x) x -#else -# define __PARTIME_P(x) () -#endif - -char *partime __PARTIME_P ((char const *, struct partime *)); -char *parzone __PARTIME_P ((char const *, long *)); Property changes on: vendor/misc-GNU/patch/2.5/partime.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/rename.c =================================================================== --- vendor/misc-GNU/patch/2.5/rename.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/rename.c (nonexistent) @@ -1,112 +0,0 @@ -/* BSD compatible rename and directory rename function for System V. - Copyright (C) 1988, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#ifndef errno -extern int errno; -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -/* Rename file FROM to file TO. - Return 0 if successful, -1 if not. */ - -int -rename (from, to) - char *from; - char *to; -{ - struct stat from_stats, to_stats; - int pid, status; - - if (stat (from, &from_stats)) - return -1; - - /* Be careful not to unlink `from' if it happens to be equal to `to' or - (on filesystems that silently truncate filenames after 14 characters) - if `from' and `to' share the significant characters. */ - if (stat (to, &to_stats)) - { - if (errno != ENOENT) - return -1; - } - else - { - if ((from_stats.st_dev == to_stats.st_dev) - && (from_stats.st_ino == to_stats.st_ino)) - /* `from' and `to' designate the same file on that filesystem. */ - return 0; - - if (unlink (to) && errno != ENOENT) - return -1; - } - -#ifdef MVDIR - -/* If MVDIR is defined, it should be the full filename of a setuid root - program able to link and unlink directories. If MVDIR is not defined, - then the capability of renaming directories may be missing. */ - - if (S_ISDIR (from_stats.st_mode)) - { - /* Need a setuid root process to link and unlink directories. */ - pid = fork (); - switch (pid) - { - case -1: /* Error. */ - error (1, errno, "cannot fork"); - - case 0: /* Child. */ - execl (MVDIR, "mvdir", from, to, (char *) 0); - error (255, errno, "cannot run `%s'", MVDIR); - - default: /* Parent. */ - while (wait (&status) != pid) - /* Do nothing. */ ; - - errno = 0; /* mvdir printed the system error message. */ - if (status) - return -1; - } - } - else - -#endif /* MVDIR */ - - { - if (link (from, to)) - return -1; - if (unlink (from) && errno != ENOENT) - { - unlink (to); - return -1; - } - } - return 0; -} Property changes on: vendor/misc-GNU/patch/2.5/rename.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/patch.1 =================================================================== --- vendor/misc-GNU/patch/2.5/patch.1 (revision 358868) +++ vendor/misc-GNU/patch/2.5/patch.1 (nonexistent) @@ -1,1064 +0,0 @@ -.\" patch man page -.de Id -.ds Dt \\$4 -.. -.Id $Id: patch.man,v 1.23 1997/07/16 12:26:36 eggert Exp $ -.ds = \-\^\- -.de Sp -.if t .sp .3 -.if n .sp -.. -.TH PATCH 1 \*(Dt GNU -.ta 3n -.SH NAME -patch \- apply a diff file to an original -.SH SYNOPSIS -.B patch -.RI [ options ] -.RI [ originalfile -.RI [ patchfile ]] -.Sp -but usually just -.Sp -.BI "patch \-p" "num" -.BI < patchfile -.SH DESCRIPTION -.B patch -takes a patch file -.I patchfile -containing a difference listing produced by the -.B diff -program and applies those differences to one or more original files, -producing patched versions. -Normally the patched versions are put in place of the originals. -Backups can be made; see the -.B \-b -or -.B \*=backup -option. -The names of the files to be patched are usually taken from the patch file, -but if there's just one file to be patched it can specified on the -command line as -.IR originalfile . -.PP -Upon startup, patch attempts to determine the type of the diff listing, -unless overruled by a -\fB\-c\fP (\fB\*=context\fP), -\fB\-e\fP (\fB\*=ed\fP), -\fB\-n\fP (\fB\*=normal\fP), -or -\fB\-u\fP (\fB\*=unified\fP) -option. -Context diffs (old-style, new-style, and unified) and -normal diffs are applied by the -.B patch -program itself, while -.B ed -diffs are simply fed to the -.BR ed (1) -editor via a pipe. -.PP -.B patch -tries to skip any leading garbage, apply the diff, -and then skip any trailing garbage. -Thus you could feed an article or message containing a -diff listing to -.BR patch , -and it should work. -If the entire diff is indented by a consistent amount, -or if a context diff is encapsulated one or more times by prepending -"\fB\- \fP" to lines starting with "\fB\-\fP" as specified by Internet RFC 934, -this is taken into account. -.PP -With context diffs, and to a lesser extent with normal diffs, -.B patch -can detect when the line numbers mentioned in the patch are incorrect, -and attempts to find the correct place to apply each hunk of the patch. -As a first guess, it takes the line number mentioned for the hunk, plus or -minus any offset used in applying the previous hunk. -If that is not the correct place, -.B patch -scans both forwards and backwards for a set of lines matching the context -given in the hunk. -First -.B patch -looks for a place where all lines of the context match. -If no such place is found, and it's a context diff, and the maximum fuzz factor -is set to 1 or more, then another scan takes place ignoring the first and last -line of context. -If that fails, and the maximum fuzz factor is set to 2 or more, -the first two and last two lines of context are ignored, -and another scan is made. -(The default maximum fuzz factor is 2.) -If -.B patch -cannot find a place to install that hunk of the patch, it puts the -hunk out to a reject file, which normally is the name of the output file -plus a -.B \&.rej -suffix, or -.B # -if -.B \&.rej -would generate a file name that is too long -(if even appending the single character -.B # -makes the file name too long, then -.B # -replaces the file name's last character). -(The rejected hunk comes out in ordinary context diff form regardless of -the input patch's form. -If the input was a normal diff, many of the contexts are simply null.) -The line numbers on the hunks in the reject file may be different than -in the patch file: they reflect the approximate location patch thinks the -failed hunks belong in the new file rather than the old one. -.PP -As each hunk is completed, you are told if the hunk -failed, and if so which line (in the new file) -.B patch -thought the hunk should go on. -If the hunk is installed at a different line -from the line number specified in the diff you -are told the offset. -A single large offset -.I may -indicate that a hunk was installed in the -wrong place. -You are also told if a fuzz factor was used to make the match, in which -case you should also be slightly suspicious. -If the -.B \*=verbose -option is given, you are also told about hunks that match exactly. -.PP -If no original file -.I origfile -is specified on the command line, -.B patch -tries to figure out from the leading garbage what the name of the file -to edit is, using the following rules. -.TP 3 -.B " \(bu" -If the header is that of a context diff, -.B patch -takes the old and new file names in the header. -Any -.B /dev/null -names are ignored. -.TP -.B " \(bu" -If there is an -.B Index:\& -line in the leading garbage -and if either the old and new names are both absent or the -.B POSIXLY_CORRECT -environment variable is set, -.B patch -takes the name in the -.B Index:\& -line. -.TP -.B " \(bu" -For the purpose of the following rules, -the names are considered to be in the order (old, new, index), -regardless of the order that they appear in the header. -.TP -.B " \(bu" -If some of the named files exist, -.B patch -uses the first name if the -.B POSIXLY_CORRECT -environment variable is set, and the best name otherwise. -.TP -.B " \(bu" -If -.B patch -is not ignoring \s-1RCS\s0 and \s-1SCCS\s0 (see the -.BI "\-g\ " num -or -.BI \*=get= num -option), and no named files exist -but an \s-1RCS\s0 or \s-1SCCS\s0 master is found, -.B patch -uses the first named file with an \s-1RCS\s0 or \s-1SCCS\s0 master. -.TP -.B " \(bu" -If no named files exist, no \s-1RCS\s0 or \s-1SCCS\s0 master was found, -some names are given, -.B POSIXLY_CORRECT -is not set, and the patch appears to create a file, -.B patch -uses the best name requiring the creation of the fewest directories. -.TP -.B " \(bu" -If no file name results from the above heuristics, you are asked -for the name of the file to patch. -.LP -To determine the -.I best -of a nonempty list of file names, -.B patch -first takes all the names with the fewest path name components; -of those, it then takes all the names with the shortest basename; -of those, it then takes all the shortest names; -finally, it takes the first remaining name. -.PP -Additionally, if the leading garbage contains a -.B Prereq:\& -line, -.B patch -takes the first word from the prerequisites line (normally a version -number) and checks the original file to see if that word can be found. -If not, -.B patch -asks for confirmation before proceeding. -.PP -The upshot of all this is that you should be able to say, while in a news -interface, something like the following: -.Sp - \fB| patch \-d /usr/src/local/blurfl\fP -.Sp -and patch a file in the -.B blurfl -directory directly from the article containing -the patch. -.PP -If the patch file contains more than one patch, -.B patch -tries to apply each of them as if they came from separate patch files. -This means, among other things, that it is assumed that the name of the file -to patch must be determined for each diff listing, -and that the garbage before each diff listing -contains interesting things such as file names and revision level, as -mentioned previously. -.SH OPTIONS -.TP 3 -\fB\-b\fP or \fB\*=backup\fP -Make backup files. -That is, when patching a file, -rename or copy the original instead of removing it. -When backing up a file that does not exist, -an empty, unreadable backup file is created -as a placeholder to represent the nonexistent file. -See the -.B \-V -or -.B \*=version\-control -option for details about how backup file names are determined. -.TP -.B \*=backup\-if\-mismatch -Back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default unless the -.B POSIXLY_CORRECT -environment variable is set. -.TP -.B \*=no\-backup\-if\-mismatch -Do not back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default if the -.B POSIXLY_CORRECT -environment variable is set. -.TP -\fB\-B\fP \fIpref\fP or \fB\*=prefix=\fP\fIpref\fP -Prefix -.I pref -to a file name when generating its simple backup file name. -For example, with -.B "\-B\ /junk/" -the simple backup file name for -.B src/patch/util.c -is -.BR /junk/src/patch/util.c . -.TP -\fB\*=binary\fP -Read and write all files in binary mode, -except for standard output and -.BR /dev/tty . -This option has no effect on \s-1POSIX\s0-compliant systems. -On systems like \s-1DOS\s0 where this option makes a difference, -the patch should be generated by -.BR "diff\ \-a\ \*=binary" . -.TP -\fB\-c\fP or \fB\*=context\fP -Interpret the patch file as a ordinary context diff. -.TP -\fB\-d\fP \fIdir\fP or \fB\*=directory=\fP\fIdir\fP -Change to the directory -.I dir -immediately, before doing -anything else. -.TP -\fB\-D\fP \fIdefine\fP or \fB\*=ifdef=\fP\fIdefine\fP -Use the -.BR #ifdef " .\|.\|. " #endif -construct to mark changes, with -.I define -as the differentiating symbol. -.TP -.B "\*=dry\-run" -Print the results of applying the patches without actually changing any files. -.TP -\fB\-e\fP or \fB\*=ed\fP -Interpret the patch file as an -.B ed -script. -.TP -\fB\-E\fP or \fB\*=remove\-empty\-files\fP -Remove output files that are empty after the patches have been applied. -Normally this option is unnecessary, since -.B patch -can examine the time stamps on the header to determine whether a file -should exist after patching. -However, if the input is not a context diff or if the -.B POSIXLY_CORRECT -environment variable is set, -.B patch -does not remove empty patched files unless this option is given. -When -.B patch -removes a file, it also attempts to remove any empty ancestor directories. -.TP -\fB\-f\fP or \fB\*=force\fP -Assume that the user knows exactly what he or she is doing, and do not -ask any questions. Skip patches whose headers -do not say which file is to be patched; patch files even though they have the -wrong version for the -.B Prereq:\& -line in the patch; and assume that -patches are not reversed even if they look like they are. -This option does not suppress commentary; use -.B \-s -for that. -.TP -\fB\-F\fP \fInum\fP or \fB\*=fuzz=\fP\fInum\fP -Set the maximum fuzz factor. -This option only applies to diffs that have context, and causes -.B patch -to ignore up to that many lines in looking for places to install a hunk. -Note that a larger fuzz factor increases the odds of a faulty patch. -The default fuzz factor is 2, and it may not be set to more than -the number of lines of context in the context diff, ordinarily 3. -.TP -\fB\-g\fP \fInum\fP or \fB\*=get=\fP\fInum\fP -This option controls -.BR patch 's -actions when a file is under \s-1RCS\s0 or \s-1SCCS\s0 control, -and does not exist or is read-only and matches the default version. -If -.I num -is positive, -.B patch -gets (or checks out) the file from the revision control system; if zero, -.B patch -ignores \s-1RCS\s0 and \s-1SCCS\s0 and does not get the file; and if negative, -.B patch -asks the user whether to get the file. -The default value of this option is given by the value of the -.B PATCH_GET -environment variable if it is set; if not, the default value is zero if -.B POSIXLY_CORRECT -is set, negative otherwise. -.TP -.B "\*=help" -Print a summary of options and exit. -.TP -\fB\-i\fP \fIpatchfile\fP or \fB\*=input=\fP\fIpatchfile\fP -Read the patch from -.IR patchfile . -If -.I patchfile -is -.BR \- , -read from standard input, the default. -.TP -\fB\-l\fP or \fB\*=ignore\-whitespace\fP -Match patterns loosely, in case tabs or spaces -have been munged in your files. -Any sequence of one or more blanks in the patch file matches any sequence -in the original file, and sequences of blanks at the ends of lines are ignored. -Normal characters must still match exactly. -Each line of the context must still match a line in the original file. -.TP -\fB\-n\fP or \fB\*=normal\fP -Interpret the patch file as a normal diff. -.TP -\fB\-N\fP or \fB\*=forward\fP -Ignore patches that seem to be reversed or already applied. -See also -.BR \-R . -.TP -\fB\-o\fP \fIoutfile\fP or \fB\*=output=\fP\fIoutfile\fP -Send output to -.I outfile -instead of patching files in place. -.TP -\fB\-p\fP\fInum\fP or \fB\*=strip\fP\fB=\fP\fInum\fP -Strip the smallest prefix containing -.I num -leading slashes from each file name found in the patch file. -A sequence of one or more adjacent slashes is counted as a single slash. -This controls how file names found in the patch file are treated, in case -you keep your files in a different directory than the person who sent -out the patch. -For example, supposing the file name in the patch file was -.Sp - \fB/u/howard/src/blurfl/blurfl.c\fP -.Sp -setting -.B \-p0 -gives the entire file name unmodified, -.B \-p1 -gives -.Sp - \fBu/howard/src/blurfl/blurfl.c\fP -.Sp -without the leading slash, -.B \-p4 -gives -.Sp - \fBblurfl/blurfl.c\fP -.Sp -and not specifying -.B \-p -at all just gives you \fBblurfl.c\fP. -Whatever you end up with is looked for either in the current directory, -or the directory specified by the -.B \-d -option. -.TP -\fB\-r\fP \fIrejectfile\fP or \fB\*=reject\-file=\fP\fIrejectfile\fP -Put rejects into -.I rejectfile -instead of the default -.B \&.rej -file. -.TP -\fB\-R\fP or \fB\*=reverse\fP -Assume that this patch was created with the old and new files swapped. -(Yes, I'm afraid that does happen occasionally, human nature being what it -is.) -.B patch -attempts to swap each hunk around before applying it. -Rejects come out in the swapped format. -The -.B \-R -option does not work with -.B ed -diff scripts because there is too little -information to reconstruct the reverse operation. -.Sp -If the first hunk of a patch fails, -.B patch -reverses the hunk to see if it can be applied that way. -If it can, you are asked if you want to have the -.B \-R -option set. -If it can't, the patch continues to be applied normally. -(Note: this method cannot detect a reversed patch if it is a normal diff -and if the first command is an append (i.e. it should have been a delete) -since appends always succeed, due to the fact that a null context matches -anywhere. -Luckily, most patches add or change lines rather than delete them, so most -reversed normal diffs begin with a delete, which fails, triggering -the heuristic.) -.TP -\fB\-s\fP or \fB\*=silent\fP or \fB\*=quiet\fP -Work silently, unless an error occurs. -.TP -\fB\-t\fP or \fB\*=batch\fP -Suppress questions like -.BR \-f , -but make some different assumptions: -skip patches whose headers do not contain file names (the same as \fB\-f\fP); -skip patches for which the file has the wrong version for the -.B Prereq:\& -line -in the patch; and assume that patches are reversed if they look like -they are. -.TP -\fB\-T\fP or \fB\*=set\-time\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use local time. This option is not recommended, because patches using -local time cannot easily be used by people in other time zones, and -because local time stamps are ambiguous when local clocks move backwards -during daylight-saving time adjustments. Instead of using this option, -generate patches with \s-1UTC\s0 and use the -.B \-Z -or -.B \*=set\-utc -option instead. -.TP -\fB\-u\fP or \fB\*=unified\fP -Interpret the patch file as a unified context diff. -.TP -\fB\-v\fP or \fB\*=version\fP -Print out -.BR patch 's -revision header and patch level, and exit. -.TP -\fB\-V\fP \fImethod\fP or \fB\*=version\-control=\fP\fImethod\fP -Use -.I method -to determine -backup file names. The method can also be given by the -.B PATCH_VERSION_CONTROL -(or, if that's not set, the -.BR VERSION_CONTROL ) -environment variable, which is overridden by this option. -The method does not affect whether backup files are made; -it affects only the names of any backup files that are made. -.Sp -The value of -.I method -is like the \s-1GNU\s0 -Emacs `version-control' variable; -.B patch -also recognizes synonyms that -are more descriptive. The valid values for -.I method -are (unique abbreviations are -accepted): -.RS -.TP 3 -\fBexisting\fP or \fBnil\fP -Make numbered backups of files that already have them, -otherwise simple backups. -This is the default. -.TP -\fBnumbered\fP or \fBt\fP -Make numbered backups. The numbered backup file name for -.I F -is -.IB F .~ N ~ -where -.I N -is the version number. -.TP -\fBsimple\fP or \fBnever\fP -Make simple backups. -The -.B \-B -or -.BR \*=prefix , -.B \-Y -or -.BR \*=basename\-prefix , -and -.B \-z -or -.BR \*=suffix -options specify the simple backup file name. -If none of these options are given, then a simple backup suffix is used; -it is the value of the -.B SIMPLE_BACKUP_SUFFIX -environment variable if set, and is -.B \&.orig -otherwise. -.PP -With numbered or simple backups, -if the backup file name is too long, the backup suffix -.B ~ -is used instead; if even appending -.B ~ -would make the name too long, then -.B ~ -replaces the last character of the file name. -.RE -.TP -\fB\*=verbose\fP -Output extra information about the work being done. -.TP -\fB\-x\fP \fInum\fP or \fB\*=debug=\fP\fInum\fP -Set internal debugging flags of interest only to -.B patch -patchers. -.TP -\fB\-Y\fP \fIpref\fP or \fB\*=basename\-prefix=\fP\fIpref\fP -Prefix -.I pref -to the basename of a file name when generating its simple backup file name. -For example, with -.B "\-Y\ .del/" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/.del/util.c . -.TP -\fB\-z\fP \fIsuffix\fP or \fB\*=suffix=\fP\fIsuffix\fP -Use -.I suffix -as the simple backup suffix. -For example, with -.B "\-z\ -" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/util.c- . -The backup suffix may also be specified by the -.B SIMPLE_BACKUP_SUFFIX -environment variable, which is overridden by this option. -.TP -\fB\-Z\fP or \fB\*=set\-utc\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use Coordinated Universal Time (\s-1UTC\s0, often known as \s-1GMT\s0). -Also see the -.B \-T -or -.B \*=set\-time -option. -.Sp -The -.B \-Z -or -.B \*=set\-utc -and -.B \-T -or -.B \*=set\-time -options normally refrain from setting a file's time if the file's original time -does not match the time given in the patch header, or if its -contents do not match the patch exactly. However, if the -.B \-f -or -.B \*=force -option is given, the file time is set regardless. -.Sp -Due to the limitations of -.B diff -output format, these options cannot update the times of files whose -contents have not changed. Also, if you use these options, you should remove -(e.g. with -.BR "make\ clean" ) -all files that depend on the patched files, so that later invocations of -.B make -do not get confused by the patched files' times. -.SH ENVIRONMENT -.TP 3 -\fBPATCH_GET\fP -This specifies whether -.B patch -gets missing or read-only files from \s-1RCS\s0 or \s-1SCCS\s0 -by default; see the -.B \-g -or -.B \*=get -option. -.TP -.B POSIXLY_CORRECT -If set, -.B patch -conforms more strictly to the \s-1POSIX\s0 standard: -it takes the first existing file from the list (old, new, index) -when intuiting file names from diff headers, -it does not remove files that are empty after patching, -it does not ask whether to get files from \s-1RCS\s0 or \s-1SCCS\s0, -it requires that all options precede the files in the command line, -and it does not backup files when there is a mismatch. -.TP -.B SIMPLE_BACKUP_SUFFIX -Extension to use for simple backup file names instead of -.BR \&.orig . -.TP -\fBTMPDIR\fP, \fBTMP\fP, \fBTEMP\fP -Directory to put temporary files in; -.B patch -uses the first environment variable in this list that is set. -If none are set, the default is system-dependent; -it is normally -.B /tmp -on Unix hosts. -.TP -\fBVERSION_CONTROL\fP or \fBPATCH_VERSION_CONTROL\fP -Selects version control style; see the -.B \-v -or -.B \*=version\-control -option. -.SH FILES -.TP 3 -.IB $TMPDIR "/p\(**" -temporary files -.TP -.B /dev/tty -controlling terminal; used to get answers to questions asked of the user -.SH "SEE ALSO" -.BR diff (1), -.BR ed (1) -.Sp -Marshall T. Rose and Einar A. Stefferud, -Proposed Standard for Message Encapsulation, -Internet RFC 934 (1985-01). -.SH "NOTES FOR PATCH SENDERS" -There are several things you should bear in mind if you are going to -be sending out patches. -.PP -Create your patch systematically. -A good method is the command -.BI "diff\ \-Naur\ " "old\ new" -where -.I old -and -.I new -identify the old and new directories. -The names -.I old -and -.I new -should not contain any slashes. -The -.B diff -command's headers should have dates -and times in Universal Time using traditional Unix format, -so that patch recipients can use the -.B \-Z -or -.B \*=set\-utc -option. -Here is an example command, using Bourne shell syntax: -.Sp - \fBLC_ALL=C TZ=UTC0 diff \-Naur gcc\-2.7 gcc\-2.8\fP -.PP -Tell your recipients how to apply the patch -by telling them which directory to -.B cd -to, and which -.B patch -options to use. The option string -.B "\-Np1" -is recommended. -Test your procedure by pretending to be a recipient and applying -your patch to a copy of the original files. -.PP -You can save people a lot of grief by keeping a -.B patchlevel.h -file which is patched to increment the patch level -as the first diff in the patch file you send out. -If you put a -.B Prereq:\& -line in with the patch, it won't let them apply -patches out of order without some warning. -.PP -You can create a file by sending out a diff that compares -.B /dev/null -or an empty file dated the Epoch (1970-01-01 00:00:00 \s-1UTC\s0) -to the file you want to create. -This only works if the file you want to create doesn't exist already in -the target directory. -Conversely, you can remove a file by sending out a context diff that compares -the file to be deleted with an empty file dated the Epoch. -The file will be removed unless the -.B POSIXLY_CORRECT -environment variable is set and the -.B \-E -or -.B \*=remove\-empty\-files -option is not given. -An easy way to generate patches that create and remove files -is to use \s-1GNU\s0 -.BR diff 's -.B \-N -or -.B \*=new\-file -option. -.PP -If the recipient is supposed to use the -.BI \-p N -option, do not send output that looks like this: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -because the two file names have different numbers of slashes, -and different versions of -.B patch -interpret the file names differently. -To avoid confusion, send output that looks like this instead: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README v2.0.30/prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ v2.0.30/prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -.PP -Avoid sending patches that compare backup file names like -.BR README.orig , -since this might confuse -.B patch -into patching a backup file instead of the real file. -Instead, send patches that compare the same base file names -in different directories, e.g.\& -.B old/README -and -.BR new/README . -.PP -Take care not to send out reversed patches, since it makes people wonder -whether they already applied the patch. -.PP -Try not to have your patch modify derived files -(e.g. the file -.B configure -where there is a line -.B "configure: configure.in" -in your makefile), since the recipient should be -able to regenerate the derived files anyway. -If you must send diffs of derived files, -generate the diffs using \s-1UTC\s0, -have the recipients apply the patch with the -.B \-Z -or -.B \*=set\-utc -option, and have them remove any unpatched files that depend on patched files -(e.g. with -.BR "make\ clean" ). -.PP -While you may be able to get away with putting 582 diff listings into -one file, it may be wiser to group related patches into separate files in -case something goes haywire. -.SH DIAGNOSTICS -Diagnostics generally indicate that -.B patch -couldn't parse your patch file. -.PP -If the -.B \*=verbose -option is given, the message -.B Hmm.\|.\|.\& -indicates that there is unprocessed text in -the patch file and that -.B patch -is attempting to intuit whether there is a patch in that text and, if so, -what kind of patch it is. -.PP -.BR patch 's -exit status is -0 if all hunks are applied successfully, -1 if some hunks cannot be applied, -and 2 if there is more serious trouble. -When applying a set of patches in a loop it behooves you to check this -exit status so you don't apply a later patch to a partially patched file. -.SH CAVEATS -Context diffs cannot reliably represent the creation or deletion of -empty files, empty directories, or special files such as symbolic links. -Nor can they represent changes to file metadata like ownership, permissions, -or whether one file is a hard link to another. -If changes like these are also required, separate instructions -(e.g. a shell script) to accomplish them should accompany the patch. -.PP -.B patch -cannot tell if the line numbers are off in an -.B ed -script, and can detect -bad line numbers in a normal diff only when it finds a change or deletion. -A context diff using fuzz factor 3 may have the same problem. -Until a suitable interactive interface is added, you should probably do -a context diff in these cases to see if the changes made sense. -Of course, compiling without errors is a pretty good indication that the patch -worked, but not always. -.PP -.B patch -usually produces the correct results, even when it has to do a lot of -guessing. -However, the results are guaranteed to be correct only when the patch is -applied to exactly the same version of the file that the patch was -generated from. -.SH "COMPATIBILITY ISSUES" -The \s-1POSIX\s0 standard specifies behavior that differs from -.BR patch 's -traditional behavior. -You should be aware of these differences if you must interoperate with -.B patch -versions 2.1 and earlier, which are not \s-1POSIX\s0-compliant. -.TP 3 -.B " \(bu" -In traditional -.BR patch , -the -.B \-p -option's operand was optional, and a bare -.B \-p -was equivalent to -.BR \-p0. -The -.B \-p -option now requires an operand, and -.B "\-p\ 0" -is now equivalent to -.BR \-p0 . -For maximum compatibility, use options like -.B \-p0 -and -.BR \-p1 . -.Sp -Also, -traditional -.B patch -simply counted slashes when stripping path prefixes; -.B patch -now counts pathname components. -That is, a sequence of one or more adjacent slashes -now counts as a single slash. -For maximum portability, avoid sending patches containing -.B // -in file names. -.TP -.B " \(bu" -In traditional -.BR patch , -backups were enabled by default. -This behavior is now enabled with the -.B \-b -or -.B \*=backup -option. -.Sp -Conversely, in \s-1POSIX\s0 -.BR patch , -backups are never made, even when there is a mismatch. -In \s-1GNU\s0 -.BR patch , -this behavior is enabled with the -.B \*=no\-backup\-if\-mismatch -option or by setting the -.B POSIXLY_CORRECT -environment variable. -.Sp -The -.BI \-b "\ suffix" -option -of traditional -.B patch -is equivalent to the -.BI "\-b\ \-z" "\ suffix" -options of \s-1GNU\s0 -.BR patch . -.TP -.B " \(bu" -Traditional -.B patch -used a complicated (and incompletely documented) method -to intuit the name of the file to be patched from the patch header. -This method was not \s-1POSIX\s0-compliant, and had a few gotchas. -Now -.B patch -uses a different, equally complicated (but better documented) method -that is optionally \s-1POSIX\s0-compliant; we hope it has -fewer gotchas. The two methods are compatible if the -file names in the context diff header and the -.B Index:\& -line are all identical after prefix-stripping. -Your patch is normally compatible if each header's file names -all contain the same number of slashes. -.TP -.B " \(bu" -When traditional -.B patch -asked the user a question, it sent the question to standard error -and looked for an answer from -the first file in the following list that was a terminal: -standard error, standard output, -.BR /dev/tty , -and standard input. -Now -.B patch -sends questions to standard output and gets answers from -.BR /dev/tty . -Defaults for some answers have been changed so that -.B patch -never goes into an infinite loop when using default answers. -.TP -.B " \(bu" -Traditional -.B patch -exited with a status value that counted the number of bad hunks, -or with status 1 if there was real trouble. -Now -.B patch -exits with status 1 if some hunks failed, -or with 2 if there was real trouble. -.TP -.B " \(bu" -Limit yourself to the following options when sending instructions -meant to be executed by anyone running \s-1GNU\s0 -.BR patch , -traditional -.BR patch , -or a \s-1POSIX\s0-compliant -.BR patch . -Spaces are significant in the following list, and operands are required. -.Sp -.nf -.in +3 -.ne 11 -.B \-c -.BI \-d " dir" -.BI \-D " define" -.B \-e -.B \-l -.B \-n -.B \-N -.BI \-o " outfile" -.BI \-p num -.B \-R -.BI \-r " rejectfile" -.in -.fi -.SH BUGS -.B patch -could be smarter about partial matches, excessively deviant offsets and -swapped code, but that would take an extra pass. -.PP -If code has been duplicated (for instance with -\fB#ifdef OLDCODE\fP .\|.\|. \fB#else .\|.\|. #endif\fP), -.B patch -is incapable of patching both versions, and, if it works at all, will likely -patch the wrong one, and tell you that it succeeded to boot. -.PP -If you apply a patch you've already applied, -.B patch -thinks it is a reversed patch, and offers to un-apply the patch. -This could be construed as a feature. -.SH COPYING -Copyright -.if t \(co -1984, 1985, 1986, 1988 Larry Wall. -.br -Copyright -.if t \(co -1997 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the copyright holders instead of in -the original English. -.SH AUTHORS -Larry Wall wrote the original version of -.BR patch . -Paul Eggert removed -.BR patch 's -arbitrary limits; added support for binary files, -setting file times, and deleting files; -and made it conform better to \s-1POSIX\s0. -Other contributors include Wayne Davison, who added unidiff support, -and David MacKenzie, who added configuration and backup support. Property changes on: vendor/misc-GNU/patch/2.5/patch.1 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/install-sh =================================================================== --- vendor/misc-GNU/patch/2.5/install-sh (revision 358868) +++ vendor/misc-GNU/patch/2.5/install-sh (nonexistent) @@ -1,250 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 Property changes on: vendor/misc-GNU/patch/2.5/install-sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/argmatch.c =================================================================== --- vendor/misc-GNU/patch/2.5/argmatch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/argmatch.c (nonexistent) @@ -1,92 +0,0 @@ -/* argmatch.c -- find a match for a string in an array - Copyright (C) 1990, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#include - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -/* If ARG is an unambiguous match for an element of the - null-terminated array OPTLIST, return the index in OPTLIST - of the matched element, else -1 if it does not match any element - or -2 if it is ambiguous (is a prefix of more than one element). */ - -int -argmatch (arg, optlist) - const char *arg; - const char *const *optlist; -{ - int i; /* Temporary index in OPTLIST. */ - size_t arglen; /* Length of ARG. */ - int matchind = -1; /* Index of first nonexact match. */ - int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ - - arglen = strlen (arg); - - /* Test all elements for either exact match or abbreviated matches. */ - for (i = 0; optlist[i]; i++) - { - if (!strncmp (optlist[i], arg, arglen)) - { - if (strlen (optlist[i]) == arglen) - /* Exact match found. */ - return i; - else if (matchind == -1) - /* First nonexact match found. */ - matchind = i; - else - /* Second nonexact match found. */ - ambiguous = 1; - } - } - if (ambiguous) - return -2; - else - return matchind; -} - -/* Error reporting for argmatch. - KIND is a description of the type of entity that was being matched. - VALUE is the invalid value that was given. - PROBLEM is the return value from argmatch. */ - -void -invalid_arg (kind, value, problem) - const char *kind; - const char *value; - int problem; -{ - fprintf (stderr, "%s: ", program_name); - if (problem == -1) - fprintf (stderr, "invalid"); - else /* Assume -2. */ - fprintf (stderr, "ambiguous"); - fprintf (stderr, " %s `%s'\n", kind, value); -} Property changes on: vendor/misc-GNU/patch/2.5/argmatch.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/NEWS =================================================================== --- vendor/misc-GNU/patch/2.5/NEWS (revision 358868) +++ vendor/misc-GNU/patch/2.5/NEWS (nonexistent) @@ -1,173 +0,0 @@ -Known problems: - -* The diffutils 2.7 documentation for `patch' is obsolete; this should be - fixed in diffutils 2.8. Until then, see `patch --help' or `man patch'. - -Changes in version 2.5: - -* Version control is now independent of whether backups are made. - The -V or --version-control option and the VERSION_CONTROL and - PATCH_VERSION_CONTROL environment variables no longer affect whether - backups are made; they affect only the names of the backup files. - -* When asking the user whether to reverse a patch, - the default answer is now `no' instead of `yes'. - -* `patch' can now recognize context diffs that have been encapsulated - by prepending "- " to lines beginning with "-" (as per Internet RFC 934). - -* `patch' now reports an error if the input contains garbage and no patches. - -Changes in version 2.4: - -* New options: - -Z or --set-utc sets times of patched files, assuming diff uses UTC (GMT). - -T or --set-time is similar, assuming local time (not recommended). - --backup-if-mismatch makes a backup if the patch does not match exactly - --no-backup-if-mismatch makes a backup only if otherwise requested - -* The default is now --backup-if-mismatch unless POSIXLY_CORRECT is set. - -* The -B or --prefix, -Y or --basename-prefix, and -z or --suffix options - no longer affect whether backups are made (as they did in patch 2.2 and 2.3); - they now merely specify the file names used when simple backups are made. - -* When patching a nonexistent file and making backups, an empty backup file - is now made (just as with traditional patch); but the backup file is - unreadable, as a way of indicating that it represents a nonexistent file. - -* `patch' now matches against empty and nonexistent files more generously. - A patch against an empty file applies to a nonexistent file, and vice versa. - -* -g or --get and PATCH_GET now have a numeric value that specifies - whether `patch' is getting files. - If the value is positive, working files are gotten from RCS or SCCS files; - if zero, `patch' ignores RCS and SCCS and working files are not gotten; - and if negative, `patch' asks the user whether to get each file. - The default is normally negative, but it is zero if POSIXLY_CORRECT is set. - -* The -G or --no-get option introduced in GNU patch 2.3 has been removed; - use -g0 instead. - -* The method used to intuit names of files to be patched is changed again: - `Index:' lines are normally ignored for context diffs, - and RCS and SCCS files are normally looked for when files do not exist. - The complete new method is described in the man page. - -* By default, `patch' is now more verbose when patches do not match exactly. - -* The manual page has a new COMPATIBILITY ISSUES section. - -Changes in version 2.3: - -* Unless the POSIXLY_CORRECT environment variable is set: - - - `patch' now distinguishes more accurately between empty and - nonexistent files if the input is a context diff. - A file is assumed to not exist if its context diff header - suggests that it is empty, and if the header timestamp - looks like it might be equivalent to 1970-01-01 00:00:00 UTC. - - Files that ``become nonexistent'' after patching are now removed. - When a file is removed, any empty ancestor directories are also removed. - -* Files are now automatically gotten from RCS and SCCS - if the -g or --get option is specified. - (The -G or --no-get option, also introduced in 2.3, was withdrawn in 2.4.) - -* If the PATCH_VERSION_CONTROL environment variable is set, - it overrides the VERSION_CONTROL environment variable. - -* The method used to intuit names of files to be patched is changed. - (It was further revised in 2.4; see above.) - -* The new --binary option makes `patch' read and write files in binary mode. - This option has no effect on POSIX-compliant hosts; - it is useful only in on operating systems like DOS - that distinguish between text and binary I/O. - -* The environment variables TMP and TEMP are consulted for the name of - the temporary directory if TMPDIR is not set. - -* A port to MS-DOS and MS-Windows is available; see the `pc' directory. - -* Backup file names are no longer ever computed by uppercasing characters, - since this isn't portable to systems with case-insensitive file names. - -Changes in version 2.2: - -* Arbitrary limits removed (e.g. line length, file name length). - -* On POSIX.1-compliant hosts, you can now patch binary files using the output - of GNU `diff -a'. - -* New options: - --dry-run - --help - --verbose - -i FILE or --input=FILE - -Y PREF or --basename-prefix=PREF - -* patch is now quieter by default; use --verbose for the old chatty behavior. - -* Patch now complies better with POSIX.2 if your host complies with POSIX.1. - - Therefore: - - By default, no backups are made. - (But this was changed again in patch 2.4; see above.) - - The simple backup file name for F defaults to F.orig - regardless of whether the file system supports long file names, - and F~ is used only if F.orig is too long for that particular file. - - Similarly for the reject file names F.rej and F#. - - Also: - - The pseudo-option `+' has been withdrawn. - - -b is equivalent to --version-control=simple; - `-z SUFF' has the meaning that `-b SUFF' used to. - - Names of files to be patched are taken first from *** line and then from - --- line of context diffs; then from Index: line; /dev/tty is - consulted if none of the above files exist. However, if the patch - appears to create a file, the file does not have to exist: instead, - the first name with the longest existing directory prefix is taken. - (These rules were changed again in patch 2.3 and 2.4; see above.) - - Exit status 0 means success, 1 means hunks were rejected, 2 means trouble. - - `-l' ignores changes only in spaces and tabs, not in other white space. - - If no `-p' option is given, `-pINFINITY' is assumed, instead of trying - to guess the proper value. - - `-p' now requires an operand; use `-p 0' to get the effect of the old plain - `-p' option. - - `-p' treats two or more adjacent slashes as if it were one slash. - - The TERM signal is caught. - - New option `-i F' reads patch from F instead of stdin. - -* The `patch' options and build procedure conform to current GNU standards. - For example, the `--version' option now outputs copyright information. - -* When the patch is creating a file, but a nonempty file of that name already - exists, `patch' now asks for confirmation before patching. - -* RCS is used only if the version control method is `existing' - and there is already an RCS file. Similarly for SCCS. - (But this was changed again in patch 2.3 and 2.4; see above.) - -* Copyright notices have been clarified. Every file in this version of `patch' - can be distributed under the GNU General Public License. See README for - details. - -Changes in version 2.1: - -* A few more portability bugs have been fixed. The version number has - been changed from 2.0.12g11 to 2.1, because the name - `patch-2.0.12g10' was too long for traditional Unix file systems. - -Versions 2.0.12g9 through 2.0.12g11 fix various portability bugs. - -Changes in version 2.0.12g8: - -* Start of the 12g series, with a GNU-style configure script and - long-named options. -* Added the -t --batch option, similar to -f. -* Improved detection of files that are locked under RCS or SCCS. -* Reinstate the -E option to remove output files that are empty after - being patched. -* Print the system error message when system calls fail. -* Fixed various bugs and portability problems. Property changes on: vendor/misc-GNU/patch/2.5/NEWS ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/util.c =================================================================== --- vendor/misc-GNU/patch/2.5/util.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/util.c (nonexistent) @@ -1,1079 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.c,v 1.24 1997/07/10 08:16:12 eggert Exp $ */ - -/* -Copyright 1986 Larry Wall -Copyright 1992, 1993, 1997 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#define XTERN extern -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#include -#include - -#include -#if !defined SIGCHLD && defined SIGCLD -#define SIGCHLD SIGCLD -#endif -#if ! HAVE_RAISE -# define raise(sig) kill (getpid (), sig) -#endif - -#ifdef __STDC__ -# include -# define vararg_start va_start -#else -# define vararg_start(ap,p) va_start (ap) -# if HAVE_VARARGS_H -# include -# else - typedef char *va_list; -# define va_dcl int va_alist; -# define va_start(ap) ((ap) = (va_list) &va_alist) -# define va_arg(ap, t) (((t *) ((ap) += sizeof (t))) [-1]) -# define va_end(ap) -# endif -#endif - -static void makedirs PARAMS ((char *)); - -/* Move a file FROM to TO, renaming it if possible and copying it if necessary. - If we must create TO, use MODE to create it. - If FROM is null, remove TO (ignoring FROMSTAT). - Back up TO if BACKUP is nonzero. */ - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -void -move_file (char const *from, char *to, mode_t mode, int backup) -#else -void -move_file (from, to, mode, backup) - char const *from; - char *to; - mode_t mode; - int backup; -#endif -{ - struct stat to_st; - int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno; - - if (backup) - { - int try_makedirs_errno = 0; - char *bakname; - - if (origprae || origbase) - { - char const *p = origprae ? origprae : ""; - char const *b = origbase ? origbase : ""; - char const *o = base_name (to); - size_t plen = strlen (p); - size_t tlen = o - to; - size_t blen = strlen (b); - size_t osize = strlen (o) + 1; - bakname = xmalloc (plen + tlen + blen + osize); - memcpy (bakname, p, plen); - memcpy (bakname + plen, to, tlen); - memcpy (bakname + plen + tlen, b, blen); - memcpy (bakname + plen + tlen + blen, o, osize); - for (p += FILESYSTEM_PREFIX_LEN (p); *p; p++) - if (ISSLASH (*p)) - { - try_makedirs_errno = ENOENT; - break; - } - } - else - { - bakname = find_backup_file_name (to); - if (!bakname) - memory_fatal (); - } - - if (to_errno) - { - int fd; - if (debug & 4) - say ("creating empty unreadable file `%s'\n", bakname); - try_makedirs_errno = ENOENT; - unlink (bakname); - while ((fd = creat (bakname, 0)) < 0) - { - if (errno != try_makedirs_errno) - pfatal ("can't create file `%s'", bakname); - makedirs (bakname); - try_makedirs_errno = 0; - } - if (close (fd) != 0) - pfatal ("can't close `%s'", bakname); - } - else - { - if (debug & 4) - say ("renaming `%s' to `%s'\n", to, bakname); - while (rename (to, bakname) != 0) - { - if (errno != try_makedirs_errno) - pfatal ("can't rename `%s' to `%s'", to, bakname); - makedirs (bakname); - try_makedirs_errno = 0; - } - } - - free (bakname); - } - - if (from) - { - if (debug & 4) - say ("renaming `%s' to `%s'\n", from, to); - - if (rename (from, to) != 0) - { - int to_dir_known_to_exist = 0; - - if (errno == ENOENT - && (to_errno == -1 || to_errno == ENOENT)) - { - makedirs (to); - to_dir_known_to_exist = 1; - if (rename (from, to) == 0) - return; - } - - if (errno == EXDEV) - { - if (! backup) - { - if (unlink (to) == 0) - to_dir_known_to_exist = 1; - else if (errno != ENOENT) - pfatal ("can't remove `%s'", to); - } - if (! to_dir_known_to_exist) - makedirs (to); - copy_file (from, to, mode); - return; - } - - pfatal ("can't rename `%s' to `%s'", from, to); - } - } - else if (! backup) - { - if (debug & 4) - say ("removing `%s'\n", to); - if (unlink (to) != 0) - pfatal ("can't remove `%s'", to); - } -} - -/* Create FILE with OPEN_FLAGS, and with MODE adjusted so that - we can read and write the file and that the file is not executable. - Return the file descriptor. */ -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -int -create_file (char const *file, int open_flags, mode_t mode) -#else -int -create_file (file, open_flags, mode) - char const *file; - int open_flags; - mode_t mode; -#endif -{ - int fd; - mode |= S_IRUSR | S_IWUSR; - mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); - if (! (O_CREAT && O_TRUNC)) - close (creat (file, mode)); - fd = open (file, O_CREAT | O_TRUNC | open_flags, mode); - if (fd < 0) - pfatal ("can't create `%s'", file); - return fd; -} - -/* Copy a file. */ - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -void -copy_file (char const *from, char const *to, mode_t mode) -#else -void -copy_file (from, to, mode) - char const *from; - char const *to; - mode_t mode; -#endif -{ - int tofd; - int fromfd; - size_t i; - - if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) - pfatal ("can't reopen `%s'", from); - tofd = create_file (to, O_WRONLY | O_BINARY, mode); - while ((i = read (fromfd, buf, bufsize)) != 0) - { - if (i == -1) - read_fatal (); - if (write (tofd, buf, i) != i) - write_fatal (); - } - if (close (fromfd) != 0) - read_fatal (); - if (close (tofd) != 0) - write_fatal (); -} - -static char const DEV_NULL[] = NULL_DEVICE; - -static char const SCCSPREFIX[] = "s."; -static char const GET[] = "get "; -static char const GET_LOCKED[] = "get -e "; -static char const SCCSDIFF1[] = "get -p "; -static char const SCCSDIFF2[] = "|diff - %s"; - -static char const RCSSUFFIX[] = ",v"; -static char const CHECKOUT[] = "co %s"; -static char const CHECKOUT_LOCKED[] = "co -l %s"; -static char const RCSDIFF1[] = "rcsdiff %s"; - -/* Return "RCS" if FILENAME is controlled by RCS, - "SCCS" if it is controlled by SCCS, and 0 otherwise. - READONLY is nonzero if we desire only readonly access to FILENAME. - FILESTAT describes FILENAME's status or is 0 if FILENAME does not exist. - If successful and if GETBUF is nonzero, set *GETBUF to a command - that gets the file; similarly for DIFFBUF and a command to diff the file. - *GETBUF and *DIFFBUF must be freed by the caller. */ -char const * -version_controller (filename, readonly, filestat, getbuf, diffbuf) - char const *filename; - int readonly; - struct stat const *filestat; - char **getbuf; - char **diffbuf; -{ - struct stat cstat; - char const *filebase = base_name (filename); - char const *dotslash = *filename == '-' ? "./" : ""; - size_t dir_len = filebase - filename; - size_t filenamelen = strlen (filename); - size_t maxfixlen = sizeof "SCCS/" - 1 + sizeof SCCSPREFIX - 1; - size_t maxtrysize = filenamelen + maxfixlen + 1; - size_t quotelen = quote_system_arg (0, filename); - size_t maxgetsize = sizeof GET_LOCKED + quotelen + maxfixlen; - size_t maxdiffsize = - (sizeof SCCSDIFF1 + sizeof SCCSDIFF2 + sizeof DEV_NULL - 1 - + 2 * quotelen + maxfixlen); - char *trybuf = xmalloc (maxtrysize); - char const *r = 0; - - strcpy (trybuf, filename); - -#define try1(f,a1) (sprintf (trybuf + dir_len, f, a1), stat (trybuf, &cstat) == 0) -#define try2(f,a1,a2) (sprintf (trybuf + dir_len, f, a1,a2), stat (trybuf, &cstat) == 0) - - /* Check that RCS file is not working file. - Some hosts don't report file name length errors. */ - - if ((try2 ("RCS/%s%s", filebase, RCSSUFFIX) - || try1 ("RCS/%s", filebase) - || try2 ("%s%s", filebase, RCSSUFFIX)) - && ! (filestat - && filestat->st_dev == cstat.st_dev - && filestat->st_ino == cstat.st_ino)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? CHECKOUT : CHECKOUT_LOCKED, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - sprintf (p, RCSDIFF1, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "RCS"; - } - else if (try2 ("SCCS/%s%s", SCCSPREFIX, filebase) - || try2 ("%s%s", SCCSPREFIX, filebase)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? GET : GET_LOCKED); - p += strlen (p); - p += quote_system_arg (p, trybuf); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - strcpy (p, SCCSDIFF1); - p += sizeof SCCSDIFF1 - 1; - p += quote_system_arg (p, trybuf); - sprintf (p, SCCSDIFF2, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "SCCS"; - } - - free (trybuf); - return r; -} - -/* Get FILENAME from version control system CS. The file already exists if - EXISTS is nonzero. Only readonly access is needed if READONLY is nonzero. - Use the command GETBUF to actually get the named file. - Store the resulting file status into *FILESTAT. - Return nonzero if successful. */ -int -version_get (filename, cs, exists, readonly, getbuf, filestat) - char const *filename; - char const *cs; - int exists; - int readonly; - char const *getbuf; - struct stat *filestat; -{ - if (patch_get < 0) - { - ask ("Get file `%s' from %s%s? [y] ", filename, - cs, readonly ? "" : " with lock"); - if (*buf == 'n') - return 0; - } - - if (dry_run) - { - if (! exists) - fatal ("can't do dry run on nonexistent version-controlled file `%s'; invoke `%s' and try again", - filename, getbuf); - } - else - { - if (verbosity == VERBOSE) - say ("Getting file `%s' from %s%s...\n", filename, - cs, readonly ? "" : " with lock"); - if (systemic (getbuf) != 0) - fatal ("can't get file `%s' from %s", filename, cs); - if (stat (filename, filestat) != 0) - pfatal ("%s", filename); - } - - return 1; -} - -/* Allocate a unique area for a string. */ - -char * -savebuf (s, size) - register char const *s; - register size_t size; -{ - register char *rv; - - assert (s && size); - rv = malloc (size); - - if (! rv) - { - if (! using_plan_a) - memory_fatal (); - } - else - memcpy (rv, s, size); - - return rv; -} - -char * -savestr(s) - char const *s; -{ - return savebuf (s, strlen (s) + 1); -} - -void -remove_prefix (p, prefixlen) - char *p; - size_t prefixlen; -{ - char const *s = p + prefixlen; - while ((*p++ = *s++)) - continue; -} - -#if !HAVE_VPRINTF -#define vfprintf my_vfprintf -static int vfprintf PARAMS ((FILE *, char const *, va_list)); -static int -vfprintf (stream, format, args) - FILE *stream; - char const *format; - va_list args; -{ -#if !HAVE_DOPRNT && HAVE__DOPRINTF -# define _doprnt _doprintf -#endif -#if HAVE_DOPRNT || HAVE__DOPRINTF - _doprnt (format, args, stream); - return ferror (stream) ? -1 : 0; -#else - int *a = (int *) args; - return fprintf (stream, format, - a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); -#endif -} -#endif /* !HAVE_VPRINTF */ - -/* Terminal output, pun intended. */ - -#ifdef __STDC__ -void -fatal (char const *format, ...) -#else -/*VARARGS1*/ void -fatal (format, va_alist) - char const *format; - va_dcl -#endif -{ - va_list args; - fprintf (stderr, "%s: **** ", program_name); - vararg_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - putc ('\n', stderr); - fflush (stderr); - fatal_exit (0); -} - -void -memory_fatal () -{ - fatal ("out of memory"); -} - -void -read_fatal () -{ - pfatal ("read error"); -} - -void -write_fatal () -{ - pfatal ("write error"); -} - -/* Say something from patch, something from the system, then silence . . . */ - -#ifdef __STDC__ -void -pfatal (char const *format, ...) -#else -/*VARARGS1*/ void -pfatal (format, va_alist) - char const *format; - va_dcl -#endif -{ - int errnum = errno; - va_list args; - fprintf (stderr, "%s: **** ", program_name); - vararg_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - fflush (stderr); /* perror bypasses stdio on some hosts. */ - errno = errnum; - perror (" "); - fflush (stderr); - fatal_exit (0); -} - -/* Tell the user something. */ - -#ifdef __STDC__ -void -say (char const *format, ...) -#else -/*VARARGS1*/ void -say (format, va_alist) - char const *format; - va_dcl -#endif -{ - va_list args; - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); -} - -/* Get a response from the user, somehow or other. */ - -#ifdef __STDC__ -void -ask (char const *format, ...) -#else -/*VARARGS1*/ void -ask (format, va_alist) - char const *format; - va_dcl -#endif -{ - static int ttyfd = -2; - int r; - va_list args; - - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); - - if (ttyfd == -2) - { - /* If standard output is not a tty, don't bother opening /dev/tty, - since it's unlikely that stdout will be seen by the tty user. - The isatty test also works around a bug in GNU Emacs 19.34 under Linux - which makes a call-process `patch' hang when it reads from /dev/tty. - POSIX.2 requires that we read /dev/tty, though. */ - ttyfd = (posixly_correct || isatty (STDOUT_FILENO) - ? open (TTY_DEVICE, O_RDONLY) - : -1); - } - - if (ttyfd < 0) - { - /* No terminal at all -- default it. */ - printf ("\n"); - buf[0] = '\n'; - buf[1] = '\0'; - } - else - { - size_t s = 0; - while ((r = read (ttyfd, buf + s, bufsize - 1 - s)) == bufsize - 1 - s - && buf[bufsize - 2] != '\n') - { - s = bufsize - 1; - bufsize *= 2; - buf = realloc (buf, bufsize); - if (!buf) - memory_fatal (); - } - if (r == 0) - printf ("EOF\n"); - else if (r < 0) - { - perror ("tty read"); - fflush (stderr); - close (ttyfd); - ttyfd = -1; - r = 0; - } - buf[s + r] = '\0'; - } -} - -/* Return nonzero if it OK to reverse a patch. */ - -#ifdef __STDC__ -int -ok_to_reverse (char const *format, ...) -#else -ok_to_reverse (format, va_alist) - char const *format; - va_dcl -#endif -{ - int r = 0; - - if (noreverse || ! (force && verbosity == SILENT)) - { - va_list args; - vararg_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - } - - if (noreverse) - { - printf (" Skipping patch.\n"); - skip_rest_of_patch = TRUE; - r = 0; - } - else if (force) - { - if (verbosity != SILENT) - printf (" Applying it anyway.\n"); - r = 0; - } - else if (batch) - { - say (reverse ? " Ignoring -R.\n" : " Assuming -R.\n"); - r = 1; - } - else - { - ask (reverse ? " Ignore -R? [n] " : " Assume -R? [n] "); - r = *buf == 'y'; - if (! r) - { - ask ("Apply anyway? [n] "); - if (*buf != 'y') - { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = TRUE; - } - } - } - - return r; -} - -/* How to handle certain events when not in a critical region. */ - -#define NUM_SIGS (sizeof (sigs) / sizeof (*sigs)) -static int const sigs[] = { -#ifdef SIGHUP - SIGHUP, -#endif -#ifdef SIGPIPE - SIGPIPE, -#endif -#ifdef SIGTERM - SIGTERM, -#endif -#ifdef SIGXCPU - SIGXCPU, -#endif -#ifdef SIGXFSZ - SIGXFSZ, -#endif - SIGINT -}; - -#if !HAVE_SIGPROCMASK -#define sigset_t int -#define sigemptyset(s) (*(s) = 0) -#ifndef sigmask -#define sigmask(sig) (1 << ((sig) - 1)) -#endif -#define sigaddset(s, sig) (*(s) |= sigmask (sig)) -#define sigismember(s, sig) ((*(s) & sigmask (sig)) != 0) -#ifndef SIG_BLOCK -#define SIG_BLOCK 0 -#endif -#ifndef SIG_UNBLOCK -#define SIG_UNBLOCK (SIG_BLOCK + 1) -#endif -#ifndef SIG_SETMASK -#define SIG_SETMASK (SIG_BLOCK + 2) -#endif -#define sigprocmask(how, n, o) \ - ((how) == SIG_BLOCK \ - ? ((o) ? *(o) = sigblock (*(n)) : sigblock (*(n))) \ - : (how) == SIG_UNBLOCK \ - ? sigsetmask (((o) ? *(o) = sigblock (0) : sigblock (0)) & ~*(n)) \ - : (o ? *(o) = sigsetmask (*(n)) : sigsetmask (*(n)))) -#if !HAVE_SIGSETMASK -#define sigblock(mask) 0 -#define sigsetmask(mask) 0 -#endif -#endif - -static sigset_t initial_signal_mask; -static sigset_t signals_to_block; - -#if ! HAVE_SIGACTION -static RETSIGTYPE fatal_exit_handler PARAMS ((int)) __attribute__ ((noreturn)); -static RETSIGTYPE -fatal_exit_handler (sig) - int sig; -{ - signal (sig, SIG_IGN); - fatal_exit (sig); -} -#endif - -void -set_signals(reset) -int reset; -{ - int i; -#if HAVE_SIGACTION - struct sigaction initial_act, fatal_act; - fatal_act.sa_handler = fatal_exit; - sigemptyset (&fatal_act.sa_mask); - fatal_act.sa_flags = 0; -#define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) -#else -#define setup_handler(sig) signal (sig, fatal_exit_handler) -#endif - - if (!reset) - { -#ifdef SIGCHLD - /* System V fork+wait does not work if SIGCHLD is ignored. */ - signal (SIGCHLD, SIG_DFL); -#endif - sigemptyset (&signals_to_block); - for (i = 0; i < NUM_SIGS; i++) - { - int ignoring_signal; -#if HAVE_SIGACTION - if (sigaction (sigs[i], (struct sigaction *) 0, &initial_act) != 0) - continue; - ignoring_signal = initial_act.sa_handler == SIG_IGN; -#else - ignoring_signal = signal (sigs[i], SIG_IGN) == SIG_IGN; -#endif - if (! ignoring_signal) - { - sigaddset (&signals_to_block, sigs[i]); - setup_handler (sigs[i]); - } - } - } - else - { - /* Undo the effect of ignore_signals. */ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_SETMASK, &initial_signal_mask, (sigset_t *) 0); -#else - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - setup_handler (sigs[i]); -#endif - } -} - -/* How to handle certain events when in a critical region. */ - -void -ignore_signals() -{ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); -#else - int i; - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - signal (sigs[i], SIG_IGN); -#endif -} - -void -exit_with_signal (sig) - int sig; -{ - sigset_t s; - signal (sig, SIG_DFL); - sigemptyset (&s); - sigaddset (&s, sig); - sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); - raise (sig); - exit (2); -} - -int -systemic (command) - char const *command; -{ - if (debug & 8) - say ("+ %s\n", command); - fflush (stdout); - return system (command); -} - -#if !HAVE_MKDIR -/* These mkdir and rmdir substitutes are good enough for `patch'; - they are not general emulators. */ - -static int doprogram PARAMS ((char const *, char const *)); -static int mkdir PARAMS ((char const *, mode_t)); -static int rmdir PARAMS ((char const *)); - -static int -doprogram (program, arg) - char const *program; - char const *arg; -{ - int result; - static char const DISCARD_OUTPUT[] = " 2>/dev/null"; - size_t program_len = strlen (program); - char *cmd = xmalloc (program_len + 1 + quote_system_arg (0, arg) - + sizeof DISCARD_OUTPUT); - char *p = cmd; - strcpy (p, program); - p += program_len; - *p++ = ' '; - p += quote_system_arg (p, arg); - strcpy (p, DISCARD_OUTPUT); - result = systemic (cmd); - free (cmd); - return result; -} - -#ifdef __STDC__ -/* If mode_t doesn't promote to itself, we can't use old-style definition. */ -static int -mkdir (char const *path, mode_t mode) -#else -static int -mkdir (path, mode) - char const *path; - mode_t mode; /* ignored */ -#endif -{ - return doprogram ("mkdir", path); -} - -static int -rmdir (path) - char const *path; -{ - int result = doprogram ("rmdir", path); - errno = EEXIST; - return result; -} -#endif - -/* Replace '/' with '\0' in FILENAME if it marks a place that - needs testing for the existence of directory. Return the address - of the last location replaced, or 0 if none were replaced. */ -static char *replace_slashes PARAMS ((char *)); -static char * -replace_slashes (filename) - char *filename; -{ - char *f; - char *last_location_replaced = 0; - char const *component_start; - - for (f = filename + FILESYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) - continue; - - component_start = f; - - for (; *f; f++) - if (ISSLASH (*f)) - { - char *slash = f; - - /* Treat multiple slashes as if they were one slash. */ - while (ISSLASH (f[1])) - f++; - - /* Ignore slashes at the end of the path. */ - if (! f[1]) - break; - - /* "." and ".." need not be tested. */ - if (! (slash - component_start <= 2 - && component_start[0] == '.' && slash[-1] == '.')) - { - *slash = '\0'; - last_location_replaced = slash; - } - - component_start = f + 1; - } - - return last_location_replaced; -} - -/* Make sure we'll have the directories to create a file. - Ignore the last element of `filename'. */ - -static void -makedirs (filename) - register char *filename; -{ - register char *f; - register char *flim = replace_slashes (filename); - - if (flim) - { - /* Create any missing directories, replacing NULs by '/'s. - Ignore errors. We may have to keep going even after an EEXIST, - since the path may contain ".."s; and when there is an EEXIST - failure the system may return some other error number. - Any problems will eventually be reported when we create the file. */ - for (f = filename; f <= flim; f++) - if (!*f) - { - mkdir (filename, - S_IRUSR|S_IWUSR|S_IXUSR - |S_IRGRP|S_IWGRP|S_IXGRP - |S_IROTH|S_IWOTH|S_IXOTH); - *f = '/'; - } - } -} - -/* Remove empty ancestor directories of FILENAME. - Ignore errors, since the path may contain ".."s, and when there - is an EEXIST failure the system may return some other error number. */ -void -removedirs (filename) - char *filename; -{ - size_t i; - - for (i = strlen (filename); i != 0; i--) - if (ISSLASH (filename[i]) - && ! (ISSLASH (filename[i - 1]) - || (filename[i - 1] == '.' - && (i == 1 - || ISSLASH (filename[i - 2]) - || (filename[i - 2] == '.' - && (i == 2 - || ISSLASH (filename[i - 3]))))))) - { - filename[i] = '\0'; - if (rmdir (filename) == 0 && verbosity == VERBOSE) - say ("Removed empty directory `%s'.\n", filename); - filename[i] = '/'; - } -} - -static time_t initial_time; - -void -init_time () -{ - time (&initial_time); -} - -/* Make filenames more reasonable. */ - -char * -fetchname (at, strip_leading, pstamp) -char *at; -int strip_leading; -time_t *pstamp; -{ - char *name; - register char *t; - int sleading = strip_leading; - time_t stamp = (time_t) -1; - - while (ISSPACE ((unsigned char) *at)) - at++; - if (debug & 128) - say ("fetchname %s %d\n", at, strip_leading); - - name = at; - /* Strip off up to `sleading' leading slashes and null terminate. */ - for (t = at; *t; t++) - { - if (ISSLASH (*t)) - { - while (ISSLASH (t[1])) - t++; - if (--sleading >= 0) - name = t+1; - } - else if (ISSPACE ((unsigned char) *t)) - { - if (set_time | set_utc) - stamp = str2time (t, initial_time, set_utc ? 0L : TM_LOCAL_ZONE); - else - { - /* The head says the file is nonexistent if the timestamp - is the epoch; but the listed time is local time, not UTC, - and POSIX.1 allows local time to be 24 hours away from UTC. - So match any time within 24 hours of the epoch. - Use a default time zone 24 hours behind UTC so that any - non-zoned time within 24 hours of the epoch is valid. */ - stamp = str2time (t, initial_time, -24L * 60 * 60); - if (0 <= stamp && stamp <= 2 * 24L * 60 * 60) - stamp = 0; - } - - *t = '\0'; - break; - } - } - - if (!*name) - return 0; - - /* Allow files to be created by diffing against /dev/null. */ - if (strcmp (at, "/dev/null") == 0) - { - if (pstamp) - *pstamp = 0; - return 0; - } - - if (pstamp) - *pstamp = stamp; - - return savestr (name); -} - -GENERIC_OBJECT * -xmalloc (size) - size_t size; -{ - register GENERIC_OBJECT *p = malloc (size); - if (!p) - memory_fatal (); - return p; -} - -void -Fseek (stream, offset, ptrname) - FILE *stream; - file_offset offset; - int ptrname; -{ - if (file_seek (stream, offset, ptrname) != 0) - pfatal ("fseek"); -} Property changes on: vendor/misc-GNU/patch/2.5/util.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/argmatch.h =================================================================== --- vendor/misc-GNU/patch/2.5/argmatch.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/argmatch.h (nonexistent) @@ -1,12 +0,0 @@ -/* argmatch.h -- declarations for matching arguments against option lists */ - -#if defined __STDC__ || __GNUC__ -# define __ARGMATCH_P(args) args -#else -# define __ARGMATCH_P(args) () -#endif - -int argmatch __ARGMATCH_P ((const char *, const char * const *)); -void invalid_arg __ARGMATCH_P ((const char *, const char *, int)); - -extern char const program_name[]; Property changes on: vendor/misc-GNU/patch/2.5/argmatch.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/backupfile.c =================================================================== --- vendor/misc-GNU/patch/2.5/backupfile.c (revision 358868) +++ vendor/misc-GNU/patch/2.5/backupfile.c (nonexistent) @@ -1,252 +0,0 @@ -/* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990,1991,1992,1993,1995,1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . - Some algorithms adapted from GNU Emacs. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_DIRENT_H -# include -# define NLENGTH(direct) strlen ((direct)->d_name) -#else -# define dirent direct -# define NLENGTH(direct) ((size_t) (direct)->d_namlen) -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - -#if CLOSEDIR_VOID -/* Fake a return value. */ -# define CLOSEDIR(d) (closedir (d), 0) -#else -# define CLOSEDIR(d) closedir (d) -#endif - -#if STDC_HEADERS -# include -#else -char *malloc (); -#endif - -#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H -# define HAVE_DIR 1 -#else -# define HAVE_DIR 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif -/* Upper bound on the string length of an integer converted to string. - 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; - add 1 for integer division truncation; add 1 more for a minus sign. */ -#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2) - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - - It's typically faster. - Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that - only '0' through '9' are digits. Prefer ISDIGIT to isdigit unless - it's important to use the locale's definition of `digit' even when the - host does not conform to Posix. */ -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#if D_INO_IN_DIRENT -# define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) -#else -# define REAL_DIR_ENTRY(dp) 1 -#endif - -/* Which type of backup file names are generated. */ -enum backup_type backup_type = none; - -/* The extension added to file names to produce a simple (as opposed - to numbered) backup file name. */ -const char *simple_backup_suffix = ".orig"; - -static int max_backup_version __BACKUPFILE_P ((const char *, const char *)); -static int version_number __BACKUPFILE_P ((const char *, const char *, size_t)); - -/* Return the name of the new backup file for file FILE, - allocated with malloc. Return 0 if out of memory. - FILE must not end with a '/' unless it is the root directory. - Do not call this function if backup_type == none. */ - -char * -find_backup_file_name (file) - const char *file; -{ - size_t backup_suffix_size_max; - size_t file_len = strlen (file); - size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4; - char *s; - const char *suffix = simple_backup_suffix; - - /* Allow room for simple or `.~N~' backups. */ - backup_suffix_size_max = strlen (simple_backup_suffix) + 1; - if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max) - backup_suffix_size_max = numbered_suffix_size_max; - - s = malloc (file_len + backup_suffix_size_max + numbered_suffix_size_max); - if (s) - { - strcpy (s, file); - -#if HAVE_DIR - if (backup_type != simple) - { - int highest_backup; - size_t dir_len = base_name (s) - s; - - strcpy (s + dir_len, "."); - highest_backup = max_backup_version (file + dir_len, s); - if (! (backup_type == numbered_existing && highest_backup == 0)) - { - char *numbered_suffix = s + (file_len + backup_suffix_size_max); - sprintf (numbered_suffix, ".~%d~", highest_backup + 1); - suffix = numbered_suffix; - } - strcpy (s, file); - } -#endif /* HAVE_DIR */ - - addext (s, suffix, '~'); - } - return s; -} - -#if HAVE_DIR - -/* Return the number of the highest-numbered backup file for file - FILE in directory DIR. If there are no numbered backups - of FILE in DIR, or an error occurs reading DIR, return 0. - */ - -static int -max_backup_version (file, dir) - const char *file; - const char *dir; -{ - DIR *dirp; - struct dirent *dp; - int highest_version; - int this_version; - size_t file_name_length; - - dirp = opendir (dir); - if (!dirp) - return 0; - - highest_version = 0; - file_name_length = strlen (file); - - while ((dp = readdir (dirp)) != 0) - { - if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) < file_name_length + 4) - continue; - - this_version = version_number (file, dp->d_name, file_name_length); - if (this_version > highest_version) - highest_version = this_version; - } - if (CLOSEDIR (dirp)) - return 0; - return highest_version; -} - -/* If BACKUP is a numbered backup of BASE, return its version number; - otherwise return 0. BASE_LENGTH is the length of BASE. - */ - -static int -version_number (base, backup, base_length) - const char *base; - const char *backup; - size_t base_length; -{ - int version; - const char *p; - - version = 0; - if (strncmp (base, backup, base_length) == 0 - && backup[base_length] == '.' - && backup[base_length + 1] == '~') - { - for (p = &backup[base_length + 2]; ISDIGIT (*p); ++p) - version = version * 10 + *p - '0'; - if (p[0] != '~' || p[1]) - version = 0; - } - return version; -} -#endif /* HAVE_DIR */ - -static const char * const backup_args[] = -{ - "never", "simple", "nil", "existing", "t", "numbered", 0 -}; - -static const enum backup_type backup_types[] = -{ - simple, simple, numbered_existing, numbered_existing, numbered, numbered -}; - -/* Return the type of backup indicated by VERSION. - Unique abbreviations are accepted. */ - -enum backup_type -get_version (version) - const char *version; -{ - int i; - - if (version == 0 || *version == 0) - return numbered_existing; - i = argmatch (version, backup_args); - if (i < 0) - { - invalid_arg ("version control type", version, i); - exit (2); - } - return backup_types[i]; -} Property changes on: vendor/misc-GNU/patch/2.5/backupfile.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/backupfile.h =================================================================== --- vendor/misc-GNU/patch/2.5/backupfile.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/backupfile.h (nonexistent) @@ -1,50 +0,0 @@ -/* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990, 1991, 1992, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -extern enum backup_type backup_type; -extern char const *simple_backup_suffix; - -#ifndef __BACKUPFILE_P -# if defined __STDC__ || __GNUC__ -# define __BACKUPFILE_P(args) args -# else -# define __BACKUPFILE_P(args) () -# endif -#endif - -char *base_name __BACKUPFILE_P ((char const *)); -char *find_backup_file_name __BACKUPFILE_P ((char const *)); -enum backup_type get_version __BACKUPFILE_P ((char const *)); -void addext __BACKUPFILE_P ((char *, char const *, int)); Property changes on: vendor/misc-GNU/patch/2.5/backupfile.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5/util.h =================================================================== --- vendor/misc-GNU/patch/2.5/util.h (revision 358868) +++ vendor/misc-GNU/patch/2.5/util.h (nonexistent) @@ -1,32 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.h,v 1.15 1997/07/16 12:26:36 eggert Exp $ */ - -int ok_to_reverse PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); -void ask PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); -void say PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); - -void fatal PARAMS ((char const *, ...)) - __attribute__ ((noreturn, format (printf, 1, 2))); -void pfatal PARAMS ((char const *, ...)) - __attribute__ ((noreturn, format (printf, 1, 2))); - -char *fetchname PARAMS ((char *, int, time_t *)); -char *savebuf PARAMS ((char const *, size_t)); -char *savestr PARAMS ((char const *)); -char const *version_controller PARAMS ((char const *, int, struct stat const *, char **, char **)); -int version_get PARAMS ((char const *, char const *, int, int, char const *, struct stat *)); -int create_file PARAMS ((char const *, int, mode_t)); -int systemic PARAMS ((char const *)); -void Fseek PARAMS ((FILE *, file_offset, int)); -void copy_file PARAMS ((char const *, char const *, mode_t)); -void exit_with_signal PARAMS ((int)) __attribute__ ((noreturn)); -void ignore_signals PARAMS ((void)); -void init_time PARAMS ((void)); -void memory_fatal PARAMS ((void)) __attribute__ ((noreturn)); -void move_file PARAMS ((char const *, char *, mode_t, int)); -void read_fatal PARAMS ((void)) __attribute__ ((noreturn)); -void remove_prefix PARAMS ((char *, size_t)); -void removedirs PARAMS ((char *)); -void set_signals PARAMS ((int)); -void write_fatal PARAMS ((void)) __attribute__ ((noreturn)); Property changes on: vendor/misc-GNU/patch/2.5/util.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/m4/realloc.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/realloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/realloc.m4 (nonexistent) @@ -1,25 +0,0 @@ -# realloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether realloc works when both arguments are 0. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_REALLOC], -[ - AC_REQUIRE([AC_FUNC_REALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - gl_PREREQ_REALLOC - fi -]) - -# Prerequisites of lib/realloc.c. -AC_DEFUN([gl_PREREQ_REALLOC], [ - : -]) Index: vendor/misc-GNU/patch/2.5.9/m4/mbstate_t.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/mbstate_t.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/mbstate_t.m4 (nonexistent) @@ -1,32 +0,0 @@ -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# From Paul Eggert. - -# BeOS 5 has but does not define mbstate_t, -# so you can't declare an object of that type. -# Check for this incompatibility with Standard C. - -# AC_TYPE_MBSTATE_T -# ----------------- -AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include ], - [mbstate_t x; return sizeof x;])], - [ac_cv_type_mbstate_t=yes], - [ac_cv_type_mbstate_t=no])]) - if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T], 1, - [Define to 1 if declares mbstate_t.]) - else - AC_DEFINE([mbstate_t], int, - [Define to a type if does not define.]) - fi]) Index: vendor/misc-GNU/patch/2.5.9/m4/quote.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/quote.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/quote.m4 (nonexistent) @@ -1,13 +0,0 @@ -# quote.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTE], -[ - dnl Prerequisites of lib/quote.c. - AC_CHECK_HEADERS_ONCE(stddef.h) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/unlocked-io.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/unlocked-io.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/unlocked-io.m4 (nonexistent) @@ -1,22 +0,0 @@ -#serial 7 -*- autoconf -*- - -dnl From Jim Meyering. -dnl -dnl See if the glibc *_unlocked I/O macros or functions are available. -dnl Use only those *_unlocked macros or functions that are declared -dnl (because some of them were declared in Solaris 2.5.1 but were removed -dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run -dnl on Solaris 2.6). - -AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], -[ - dnl Persuade glibc to declare fgets_unlocked(), fputs_unlocked() - dnl etc. - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS_ONCE( - [clearerr_unlocked feof_unlocked ferror_unlocked - fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked - fread_unlocked fwrite_unlocked getc_unlocked - getchar_unlocked putc_unlocked putchar_unlocked]) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/error.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/error.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/error.m4 (nonexistent) @@ -1,18 +0,0 @@ -#serial 7 - -AC_DEFUN([gl_ERROR], -[ - AC_FUNC_ERROR_AT_LINE - dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). - jm_PREREQ_ERROR -]) - -# Prerequisites of lib/error.c. -AC_DEFUN([jm_PREREQ_ERROR], -[ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_VPRINTF]) - AC_CHECK_FUNCS(strerror) - AC_CHECK_DECLS([strerror]) - AC_FUNC_STRERROR_R -]) Index: vendor/misc-GNU/patch/2.5.9/m4/mbrtowc.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/mbrtowc.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/mbrtowc.m4 (nonexistent) @@ -1,27 +0,0 @@ -# mbrtowc.m4 serial 5 -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert - -dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with -dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. - -AC_DEFUN([jm_FUNC_MBRTOWC], -[ - AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], - jm_cv_func_mbrtowc, - [AC_TRY_LINK( - [#include ], - [mbstate_t state; return ! (sizeof state && mbrtowc);], - jm_cv_func_mbrtowc=yes, - jm_cv_func_mbrtowc=no)]) - if test $jm_cv_func_mbrtowc = yes; then - AC_DEFINE(HAVE_MBRTOWC, 1, - [Define to 1 if mbrtowc and mbstate_t are properly declared.]) - fi -]) Index: vendor/misc-GNU/patch/2.5.9/m4/mkdir.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/mkdir.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/mkdir.m4 (nonexistent) @@ -1,34 +0,0 @@ -#serial 1 - -dnl From Mumit Khan and Paul Eggert -dnl Determine whether mkdir accepts only one argument instead of the usual two. - -AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG], - [AC_CHECK_FUNCS(mkdir) - AC_CACHE_CHECK([whether mkdir takes only one argument], - patch_cv_mkdir_takes_one_arg, - [patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".", 0);], - , - [AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".");], - patch_cv_mkdir_takes_one_arg=yes - )] - ) - fi - ] - ) - if test $patch_cv_mkdir_takes_one_arg = yes; then - AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, - [Define if mkdir takes only one argument.]) - fi - ] -) Index: vendor/misc-GNU/patch/2.5.9/m4/xalloc.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/xalloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/xalloc.m4 (nonexistent) @@ -1,26 +0,0 @@ -# xalloc.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_XALLOC], -[ - gl_PREREQ_XMALLOC - gl_PREREQ_XSTRDUP -]) - -# Prerequisites of lib/xmalloc.c. -AC_DEFUN([gl_PREREQ_XMALLOC], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([jm_FUNC_MALLOC]) - AC_REQUIRE([jm_FUNC_REALLOC]) -]) - -# Prerequisites of lib/xstrdup.c. -AC_DEFUN([gl_PREREQ_XSTRDUP], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/stdbool.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/stdbool.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/stdbool.m4 (nonexistent) @@ -1,89 +0,0 @@ -# Check for stdbool.h that conforms to C99. - -# Copyright (C) 2002-2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Prepare for substituting if it is not supported. - -AC_DEFUN([AM_STDBOOL_H], -[ - AC_REQUIRE([AC_HEADER_STDBOOL]) - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - AC_SUBST([STDBOOL_H]) - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - AC_SUBST([HAVE__BOOL]) -]) - -# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf -# have this macro built-in. - -AC_DEFUN([AC_HEADER_STDBOOL], - [AC_CACHE_CHECK([for stdbool.h that conforms to C99], - [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - ], - [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], - [ac_cv_header_stdbool_h=yes], - [ac_cv_header_stdbool_h=no])]) - AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) - fi]) Index: vendor/misc-GNU/patch/2.5.9/m4/rmdir.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/rmdir.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/rmdir.m4 (nonexistent) @@ -1,22 +0,0 @@ -# rmdir.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_RMDIR], -[ - AC_REPLACE_FUNCS(rmdir) - if test $ac_cv_func_rmdir = no; then - gl_PREREQ_RMDIR - fi -]) - -# Prerequisites of lib/rmdir.c. -AC_DEFUN([gl_PREREQ_RMDIR], [ - AC_REQUIRE([AC_HEADER_STAT]) - : -]) - Index: vendor/misc-GNU/patch/2.5.9/m4/setmode.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/setmode.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/setmode.m4 (nonexistent) @@ -1,38 +0,0 @@ -# Check for setmode, DOS style. - -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AC_FUNC_SETMODE_DOS], - [AC_CHECK_HEADERS(fcntl.h unistd.h) - AC_CACHE_CHECK([for DOS-style setmode], - [ac_cv_func_setmode_dos], - [AC_TRY_LINK( - [#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif], - [int ret = setmode && setmode (1, O_BINARY);], - [ac_cv_func_setmode_dos=yes], - [ac_cv_func_setmode_dos=no])]) - if test $ac_cv_func_setmode_dos = yes; then - AC_DEFINE(HAVE_SETMODE_DOS, 1, - [Define to 1 if you have the DOS-style `setmode' function.]) - fi]) Index: vendor/misc-GNU/patch/2.5.9/m4/dirname.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/dirname.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/dirname.m4 (nonexistent) @@ -1,25 +0,0 @@ -# dirname.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_DIRNAME], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([jm_AC_DOS]) - - dnl Prerequisites of lib/dirname.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/basename.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/stripslash.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/backupfile.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/backupfile.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/backupfile.m4 (nonexistent) @@ -1,23 +0,0 @@ -# backupfile.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_BACKUPFILE], -[ - dnl Prerequisites of lib/backupfile.c. - AC_REQUIRE([AC_HEADER_DIRENT]) - AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h) - AC_CHECK_DECLS_ONCE(getenv malloc) - jm_CHECK_TYPE_STRUCT_DIRENT_D_INO - - dnl Prerequisites of lib/addext.c. - AC_REQUIRE([jm_AC_DOS]) - AC_SYS_LONG_FILE_NAMES - AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h) - AC_CHECK_FUNCS(pathconf) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/onceonly.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/onceonly.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/onceonly.m4 (nonexistent) @@ -1,63 +0,0 @@ -# onceonly.m4 serial 3 -dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl This file defines some "once only" variants of standard autoconf macros. -dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS -dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS -dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS -dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC -dnl The advantage is that the check for each of the headers/functions/decls -dnl will be put only once into the 'configure' file. It keeps the size of -dnl the 'configure' file down, and avoids redundant output when 'configure' -dnl is run. -dnl The drawback is that the checks cannot be conditionalized. If you write -dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi -dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to -dnl empty, and the check will be inserted before the body of the AC_DEFUNed -dnl function. - -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) - -# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of -# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). -AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ - : - AC_FOREACH([gl_HEADER_NAME], [$1], [ - AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), - [-./], [___])), [ - AC_CHECK_HEADERS(gl_HEADER_NAME) - ]) - AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, - [-./], [___]))) - ]) -]) - -# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of -# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). -AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ - : - AC_FOREACH([gl_FUNC_NAME], [$1], [ - AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ - AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) - ]) - AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) - ]) -]) - -# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of -# AC_CHECK_DECLS(DECL1, DECL2, ...). -AC_DEFUN([AC_CHECK_DECLS_ONCE], [ - : - AC_FOREACH([gl_DECL_NAME], [$1], [ - AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ - AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) - ]) - AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) - ]) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/quotearg.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/quotearg.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/quotearg.m4 (nonexistent) @@ -1,16 +0,0 @@ -# quotearg.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTEARG], -[ - dnl Prerequisites of lib/quotearg.c. - AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) - AC_CHECK_FUNCS_ONCE(iswprint mbsinit) - AC_TYPE_MBSTATE_T - jm_FUNC_MBRTOWC -]) Index: vendor/misc-GNU/patch/2.5.9/m4/memchr.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/memchr.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/memchr.m4 (nonexistent) @@ -1,21 +0,0 @@ -# memchr.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_MEMCHR], -[ - AC_REPLACE_FUNCS(memchr) - if test $ac_cv_func_memchr = no; then - jm_PREREQ_MEMCHR - fi -]) - -# Prerequisites of lib/memchr.c. -AC_DEFUN([jm_PREREQ_MEMCHR], [ - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) - AC_CHECK_HEADERS(bp-sym.h) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/getopt.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/getopt.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/getopt.m4 (nonexistent) @@ -1,13 +0,0 @@ -# getopt.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_GETOPT], -[ - dnl Prerequisites of lib/getopt.c. - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/2.5.9/m4/malloc.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/malloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/malloc.m4 (nonexistent) @@ -1,25 +0,0 @@ -# malloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether malloc accepts 0 as its argument. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_MALLOC], -[ - AC_REQUIRE([AC_FUNC_MALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - gl_PREREQ_MALLOC - fi -]) - -# Prerequisites of lib/malloc.c. -AC_DEFUN([gl_PREREQ_MALLOC], [ - : -]) Index: vendor/misc-GNU/patch/2.5.9/m4/d-ino.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/d-ino.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/d-ino.m4 (nonexistent) @@ -1,42 +0,0 @@ -#serial 5 - -dnl From Jim Meyering. -dnl -dnl Check whether struct dirent has a member named d_ino. -dnl - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO], - [AC_REQUIRE([AC_HEADER_DIRENT])dnl - AC_CACHE_CHECK([for d_ino member in directory struct], - jm_cv_struct_dirent_d_ino, - [AC_TRY_LINK(dnl - [ -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - ], - [struct dirent dp; dp.d_ino = 0;], - - jm_cv_struct_dirent_d_ino=yes, - jm_cv_struct_dirent_d_ino=no) - ] - ) - if test $jm_cv_struct_dirent_d_ino = yes; then - AC_DEFINE(D_INO_IN_DIRENT, 1, - [Define if there is a member named d_ino in the struct describing - directory headers.]) - fi - ] -) Index: vendor/misc-GNU/patch/2.5.9/m4/dos.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/dos.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/dos.m4 (nonexistent) @@ -1,53 +0,0 @@ -#serial 5 - -# Define some macros required for proper operation of code in lib/*.c -# on MSDOS/Windows systems. - -# From Jim Meyering. - -AC_DEFUN([jm_AC_DOS], - [ - AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], - [ - AC_TRY_COMPILE([], - [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif], - [ac_cv_win_or_dos=yes], - [ac_cv_win_or_dos=no]) - ]) - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - AH_VERBATIM(FILESYSTEM_PREFIX_LEN, - [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], - $ac_fs_accepts_drive_letter_prefix, - [Define on systems for which file names may have a so-called - `drive letter' prefix, define this to compute the length of that - prefix, including the colon.]) - - AH_VERBATIM(ISSLASH, - [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], - $ac_fs_backslash_is_file_name_separator, - [Define if the backslash character may also serve as a file name - component separator.]) - ]) Index: vendor/misc-GNU/patch/2.5.9/m4/utimbuf.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/m4/utimbuf.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/m4/utimbuf.m4 (nonexistent) @@ -1,40 +0,0 @@ -#serial 5 - -dnl From Jim Meyering - -dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- -dnl usually in . -dnl Some systems have utime.h but don't declare the struct anywhere. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], -[ - AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) - AC_REQUIRE([AC_HEADER_TIME]) - AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf, - [AC_TRY_COMPILE( - [ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - ], - [static struct utimbuf x; x.actime = x.modtime;], - fu_cv_sys_struct_utimbuf=yes, - fu_cv_sys_struct_utimbuf=no) - ]) - - if test $fu_cv_sys_struct_utimbuf = yes; then - AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, - [Define if struct utimbuf is declared -- usually in . - Some systems have utime.h but don't declare the struct anywhere. ]) - fi -]) Index: vendor/misc-GNU/patch/2.5.9/configure =================================================================== --- vendor/misc-GNU/patch/2.5.9/configure (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/configure (nonexistent) @@ -1,11893 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for patch 2.5.9. -# -# Report bugs to . -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='patch' -PACKAGE_TARNAME='patch' -PACKAGE_VERSION='2.5.9' -PACKAGE_STRING='patch 2.5.9' -PACKAGE_BUGREPORT='bug-patch@gnu.org' - -ac_unique_file="patch.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE ed_PROGRAM EGREP STDBOOL_H HAVE__BOOL LIBOBJS LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures patch 2.5.9 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of patch 2.5.9:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-largefile omit support for large files - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -patch configure 2.5.9 -generated by GNU Autoconf 2.57 - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by patch $as_me 2.5.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ac_config_headers="$ac_config_headers config.h:config.hin" - -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -# Extract the first word of "ed", so it can be a program name with args. -set dummy ed; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ed_PROGRAM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ed_PROGRAM in - [\\/]* | ?:[\\/]*) - ac_cv_path_ed_PROGRAM="$ed_PROGRAM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ed_PROGRAM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_ed_PROGRAM" && ac_cv_path_ed_PROGRAM="ed" - ;; -esac -fi -ed_PROGRAM=$ac_cv_path_ed_PROGRAM - -if test -n "$ed_PROGRAM"; then - echo "$as_me:$LINENO: result: $ed_PROGRAM" >&5 -echo "${ECHO_T}$ed_PROGRAM" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - - -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - - -echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -rm -f conftest* - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 - -fi -if test $ac_cv_header_minix_config_h = yes; then - MINIX=yes -else - MINIX= -fi - - -if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - -fi - - -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" - -fi - -# Check whether --enable-largefile or --disable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" - -fi; -if test "$enable_largefile" != no; then - - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_file_offset_bits=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF - -fi -rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_large_files=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF - -fi -rm -f conftest* -fi - - - -echo "$as_me:$LINENO: checking for function prototypes" >&5 -echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 -if test "$ac_cv_prog_cc_stdc" != no; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -cat >>confdefs.h <<\_ACEOF -#define PROTOTYPES 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define __PROTOTYPES 1 -_ACEOF - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -fi - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - - - - - -for ac_header in fcntl.h limits.h string.h unistd.h utime.h varargs.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 -if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((mode_t *) 0) - return 0; -if (sizeof (mode_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_mode_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_mode_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6 -if test $ac_cv_type_mode_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_pid_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_signal=void -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_signal=int -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_size_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 -if test "${ac_cv_header_stdbool_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - -int -main () -{ - return !a + !b + !c + !d + !e + !f + !g + !h + !i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdbool_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdbool_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 - echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((_Bool *) 0) - return 0; -if (sizeof (_Bool)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type__Bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type__Bool=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6 -if test $ac_cv_type__Bool = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - - if test $ac_cv_header_stdbool_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STDBOOL_H 1 -_ACEOF - - fi - - - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - - - - -for ac_header in sys/time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in utime.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_time=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - - - - : - - - - - - - - - - echo "$as_me:$LINENO: checking for struct utimbuf" >&5 -echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6 -if test "${fu_cv_sys_struct_utimbuf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - -int -main () -{ -static struct utimbuf x; x.actime = x.modtime; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - fu_cv_sys_struct_utimbuf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fu_cv_sys_struct_utimbuf=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $fu_cv_sys_struct_utimbuf" >&5 -echo "${ECHO_T}$fu_cv_sys_struct_utimbuf" >&6 - - if test $fu_cv_sys_struct_utimbuf = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_UTIMBUF 1 -_ACEOF - - fi - - -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -exit (closedir (opendir (".")) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - - - -for ac_header in limits.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in string.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getenv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getenv - char *p = (char *) getenv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getenv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getenv=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 -if test $ac_cv_have_decl_getenv = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef malloc - char *p = (char *) malloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_malloc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_malloc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 -if test $ac_cv_have_decl_malloc = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 -echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 -if test "${ac_cv_win_or_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_win_or_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_win_or_dos=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 -echo "${ECHO_T}$ac_cv_win_or_dos" >&6 - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix -_ACEOF - - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator -_ACEOF - - - - -for ac_header in unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - : - - - - - - - - - - - - - : - - - - - - - - - echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 -echo $ECHO_N "checking for d_ino member in directory struct... $ECHO_C" >&6 -if test "${jm_cv_struct_dirent_d_ino+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - -int -main () -{ -struct dirent dp; dp.d_ino = 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_struct_dirent_d_ino=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -jm_cv_struct_dirent_d_ino=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - - -fi -echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_ino" >&5 -echo "${ECHO_T}$jm_cv_struct_dirent_d_ino" >&6 - if test $jm_cv_struct_dirent_d_ino = yes; then - -cat >>confdefs.h <<\_ACEOF -#define D_INO_IN_DIRENT 1 -_ACEOF - - fi - - - - - echo "$as_me:$LINENO: checking for long file names" >&5 -echo $ECHO_N "checking for long file names... $ECHO_C" >&6 -if test "${ac_cv_sys_long_file_names+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_long_file_names=yes -# Test for long file names in all the places we know might matter: -# . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: -# /tmp where it might want to write temporary files -# /var/tmp likewise -# /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs=$TMPDIR -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do - test -d $ac_dir || continue - test -w $ac_dir || continue # It is less confusing to not echo anything here. - ac_xdir=$ac_dir/cf$$ - (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue - ac_tf1=$ac_xdir/conftest9012345 - ac_tf2=$ac_xdir/conftest9012346 - (echo 1 >$ac_tf1) 2>/dev/null - (echo 2 >$ac_tf2) 2>/dev/null - ac_val=`cat $ac_tf1 2>/dev/null` - if test ! -f $ac_tf1 || test "$ac_val" != 1; then - ac_cv_sys_long_file_names=no - rm -rf $ac_xdir 2>/dev/null - break - fi - rm -rf $ac_xdir 2>/dev/null -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 -echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 -if test $ac_cv_sys_long_file_names = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_FILE_NAMES 1 -_ACEOF - -fi - - - : - - - - - - - - - - - - -for ac_func in pathconf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - - : - - - - - - - - - : - - - - - - - - - : - - - - - - - -for ac_func in vprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -echo "$as_me:$LINENO: checking for _doprnt" >&5 -echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 -if test "${ac_cv_func__doprnt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -char (*f) () = _doprnt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != _doprnt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__doprnt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func__doprnt=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 -echo "${ECHO_T}$ac_cv_func__doprnt" >&6 -if test $ac_cv_func__doprnt = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOPRNT 1 -_ACEOF - -fi - -fi -done - - - - echo "$as_me:$LINENO: checking for error_at_line" >&5 -echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6 -if test "${ac_cv_lib_error_at_line+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -error_at_line (0, 0, "", 0, ""); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_error_at_line=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_error_at_line=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 -echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6 -if test $ac_cv_lib_error_at_line = no; then - LIBOBJS="$LIBOBJS error.$ac_objext" -fi - - - - - -for ac_func in strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking whether strerror is declared" >&5 -echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror - char *p = (char *) strerror; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_strerror=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_strerror=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6 -if test $ac_cv_have_decl_strerror = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 0 -_ACEOF - - -fi - - - echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 -echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_strerror_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror_r - char *p = (char *) strerror_r; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_strerror_r=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_strerror_r=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 -if test $ac_cv_have_decl_strerror_r = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 0 -_ACEOF - - -fi - - - -for ac_func in strerror_r -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 -echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 -if test "${ac_cv_func_strerror_r_char_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - exit (!isalpha (x)); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - fi - -fi -echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 -echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 -if test $ac_cv_func_strerror_r_char_p = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_CHAR_P 1 -_ACEOF - -fi - - - - - -for ac_func in memchr -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - - if test $ac_cv_func_memchr = no; then - - - : - - - - - - - - - -for ac_header in bp-sym.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - fi - -echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 -if test "${ac_cv_header_stat_broken+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -#if defined(S_ISBLK) && defined(S_IFDIR) -# if S_ISBLK (S_IFDIR) -You lose. -# endif -#endif - -#if defined(S_ISBLK) && defined(S_IFCHR) -# if S_ISBLK (S_IFCHR) -You lose. -# endif -#endif - -#if defined(S_ISLNK) && defined(S_IFREG) -# if S_ISLNK (S_IFREG) -You lose. -# endif -#endif - -#if defined(S_ISSOCK) && defined(S_IFREG) -# if S_ISSOCK (S_IFREG) -You lose. -# endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "You lose" >/dev/null 2>&1; then - ac_cv_header_stat_broken=yes -else - ac_cv_header_stat_broken=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 -if test $ac_cv_header_stat_broken = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STAT_MACROS_BROKEN 1 -_ACEOF - -fi - - - -for ac_func in rmdir -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - - if test $ac_cv_func_rmdir = no; then - - - : - - fi - - - - : - - - - - - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -exit (malloc (0) ? 0 : 1); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF - - LIBOBJS="$LIBOBJS malloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF - -fi - - - - - - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - - : - - fi - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 -echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_realloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -exit (realloc (0, 0) ? 0 : 1); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_realloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_realloc_0_nonnull=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 -if test $ac_cv_func_realloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 0 -_ACEOF - - LIBOBJS="$LIBOBJS realloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -#define realloc rpl_realloc -_ACEOF - -fi - - - - - - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - - : - - fi - - - - - - - - -for ac_header in stddef.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - : - - - - - - - - -for ac_header in wchar.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in wctype.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_func in iswprint -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_func in mbsinit -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - : - - - - - - - - - - : - - - - - - - - - echo "$as_me:$LINENO: checking for mbstate_t" >&5 -echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6 -if test "${ac_cv_type_mbstate_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -# include -int -main () -{ -mbstate_t x; return sizeof x; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_mbstate_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_mbstate_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6 - if test $ac_cv_type_mbstate_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF - - else - -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF - - fi - - echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6 -if test "${jm_cv_func_mbrtowc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -mbstate_t state; return ! (sizeof state && mbrtowc); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_func_mbrtowc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -jm_cv_func_mbrtowc=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5 -echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6 - if test $jm_cv_func_mbrtowc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF - - fi - - - - - - - -for ac_func in pathconf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_header in limits.h string.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -echo "$as_me:$LINENO: checking whether free is declared" >&5 -echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_free+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef free - char *p = (char *) free; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_free=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_free=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 -echo "${ECHO_T}$ac_cv_have_decl_free" >&6 -if test $ac_cv_have_decl_free = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getenv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getenv - char *p = (char *) getenv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getenv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getenv=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 -if test $ac_cv_have_decl_getenv = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef malloc - char *p = (char *) malloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_malloc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_malloc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 -if test $ac_cv_have_decl_malloc = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether mktemp is declared" >&5 -echo $ECHO_N "checking whether mktemp is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_mktemp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef mktemp - char *p = (char *) mktemp; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_mktemp=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_mktemp=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_mktemp" >&5 -echo "${ECHO_T}$ac_cv_have_decl_mktemp" >&6 -if test $ac_cv_have_decl_mktemp = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKTEMP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKTEMP 0 -_ACEOF - - -fi - - - - - - - - - - - - - - -for ac_func in _doprintf geteuid getuid isascii memcmp mktemp \ - pathconf raise sigaction sigprocmask sigsetmask strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -for ac_func in mkdir strncasecmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - -echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_largefile_source=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return !fseeko; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include -int -main () -{ -return !fseeko; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_largefile_source=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 -if test "$ac_cv_sys_largefile_source" != no; then - -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF - -fi -rm -f conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -echo "$as_me:$LINENO: checking for fseeko" >&5 -echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 -if test "${ac_cv_func_fseeko+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return fseeko && fseeko (stdin, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_fseeko=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_fseeko=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5 -echo "${ECHO_T}$ac_cv_func_fseeko" >&6 -if test $ac_cv_func_fseeko = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF - -fi - - - echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef clearerr_unlocked - char *p = (char *) clearerr_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_clearerr_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_clearerr_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 -if test $ac_cv_have_decl_clearerr_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef feof_unlocked - char *p = (char *) feof_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_feof_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_feof_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 -if test $ac_cv_have_decl_feof_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef ferror_unlocked - char *p = (char *) ferror_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_ferror_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_ferror_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 -if test $ac_cv_have_decl_ferror_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fflush_unlocked - char *p = (char *) fflush_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fflush_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fflush_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 -if test $ac_cv_have_decl_fflush_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fgets_unlocked - char *p = (char *) fgets_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fgets_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fgets_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 -if test $ac_cv_have_decl_fgets_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputc_unlocked - char *p = (char *) fputc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fputc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fputc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 -if test $ac_cv_have_decl_fputc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputs_unlocked - char *p = (char *) fputs_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fputs_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fputs_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 -if test $ac_cv_have_decl_fputs_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fread_unlocked - char *p = (char *) fread_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fread_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fread_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 -if test $ac_cv_have_decl_fread_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fwrite_unlocked - char *p = (char *) fwrite_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fwrite_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fwrite_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 -if test $ac_cv_have_decl_fwrite_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getc_unlocked - char *p = (char *) getc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 -if test $ac_cv_have_decl_getc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getchar_unlocked - char *p = (char *) getchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getchar_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getchar_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 -if test $ac_cv_have_decl_getchar_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putc_unlocked - char *p = (char *) putc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_putc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_putc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 -if test $ac_cv_have_decl_putc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putchar_unlocked - char *p = (char *) putchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_putchar_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_putchar_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 -if test $ac_cv_have_decl_putchar_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 0 -_ACEOF - - -fi - - - - - - - - : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - - : - - fi - - - - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - - : - - fi - -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -exit (closedir (opendir (".")) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - - - -for ac_header in fcntl.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - echo "$as_me:$LINENO: checking for DOS-style setmode" >&5 -echo $ECHO_N "checking for DOS-style setmode... $ECHO_C" >&6 -if test "${ac_cv_func_setmode_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif -int -main () -{ -int ret = setmode && setmode (1, O_BINARY); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setmode_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setmode_dos=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setmode_dos" >&5 -echo "${ECHO_T}$ac_cv_func_setmode_dos" >&6 - if test $ac_cv_func_setmode_dos = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SETMODE_DOS 1 -_ACEOF - - fi - -for ac_func in vprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -echo "$as_me:$LINENO: checking for _doprnt" >&5 -echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 -if test "${ac_cv_func__doprnt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -char (*f) () = _doprnt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != _doprnt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__doprnt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func__doprnt=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 -echo "${ECHO_T}$ac_cv_func__doprnt" >&6 -if test $ac_cv_func__doprnt = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOPRNT 1 -_ACEOF - -fi - -fi -done - - - -for ac_func in mkdir -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking whether mkdir takes only one argument" >&5 -echo $ECHO_N "checking whether mkdir takes only one argument... $ECHO_C" >&6 -if test "${patch_cv_mkdir_takes_one_arg+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -mkdir (".", 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -mkdir ("."); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - patch_cv_mkdir_takes_one_arg=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - fi - - -fi -echo "$as_me:$LINENO: result: $patch_cv_mkdir_takes_one_arg" >&5 -echo "${ECHO_T}$patch_cv_mkdir_takes_one_arg" >&6 - if test $patch_cv_mkdir_takes_one_arg = yes; then - -cat >>confdefs.h <<\_ACEOF -#define MKDIR_TAKES_ONE_ARG 1 -_ACEOF - - fi - - - - - echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 -echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 -if test "${ac_cv_win_or_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_win_or_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_win_or_dos=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 -echo "${ECHO_T}$ac_cv_win_or_dos" >&6 - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix -_ACEOF - - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator -_ACEOF - - -echo "$as_me:$LINENO: checking for long file names" >&5 -echo $ECHO_N "checking for long file names... $ECHO_C" >&6 -if test "${ac_cv_sys_long_file_names+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_long_file_names=yes -# Test for long file names in all the places we know might matter: -# . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: -# /tmp where it might want to write temporary files -# /var/tmp likewise -# /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs=$TMPDIR -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do - test -d $ac_dir || continue - test -w $ac_dir || continue # It is less confusing to not echo anything here. - ac_xdir=$ac_dir/cf$$ - (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue - ac_tf1=$ac_xdir/conftest9012345 - ac_tf2=$ac_xdir/conftest9012346 - (echo 1 >$ac_tf1) 2>/dev/null - (echo 2 >$ac_tf2) 2>/dev/null - ac_val=`cat $ac_tf1 2>/dev/null` - if test ! -f $ac_tf1 || test "$ac_val" != 1; then - ac_cv_sys_long_file_names=no - rm -rf $ac_xdir 2>/dev/null - break - fi - rm -rf $ac_xdir 2>/dev/null -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 -echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 -if test $ac_cv_sys_long_file_names = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_FILE_NAMES 1 -_ACEOF - -fi - - - ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by patch $as_me 2.5.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -patch config.status 2.5.9 -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@ed_PROGRAM@,$ed_PROGRAM,;t t -s,@EGREP@,$EGREP,;t t -s,@STDBOOL_H@,$STDBOOL_H,;t t -s,@HAVE__BOOL@,$HAVE__BOOL,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - Property changes on: vendor/misc-GNU/patch/2.5.9/configure ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/mkdir.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/mkdir.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/mkdir.c (nonexistent) @@ -1,76 +0,0 @@ -/* On some systems, mkdir ("foo/", 0700) fails because of the trailing - slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#include - -/* Disable the definition of mkdir to rpl_mkdir (from config.h) in this - file. Otherwise, we'd get conflicting prototypes for rpl_mkdir on - most systems. */ -#undef mkdir - -#include -#include -#include -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_STRING_H -# include -#else -# include -#endif - -#include "dirname.h" -#include "xalloc.h" - -#ifndef HAVE_DECL_FREE -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_FREE -void free (); -#endif - -/* This function is required at least for NetBSD 1.5.2. */ - -int -rpl_mkdir (char const *dir, mode_t mode) -{ - int ret_val; - char *tmp_dir; - size_t len = strlen (dir); - - if (len && dir[len - 1] == '/') - { - tmp_dir = xstrdup (dir); - strip_trailing_slashes (tmp_dir); - } - else - { - tmp_dir = (char *) dir; - } - - ret_val = mkdir (tmp_dir, mode); - - if (tmp_dir != dir) - free (tmp_dir); - - return ret_val; -} Property changes on: vendor/misc-GNU/patch/2.5.9/mkdir.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/realloc.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/realloc.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/realloc.c (nonexistent) @@ -1,44 +0,0 @@ -/* Work around bug on some systems where realloc (NULL, 0) fails. - Copyright (C) 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#if HAVE_CONFIG_H -# include -#endif -#undef realloc - -#include - -char *malloc (); -char *realloc (); - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. If N is zero, change it to 1. If P is NULL, - use malloc. */ - -char * -rpl_realloc (p, n) - char *p; - size_t n; -{ - if (n == 0) - n = 1; - if (p == 0) - return malloc (n); - return realloc (p, n); -} Property changes on: vendor/misc-GNU/patch/2.5.9/realloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/Makefile.in =================================================================== --- vendor/misc-GNU/patch/2.5.9/Makefile.in (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/Makefile.in (nonexistent) @@ -1,221 +0,0 @@ -# Makefile for GNU patch. - -# Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, write to the Free Software Foundation, -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#### Start of system configuration section. #### - -srcdir = @srcdir@ -VPATH = @srcdir@ - -@SET_MAKE@ - -CC = @CC@ -ed_PROGRAM = @ed_PROGRAM@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -transform = @program_transform_name@ - -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -DEFS = @DEFS@ -EXEEXT = @EXEEXT@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -OBJEXT = @OBJEXT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = $(exec_prefix)/bin - -# Where to put the manual pages. -mandir = @mandir@ -man1dir = $(mandir)/man1 -# Extension (including `.') for the manual page filenames. -man1ext = .1 - -# Hook for nonstandard builds. -CONFIG_STATUS = config.status - -#### End of system configuration section. #### - -SHELL = /bin/sh - -LIBSRCS = error.c malloc.c memchr.c mkdir.c \ - realloc.c rmdir.c strcasecmp.c strncasecmp.c -SRCS = $(LIBSRCS) \ - addext.c argmatch.c backupfile.c \ - basename.c dirname.c \ - getopt.c getopt1.c inp.c \ - maketime.c partime.c \ - patch.c pch.c \ - quote.c quotearg.c quotesys.c \ - util.c version.c xmalloc.c -OBJS = $(LIBOBJS) \ - addext.$(OBJEXT) argmatch.$(OBJEXT) backupfile.$(OBJEXT) \ - basename.$(OBJEXT) dirname.$(OBJEXT) \ - getopt.$(OBJEXT) getopt1.$(OBJEXT) inp.$(OBJEXT) \ - maketime.$(OBJEXT) partime.$(OBJEXT) \ - patch.$(OBJEXT) pch.$(OBJEXT) \ - quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \ - util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) -HDRS = argmatch.h backupfile.h common.h dirname.h \ - error.h getopt.h gettext.h \ - inp.h maketime.h partime.h pch.h \ - quote.h quotearg.h quotesys.h \ - unlocked-io.h util.h version.h xalloc.h -MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \ - aclocal.m4 \ - config.hin configure configure.ac \ - install-sh mkinstalldirs patch.man stdbool.h.in -DISTFILES = $(MISC) $(SRCS) $(HDRS) -DISTFILES_M4 = $(ACINCLUDE_INPUTS) -DISTFILES_PC = pc/chdirsaf.c -DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \ - pc/djgpp/configure.bat pc/djgpp/configure.sed - -patch_name = `echo patch | sed '$(transform)'` - -all:: patch$(EXEEXT) - -info:: -check:: -installcheck:: - -COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \ - -I. -I$(srcdir) $(CFLAGS) - -.c.$(OBJEXT): - $(COMPILE) $< - -patch$(EXEEXT): $(OBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) - -install:: all installdirs - $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT) - -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext) - -installdirs:: - $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir) - -install-strip:: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install - -uninstall:: - rm -f $(bindir)/$(patch_name)$(EXEEXT) - rm -f $(man1dir)/$(patch_name)$(man1ext) - -Makefile: Makefile.in $(CONFIG_STATUS) - $(SHELL) $(CONFIG_STATUS) -config.status: configure - $(SHELL) $(CONFIG_STATUS) --recheck -configure: configure.ac $(srcdir)/aclocal.m4 - cd $(srcdir) && autoconf -config.hin: configure.ac $(srcdir)/aclocal.m4 - cd $(srcdir) && rm -f config.hin && autoheader -stdbool.h: stdbool.h.in - sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' \ - <$(srcdir)/stdbool.h.in >stdbool.h - -M4DIR = $(srcdir)/m4 -ACINCLUDE_INPUTS = \ - $(M4DIR)/backupfile.m4 \ - $(M4DIR)/d-ino.m4 \ - $(M4DIR)/dirname.m4 \ - $(M4DIR)/dos.m4 \ - $(M4DIR)/error.m4 \ - $(M4DIR)/getopt.m4 \ - $(M4DIR)/malloc.m4 \ - $(M4DIR)/mbrtowc.m4 \ - $(M4DIR)/mbstate_t.m4 \ - $(M4DIR)/memchr.m4 \ - $(M4DIR)/mkdir.m4 \ - $(M4DIR)/onceonly.m4 \ - $(M4DIR)/quote.m4 \ - $(M4DIR)/quotearg.m4 \ - $(M4DIR)/realloc.m4 \ - $(M4DIR)/rmdir.m4 \ - $(M4DIR)/setmode.m4 \ - $(M4DIR)/stdbool.m4 \ - $(M4DIR)/unlocked-io.m4 \ - $(M4DIR)/utimbuf.m4 \ - $(M4DIR)/xalloc.m4 - -$(srcdir)/aclocal.m4: $(ACINCLUDE_INPUTS) - cat $(ACINCLUDE_INPUTS) >$(srcdir)/aclocal.m4 - -TAGS: $(HDRS) $(SRCS) - etags $(HDRS) $(SRCS) - -mostlyclean:: - rm -f core* *core *.$(OBJEXT) *_.c stdbool.h - -clean:: mostlyclean - rm -f patch$(EXEEXT) - -distclean:: clean - rm -f Makefile config.cache config.log config.status config.h - -maintainer-clean:: - @echo "This command is intended for maintainers to use;" - @echo "rebuilding the deleted files requires special tools." - $(MAKE) distclean - rm -f TAGS - -PV = $(PACKAGE_NAME)-$(PACKAGE_VERSION) - -dist:: $(DISTFILES) $(DISTFILES_M4) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP) - rm -rf $(PV) - mkdir $(PV) $(PV)/m4 $(PV)/pc $(PV)/pc/djgpp - cp -p $(DISTFILES) $(PV) - cp -p $(DISTFILES_M4) $(PV)/m4 - cp -p $(DISTFILES_PC) $(PV)/pc - cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp - tar -chf - $(PV) | gzip -9 >$(PV).tar.gz - rm -rf $(PV) - -$(OBJS): config.h -COMMON = common.h @STDBOOL_H@ -addext.$(OBJEXT): backupfile.h dirname.h -argmatch.$(OBJEXT): argmatch.h gettext.h error.h \ - quote.h quotearg.h unlocked-io.h -backupfile.$(OBJEXT): argmatch.h backupfile.h dirname.h -basename.$(OBJEXT): dirname.h -dirname.$(OBJEXT): dirname.h xalloc.h -error.$(OBJEXT): error.h gettext.h unlocked-io.h -getopt.$(OBJEXT) getopt1.$(OBJEXT): getopt.h -inp.$(OBJEXT): backupfile.h $(COMMON) inp.h pch.h quotearg.h util.h xalloc.h -maketime.$(OBJEXT): maketime.h partime.h -mkdir.$(OBJEXT): dirname.h xalloc.h -partime.$(OBJEXT): partime.h -patch.$(OBJEXT): argmatch.h backupfile.h $(COMMON) getopt.h inp.h \ - pch.h quotearg.h util.h version.h xalloc.h -pch.$(OBJEXT): backupfile.h $(COMMON) dirname.h inp.h pch.h quotearg.h util.h -quote.$(OBJECT): quote.h quotearg.h -quotearg.$(OBJEXT): gettext.h quotearg.h xalloc.h -quotesys.$(OBJEXT): quotesys.h -strncasecmp.$(OBJEXT): strcasecmp.c -util.$(OBJEXT): backupfile.h $(COMMON) dirname.h maketime.h \ - partime.h quotearg.h quotesys.h util.h version.h xalloc.h -version.$(OBJEXT): $(COMMON) version.h -xmalloc.$(OBJEXT): error.h gettext.h xalloc.h Index: vendor/misc-GNU/patch/2.5.9/strcasecmp.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/strcasecmp.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/strcasecmp.c (nonexistent) @@ -1,66 +0,0 @@ -/* strcasecmp.c -- case insensitive string comparator - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifdef LENGTH_LIMIT -# define STRXCASECMP_FUNCTION strncasecmp -# define STRXCASECMP_DECLARE_N , size_t n -# define LENGTH_LIMIT_EXPR(Expr) Expr -#else -# define STRXCASECMP_FUNCTION strcasecmp -# define STRXCASECMP_DECLARE_N /* empty */ -# define LENGTH_LIMIT_EXPR(Expr) 0 -#endif - -#include -#include - -#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) - -/* Compare {{no more than N characters of }}strings S1 and S2, - ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less - than, equal to or greater than S2. */ - -int -STRXCASECMP_FUNCTION (const char *s1, const char *s2 STRXCASECMP_DECLARE_N) -{ - register const unsigned char *p1 = (const unsigned char *) s1; - register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - if (p1 == p2 || LENGTH_LIMIT_EXPR (n == 0)) - return 0; - - do - { - c1 = TOLOWER (*p1); - c2 = TOLOWER (*p2); - - if (LENGTH_LIMIT_EXPR (--n == 0) || c1 == '\0') - break; - - ++p1; - ++p2; - } - while (c1 == c2); - - return c1 - c2; -} Property changes on: vendor/misc-GNU/patch/2.5.9/strcasecmp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/pch.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/pch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/pch.c (nonexistent) @@ -1,2007 +0,0 @@ -/* reading patches */ - -/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */ - -/* Copyright (C) 1986, 1987, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#define INITHUNKMAX 125 /* initial dynamic allocation size */ - -/* Patch (diff listing) abstract type. */ - -static FILE *pfp; /* patch file pointer */ -static int p_says_nonexistent[2]; /* [0] for old file, [1] for new: - 0 for existent and nonempty, - 1 for existent and probably (but not necessarily) empty, - 2 for nonexistent */ -static int p_rfc934_nesting; /* RFC 934 nesting level */ -static time_t p_timestamp[2]; /* timestamps in patch headers */ -static off_t p_filesize; /* size of the patch file */ -static LINENUM p_first; /* 1st line number */ -static LINENUM p_newfirst; /* 1st line number of replacement */ -static LINENUM p_ptrn_lines; /* # lines in pattern */ -static LINENUM p_repl_lines; /* # lines in replacement text */ -static LINENUM p_end = -1; /* last line in hunk */ -static LINENUM p_max; /* max allowed value of p_end */ -static LINENUM p_prefix_context; /* # of prefix context lines */ -static LINENUM p_suffix_context; /* # of suffix context lines */ -static LINENUM p_input_line; /* current line # from patch file */ -static char **p_line; /* the text of the hunk */ -static size_t *p_len; /* line length including \n if any */ -static char *p_Char; /* +, -, and ! */ -static LINENUM hunkmax = INITHUNKMAX; /* size of above arrays */ -static int p_indent; /* indent to patch */ -static bool p_strip_trailing_cr; /* true if stripping trailing \r */ -static bool p_pass_comments_through; /* true if not ignoring # lines */ -static file_offset p_base; /* where to intuit this time */ -static LINENUM p_bline; /* line # of p_base */ -static file_offset p_start; /* where intuit found a patch */ -static LINENUM p_sline; /* and the line number for it */ -static LINENUM p_hunk_beg; /* line number of current hunk */ -static LINENUM p_efake = -1; /* end of faked up lines--don't free */ -static LINENUM p_bfake = -1; /* beg of faked up lines */ - -enum nametype { OLD, NEW, INDEX, NONE }; - -static char *scan_linenum (char *, LINENUM *); -static enum diff intuit_diff_type (void); -static enum nametype best_name (char * const *, int const *); -static int prefix_components (char *, bool); -static size_t pget_line (int, int, bool, bool); -static size_t get_line (void); -static bool incomplete_line (void); -static bool grow_hunkmax (void); -static void malformed (void) __attribute__ ((noreturn)); -static void next_intuit_at (file_offset, LINENUM); -static void skip_to (file_offset, LINENUM); -static char get_ed_command_letter (char const *); - -/* Prepare to look for the next patch in the patch file. */ - -void -re_patch (void) -{ - p_first = 0; - p_newfirst = 0; - p_ptrn_lines = 0; - p_repl_lines = 0; - p_end = -1; - p_max = 0; - p_indent = 0; - p_strip_trailing_cr = false; -} - -/* Open the patch file at the beginning of time. */ - -void -open_patch_file (char const *filename) -{ - file_offset file_pos = 0; - struct stat st; - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -#if HAVE_SETMODE_DOS - if (binary_transput) - { - if (isatty (STDIN_FILENO)) - fatal ("cannot read binary data from tty on this platform"); - setmode (STDIN_FILENO, O_BINARY); - } -#endif - if (fstat (STDIN_FILENO, &st) != 0) - pfatal ("fstat"); - if (S_ISREG (st.st_mode) && (stdin_pos = file_tell (stdin)) != -1) - { - pfp = stdin; - file_pos = stdin_pos; - } - else - { - size_t charsread; - int exclusive = TMPPATNAME_needs_removal ? 0 : O_EXCL; - TMPPATNAME_needs_removal = 1; - pfp = fdopen (create_file (TMPPATNAME, - O_RDWR | O_BINARY | exclusive, - (mode_t) 0), - "w+b"); - if (!pfp) - pfatal ("Can't open stream for file %s", quotearg (TMPPATNAME)); - for (st.st_size = 0; - (charsread = fread (buf, 1, bufsize, stdin)) != 0; - st.st_size += charsread) - if (fwrite (buf, 1, charsread, pfp) != charsread) - write_fatal (); - if (ferror (stdin) || fclose (stdin) != 0) - read_fatal (); - if (fflush (pfp) != 0 - || file_seek (pfp, (file_offset) 0, SEEK_SET) != 0) - write_fatal (); - } - } - else - { - pfp = fopen (filename, binary_transput ? "rb" : "r"); - if (!pfp) - pfatal ("Can't open patch file %s", quotearg (filename)); - if (fstat (fileno (pfp), &st) != 0) - pfatal ("fstat"); - } - p_filesize = st.st_size; - if (p_filesize != (file_offset) p_filesize) - fatal ("patch file is too long"); - next_intuit_at (file_pos, (LINENUM) 1); - set_hunkmax(); -} - -/* Make sure our dynamically realloced tables are malloced to begin with. */ - -void -set_hunkmax (void) -{ - if (!p_line) - p_line = (char **) malloc (hunkmax * sizeof *p_line); - if (!p_len) - p_len = (size_t *) malloc (hunkmax * sizeof *p_len); - if (!p_Char) - p_Char = malloc (hunkmax * sizeof *p_Char); -} - -/* Enlarge the arrays containing the current hunk of patch. */ - -static bool -grow_hunkmax (void) -{ - hunkmax *= 2; - assert (p_line && p_len && p_Char); - if ((p_line = (char **) realloc (p_line, hunkmax * sizeof (*p_line))) - && (p_len = (size_t *) realloc (p_len, hunkmax * sizeof (*p_len))) - && (p_Char = realloc (p_Char, hunkmax * sizeof (*p_Char)))) - return true; - if (!using_plan_a) - memory_fatal (); - /* Don't free previous values of p_line etc., - since some broken implementations free them for us. - Whatever is null will be allocated again from within plan_a (), - of all places. */ - return false; -} - -/* True if the remainder of the patch file contains a diff of some sort. */ - -bool -there_is_another_patch (void) -{ - if (p_base != 0 && p_base >= p_filesize) { - if (verbosity == VERBOSE) - say ("done\n"); - return false; - } - if (verbosity == VERBOSE) - say ("Hmm..."); - diff_type = intuit_diff_type(); - if (diff_type == NO_DIFF) { - if (verbosity == VERBOSE) - say (p_base - ? " Ignoring the trailing garbage.\ndone\n" - : " I can't seem to find a patch in there anywhere.\n"); - if (! p_base && p_filesize) - fatal ("Only garbage was found in the patch input."); - return false; - } - if (skip_rest_of_patch) - { - Fseek (pfp, p_start, SEEK_SET); - p_input_line = p_sline - 1; - return true; - } - if (verbosity == VERBOSE) - say (" %sooks like %s to me...\n", - (p_base == 0 ? "L" : "The next patch l"), - diff_type == UNI_DIFF ? "a unified diff" : - diff_type == CONTEXT_DIFF ? "a context diff" : - diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : - diff_type == NORMAL_DIFF ? "a normal diff" : - "an ed script" ); - - if (verbosity != SILENT) - { - if (p_indent) - say ("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s"); - if (p_strip_trailing_cr) - say ("(Stripping trailing CRs from patch.)\n"); - if (! inname) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("can't find file to patch at input line %s\n", - format_linenum (numbuf, p_sline)); - if (diff_type != ED_DIFF) - say (strippath == -1 - ? "Perhaps you should have used the -p or --strip option?\n" - : "Perhaps you used the wrong -p or --strip option?\n"); - } - } - - skip_to(p_start,p_sline); - while (!inname) { - if (force | batch) { - say ("No file to patch. Skipping patch.\n"); - skip_rest_of_patch = true; - return true; - } - ask ("File to patch: "); - inname = fetchname (buf, 0, (time_t *) 0); - if (inname) - { - if (stat (inname, &instat) == 0) - { - inerrno = 0; - invc = -1; - } - else - { - perror (inname); - fflush (stderr); - free (inname); - inname = 0; - } - } - if (!inname) { - ask ("Skip this patch? [y] "); - if (*buf != 'n') { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - return true; - } - } - } - return true; -} - -/* Determine what kind of diff is in the remaining part of the patch file. */ - -static enum diff -intuit_diff_type (void) -{ - register file_offset this_line = 0; - register file_offset first_command_line = -1; - char first_ed_command_letter = 0; - LINENUM fcl_line = 0; /* Pacify `gcc -W'. */ - register bool this_is_a_command = false; - register bool stars_this_line = false; - enum nametype i; - char *name[3]; - struct stat st[3]; - int stat_errno[3]; - int version_controlled[3]; - register enum diff retval; - - name[OLD] = name[NEW] = name[INDEX] = 0; - version_controlled[OLD] = -1; - version_controlled[NEW] = -1; - version_controlled[INDEX] = -1; - p_rfc934_nesting = 0; - p_timestamp[OLD] = p_timestamp[NEW] = (time_t) -1; - p_says_nonexistent[OLD] = p_says_nonexistent[NEW] = 0; - Fseek (pfp, p_base, SEEK_SET); - p_input_line = p_bline - 1; - for (;;) { - register char *s; - register char *t; - register file_offset previous_line = this_line; - register bool last_line_was_command = this_is_a_command; - register bool stars_last_line = stars_this_line; - register int indent = 0; - char ed_command_letter; - bool strip_trailing_cr; - size_t chars_read; - - this_line = file_tell (pfp); - chars_read = pget_line (0, 0, false, false); - if (chars_read == (size_t) -1) - memory_fatal (); - if (! chars_read) { - if (first_ed_command_letter) { - /* nothing but deletes!? */ - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - else { - p_start = this_line; - p_sline = p_input_line; - return NO_DIFF; - } - } - strip_trailing_cr = 2 <= chars_read && buf[chars_read - 2] == '\r'; - for (s = buf; *s == ' ' || *s == '\t' || *s == 'X'; s++) { - if (*s == '\t') - indent = (indent + 8) & ~7; - else - indent++; - } - for (t = s; ISDIGIT (*t) || *t == ','; t++) - continue; - this_is_a_command = (ISDIGIT (*s) && - (*t == 'd' || *t == 'c' || *t == 'a') ); - if (first_command_line < 0 - && ((ed_command_letter = get_ed_command_letter (s)) - || this_is_a_command)) { - first_command_line = this_line; - first_ed_command_letter = ed_command_letter; - fcl_line = p_input_line; - p_indent = indent; /* assume this for now */ - p_strip_trailing_cr = strip_trailing_cr; - } - if (!stars_last_line && strnEQ(s, "*** ", 4)) - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "+++ ", 4)) - /* Swap with NEW below. */ - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "Index:", 6)) - name[INDEX] = fetchname (s+6, strippath, (time_t *) 0); - else if (strnEQ(s, "Prereq:", 7)) { - for (t = s + 7; ISSPACE ((unsigned char) *t); t++) - continue; - revision = t; - for (t = revision; *t; t++) - if (ISSPACE ((unsigned char) *t)) - { - char const *u; - for (u = t + 1; ISSPACE ((unsigned char) *u); u++) - continue; - if (*u) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("Prereq: with multiple words at line %s of patch\n", - format_linenum (numbuf, this_line)); - } - break; - } - if (t == revision) - revision = 0; - else { - char oldc = *t; - *t = '\0'; - revision = savestr (revision); - *t = oldc; - } - } else - { - for (t = s; t[0] == '-' && t[1] == ' '; t += 2) - continue; - if (strnEQ(t, "--- ", 4)) - { - time_t timestamp = (time_t) -1; - name[NEW] = fetchname (t+4, strippath, ×tamp); - if (timestamp != (time_t) -1) - { - p_timestamp[NEW] = timestamp; - p_rfc934_nesting = (t - s) >> 1; - } - } - } - if ((diff_type == NO_DIFF || diff_type == ED_DIFF) && - first_command_line >= 0 && - strEQ(s, ".\n") ) { - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == UNI_DIFF) - && strnEQ(s, "@@ -", 4)) { - - /* `name' and `p_timestamp' are backwards; swap them. */ - time_t ti = p_timestamp[OLD]; - p_timestamp[OLD] = p_timestamp[NEW]; - p_timestamp[NEW] = ti; - t = name[OLD]; - name[OLD] = name[NEW]; - name[NEW] = t; - - s += 4; - if (s[0] == '0' && !ISDIGIT (s[1])) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - while (*s != ' ' && *s != '\n') - s++; - while (*s == ' ') - s++; - if (s[0] == '+' && s[1] == '0' && !ISDIGIT (s[2])) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - p_indent = indent; - p_start = this_line; - p_sline = p_input_line; - retval = UNI_DIFF; - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW])) - && ! name[INDEX]) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("missing header for unified diff at line %s of patch\n", - format_linenum (numbuf, p_sline)); - } - goto scan_exit; - } - stars_this_line = strnEQ(s, "********", 8); - if ((diff_type == NO_DIFF - || diff_type == CONTEXT_DIFF - || diff_type == NEW_CONTEXT_DIFF) - && stars_last_line && strnEQ (s, "*** ", 4)) { - s += 4; - if (s[0] == '0' && !ISDIGIT (s[1])) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - /* if this is a new context diff the character just before */ - /* the newline is a '*'. */ - while (*s != '\n') - s++; - p_indent = indent; - p_strip_trailing_cr = strip_trailing_cr; - p_start = previous_line; - p_sline = p_input_line - 1; - retval = (*(s-1) == '*' ? NEW_CONTEXT_DIFF : CONTEXT_DIFF); - - { - /* Scan the first hunk to see whether the file contents - appear to have been deleted. */ - file_offset saved_p_base = p_base; - LINENUM saved_p_bline = p_bline; - Fseek (pfp, previous_line, SEEK_SET); - p_input_line -= 2; - if (another_hunk (retval, false) - && ! p_repl_lines && p_newfirst == 1) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - next_intuit_at (saved_p_base, saved_p_bline); - } - - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW])) - && ! name[INDEX]) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("missing header for context diff at line %s of patch\n", - format_linenum (numbuf, p_sline)); - } - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == NORMAL_DIFF) && - last_line_was_command && - (strnEQ(s, "< ", 2) || strnEQ(s, "> ", 2)) ) { - p_start = previous_line; - p_sline = p_input_line - 1; - p_indent = indent; - p_strip_trailing_cr = strip_trailing_cr; - retval = NORMAL_DIFF; - goto scan_exit; - } - } - - scan_exit: - - /* To intuit `inname', the name of the file to patch, - use the algorithm specified by POSIX 1003.1-2001 XCU lines 25680-26599 - (with some modifications if posixly_correct is zero): - - - Take the old and new names from the context header if present, - and take the index name from the `Index:' line if present and - if either the old and new names are both absent - or posixly_correct is nonzero. - Consider the file names to be in the order (old, new, index). - - If some named files exist, use the first one if posixly_correct - is nonzero, the best one otherwise. - - If patch_get is nonzero, and no named files exist, - but an RCS or SCCS master file exists, - use the first named file with an RCS or SCCS master. - - If no named files exist, no RCS or SCCS master was found, - some names are given, posixly_correct is zero, - and the patch appears to create a file, then use the best name - requiring the creation of the fewest directories. - - Otherwise, report failure by setting `inname' to 0; - this causes our invoker to ask the user for a file name. */ - - i = NONE; - - if (!inname) - { - enum nametype i0 = NONE; - - if (! posixly_correct && (name[OLD] || name[NEW]) && name[INDEX]) - { - free (name[INDEX]); - name[INDEX] = 0; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - if (i0 != NONE && strcmp (name[i0], name[i]) == 0) - { - /* It's the same name as before; reuse stat results. */ - stat_errno[i] = stat_errno[i0]; - if (! stat_errno[i]) - st[i] = st[i0]; - } - else if (stat (name[i], &st[i]) != 0) - stat_errno[i] = errno; - else - { - stat_errno[i] = 0; - if (posixly_correct) - break; - } - i0 = i; - } - - if (! posixly_correct) - { - bool is_empty; - - i = best_name (name, stat_errno); - - if (i == NONE && patch_get) - { - enum nametype nope = NONE; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - char const *cs; - char *getbuf; - char *diffbuf; - bool readonly = (outfile - && strcmp (outfile, name[i]) != 0); - - if (nope == NONE || strcmp (name[nope], name[i]) != 0) - { - cs = (version_controller - (name[i], readonly, (struct stat *) 0, - &getbuf, &diffbuf)); - version_controlled[i] = !! cs; - if (cs) - { - if (version_get (name[i], cs, false, readonly, - getbuf, &st[i])) - stat_errno[i] = 0; - else - version_controlled[i] = 0; - - free (getbuf); - if (diffbuf) - free (diffbuf); - - if (! stat_errno[i]) - break; - } - } - - nope = i; - } - } - - is_empty = i == NONE || st[i].st_size == 0; - if ((! is_empty) < p_says_nonexistent[reverse ^ is_empty]) - { - assert (i0 != NONE); - reverse ^= - ok_to_reverse - ("The next patch%s would %s the file %s,\nwhich %s!", - reverse ? ", when reversed," : "", - (i == NONE ? "delete" - : st[i].st_size == 0 ? "empty out" - : "create"), - quotearg (name[i == NONE || st[i].st_size == 0 ? i0 : i]), - (i == NONE ? "does not exist" - : st[i].st_size == 0 ? "is already empty" - : "already exists")); - } - - if (i == NONE && p_says_nonexistent[reverse]) - { - int newdirs[3]; - int newdirs_min = INT_MAX; - int distance_from_minimum[3]; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - newdirs[i] = (prefix_components (name[i], false) - - prefix_components (name[i], true)); - if (newdirs[i] < newdirs_min) - newdirs_min = newdirs[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - distance_from_minimum[i] = newdirs[i] - newdirs_min; - - i = best_name (name, distance_from_minimum); - } - } - } - - if (i == NONE) - inerrno = -1; - else - { - inname = name[i]; - name[i] = 0; - inerrno = stat_errno[i]; - invc = version_controlled[i]; - instat = st[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - free (name[i]); - - return retval; -} - -/* Count the path name components in FILENAME's prefix. - If CHECKDIRS is true, count only existing directories. */ -static int -prefix_components (char *filename, bool checkdirs) -{ - int count = 0; - struct stat stat_buf; - int stat_result; - char *f = filename + FILESYSTEM_PREFIX_LEN (filename); - - if (*f) - while (*++f) - if (ISSLASH (f[0]) && ! ISSLASH (f[-1])) - { - if (checkdirs) - { - *f = '\0'; - stat_result = stat (filename, &stat_buf); - *f = '/'; - if (! (stat_result == 0 && S_ISDIR (stat_buf.st_mode))) - break; - } - - count++; - } - - return count; -} - -/* Return the index of the best of NAME[OLD], NAME[NEW], and NAME[INDEX]. - Ignore null names, and ignore NAME[i] if IGNORE[i] is nonzero. - Return NONE if all names are ignored. */ -static enum nametype -best_name (char *const *name, int const *ignore) -{ - enum nametype i; - int components[3]; - int components_min = INT_MAX; - size_t basename_len[3]; - size_t basename_len_min = SIZE_MAX; - size_t len[3]; - size_t len_min = SIZE_MAX; - - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i]) - { - /* Take the names with the fewest prefix components. */ - components[i] = prefix_components (name[i], false); - if (components_min < components[i]) - continue; - components_min = components[i]; - - /* Of those, take the names with the shortest basename. */ - basename_len[i] = strlen (base_name (name[i])); - if (basename_len_min < basename_len[i]) - continue; - basename_len_min = basename_len[i]; - - /* Of those, take the shortest names. */ - len[i] = strlen (name[i]); - if (len_min < len[i]) - continue; - len_min = len[i]; - } - - /* Of those, take the first name. */ - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i] - && components[i] == components_min - && basename_len[i] == basename_len_min - && len[i] == len_min) - break; - - return i; -} - -/* Remember where this patch ends so we know where to start up again. */ - -static void -next_intuit_at (file_offset file_pos, LINENUM file_line) -{ - p_base = file_pos; - p_bline = file_line; -} - -/* Basically a verbose fseek() to the actual diff listing. */ - -static void -skip_to (file_offset file_pos, LINENUM file_line) -{ - register FILE *i = pfp; - register FILE *o = stdout; - register int c; - - assert(p_base <= file_pos); - if ((verbosity == VERBOSE || !inname) && p_base < file_pos) { - Fseek (i, p_base, SEEK_SET); - say ("The text leading up to this was:\n--------------------------\n"); - - while (file_tell (i) < file_pos) - { - putc ('|', o); - do - { - if ((c = getc (i)) == EOF) - read_fatal (); - putc (c, o); - } - while (c != '\n'); - } - - say ("--------------------------\n"); - } - else - Fseek (i, file_pos, SEEK_SET); - p_input_line = file_line - 1; -} - -/* Make this a function for better debugging. */ -static void -malformed (void) -{ - char numbuf[LINENUM_LENGTH_BOUND + 1]; - fatal ("malformed patch at line %s: %s", - format_linenum (numbuf, p_input_line), buf); - /* about as informative as "Syntax error" in C */ -} - -/* Parse a line number from a string. - Return the address of the first char after the number. */ -static char * -scan_linenum (char *s0, LINENUM *linenum) -{ - char *s; - LINENUM n = 0; - bool overflow = false; - char numbuf[LINENUM_LENGTH_BOUND + 1]; - - for (s = s0; ISDIGIT (*s); s++) - { - LINENUM new_n = 10 * n + (*s - '0'); - overflow |= new_n / 10 != n; - n = new_n; - } - - if (s == s0) - fatal ("missing line number at line %s: %s", - format_linenum (numbuf, p_input_line), buf); - - if (overflow) - fatal ("line number %.*s is too large at line %s: %s", - (int) (s - s0), s0, format_linenum (numbuf, p_input_line), buf); - - *linenum = n; - return s; -} - -/* 1 if there is more of the current diff listing to process; - 0 if not; -1 if ran out of memory. */ - -int -another_hunk (enum diff difftype, bool rev) -{ - register char *s; - register LINENUM context = 0; - register size_t chars_read; - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - char numbuf2[LINENUM_LENGTH_BOUND + 1]; - char numbuf3[LINENUM_LENGTH_BOUND + 1]; - - while (p_end >= 0) { - if (p_end == p_efake) - p_end = p_bfake; /* don't free twice */ - else - free(p_line[p_end]); - p_end--; - } - assert(p_end == -1); - p_efake = -1; - - p_max = hunkmax; /* gets reduced when --- found */ - if (difftype == CONTEXT_DIFF || difftype == NEW_CONTEXT_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - LINENUM repl_beginning = 0; /* index of --- line */ - register LINENUM fillcnt = 0; /* #lines of missing ptrn or repl */ - register LINENUM fillsrc; /* index of first line to copy */ - register LINENUM filldst; /* index of first missing line */ - bool ptrn_spaces_eaten = false; /* ptrn was slightly misformed */ - bool some_context = false; /* (perhaps internal) context seen */ - register bool repl_could_be_missing = true; - bool ptrn_missing = false; /* The pattern was missing. */ - bool repl_missing = false; /* Likewise for replacement. */ - file_offset repl_backtrack_position = 0; - /* file pos of first repl line */ - LINENUM repl_patch_line; /* input line number for same */ - LINENUM repl_context; /* context for same */ - LINENUM ptrn_prefix_context = -1; /* lines in pattern prefix context */ - LINENUM ptrn_suffix_context = -1; /* lines in pattern suffix context */ - LINENUM repl_prefix_context = -1; /* lines in replac. prefix context */ - LINENUM ptrn_copiable = 0; /* # of copiable lines in ptrn */ - LINENUM repl_copiable = 0; /* Likewise for replacement. */ - - /* Pacify `gcc -Wall'. */ - fillsrc = filldst = repl_patch_line = repl_context = 0; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 8 - || strncmp (buf, "********", 8) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_hunk_beg = p_input_line + 1; - while (p_end < p_max) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - return -1; - if (!chars_read) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - if (p_max - p_end < 4) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 3; - } else { - fatal ("unexpected end of file in patch"); - } - } - p_end++; - if (p_end == hunkmax) - fatal ("unterminated hunk starting at line %s; giving up at line %s: %s", - format_linenum (numbuf0, pch_hunk_beg ()), - format_linenum (numbuf1, p_input_line), buf); - assert(p_end < hunkmax); - p_Char[p_end] = *buf; - p_len[p_end] = 0; - p_line[p_end] = 0; - switch (*buf) { - case '*': - if (strnEQ(buf, "********", 8)) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - else - fatal ("unexpected end of hunk at line %s", - format_linenum (numbuf0, p_input_line)); - } - if (p_end != 0) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal ("unexpected `***' at line %s: %s", - format_linenum (numbuf0, p_input_line), buf); - } - context = 0; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) { - p_end--; - return -1; - } - for (s = buf; *s && !ISDIGIT (*s); s++) - continue; - if (strnEQ(s,"0,0",3)) - remove_prefix (s, 2); - s = scan_linenum (s, &p_first); - if (*s == ',') { - while (*s && !ISDIGIT (*s)) - s++; - scan_linenum (s, &p_ptrn_lines); - p_ptrn_lines += 1 - p_first; - } - else if (p_first) - p_ptrn_lines = 1; - else { - p_ptrn_lines = 0; - p_first = 1; - } - p_max = p_ptrn_lines + 6; /* we need this much at least */ - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - p_max = hunkmax; - break; - case '-': - if (buf[1] != '-') - goto change_line; - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - ptrn_suffix_context = context; - if (repl_beginning - || (p_end - != p_ptrn_lines + 1 + (p_Char[p_end - 1] == '\n'))) - { - if (p_end == 1) - { - /* `Old' lines were omitted. Set up to fill - them in from `new' context lines. */ - ptrn_missing = true; - p_end = p_ptrn_lines + 1; - ptrn_prefix_context = ptrn_suffix_context = -1; - fillsrc = p_end + 1; - filldst = 1; - fillcnt = p_ptrn_lines; - } - else if (! repl_beginning) - fatal ("%s `---' at line %s; check line numbers at line %s", - (p_end <= p_ptrn_lines - ? "Premature" - : "Overdue"), - format_linenum (numbuf0, p_input_line), - format_linenum (numbuf1, p_hunk_beg)); - else if (! repl_could_be_missing) - fatal ("duplicate `---' at line %s; check line numbers at line %s", - format_linenum (numbuf0, p_input_line), - format_linenum (numbuf1, - p_hunk_beg + repl_beginning)); - else - { - repl_missing = true; - goto hunk_done; - } - } - repl_beginning = p_end; - repl_backtrack_position = file_tell (pfp); - repl_patch_line = p_input_line; - repl_context = context; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) - { - p_end--; - return -1; - } - p_Char[p_end] = '='; - for (s = buf; *s && ! ISDIGIT (*s); s++) - continue; - s = scan_linenum (s, &p_newfirst); - if (*s == ',') - { - do - { - if (!*++s) - malformed (); - } - while (! ISDIGIT (*s)); - scan_linenum (s, &p_repl_lines); - p_repl_lines += 1 - p_newfirst; - } - else if (p_newfirst) - p_repl_lines = 1; - else - { - p_repl_lines = 0; - p_newfirst = 1; - } - p_max = p_repl_lines + p_end; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - if (p_repl_lines != ptrn_copiable - && (p_prefix_context != 0 - || context != 0 - || p_repl_lines != 1)) - repl_could_be_missing = false; - context = 0; - break; - case '+': case '!': - repl_could_be_missing = false; - change_line: - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, " \n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - if (! repl_beginning) - { - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - } - else - { - if (repl_prefix_context == -1) - repl_prefix_context = context; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (s, chars_read))) { - p_end--; - return -1; - } - context = 0; - break; - case '\t': case '\n': /* assume spaces got eaten */ - s = buf; - if (*buf == '\t') { - s++; - chars_read--; - } - if (repl_beginning && repl_could_be_missing && - (!ptrn_spaces_eaten || difftype == NEW_CONTEXT_DIFF) ) { - repl_missing = true; - goto hunk_done; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf, chars_read))) { - p_end--; - return -1; - } - if (p_end != p_ptrn_lines + 1) { - ptrn_spaces_eaten |= (repl_beginning != 0); - some_context = true; - context++; - if (repl_beginning) - repl_copiable++; - else - ptrn_copiable++; - p_Char[p_end] = ' '; - } - break; - case ' ': - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, "\n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - some_context = true; - context++; - if (repl_beginning) - repl_copiable++; - else - ptrn_copiable++; - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf + 2, chars_read))) { - p_end--; - return -1; - } - break; - default: - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - malformed (); - } - } - - hunk_done: - if (p_end >=0 && !repl_beginning) - fatal ("no `---' found in patch at line %s", - format_linenum (numbuf0, pch_hunk_beg ())); - - if (repl_missing) { - - /* reset state back to just after --- */ - p_input_line = repl_patch_line; - context = repl_context; - for (p_end--; p_end > repl_beginning; p_end--) - free(p_line[p_end]); - Fseek (pfp, repl_backtrack_position, SEEK_SET); - - /* redundant 'new' context lines were omitted - set */ - /* up to fill them in from the old file context */ - fillsrc = 1; - filldst = repl_beginning+1; - fillcnt = p_repl_lines; - p_end = p_max; - } - else if (! ptrn_missing && ptrn_copiable != repl_copiable) - fatal ("context mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - else if (!some_context && fillcnt == 1) { - /* the first hunk was a null hunk with no context */ - /* and we were expecting one line -- fix it up. */ - while (filldst < p_end) { - p_line[filldst] = p_line[filldst+1]; - p_Char[filldst] = p_Char[filldst+1]; - p_len[filldst] = p_len[filldst+1]; - filldst++; - } -#if 0 - repl_beginning--; /* this doesn't need to be fixed */ -#endif - p_end--; - p_first++; /* do append rather than insert */ - fillcnt = 0; - p_ptrn_lines = 0; - } - - p_prefix_context = ((repl_prefix_context == -1 - || (ptrn_prefix_context != -1 - && ptrn_prefix_context < repl_prefix_context)) - ? ptrn_prefix_context : repl_prefix_context); - p_suffix_context = ((ptrn_suffix_context != -1 - && ptrn_suffix_context < context) - ? ptrn_suffix_context : context); - assert (p_prefix_context != -1 && p_suffix_context != -1); - - if (difftype == CONTEXT_DIFF - && (fillcnt - || (p_first > 1 - && p_prefix_context + p_suffix_context < ptrn_copiable))) { - if (verbosity == VERBOSE) - say ("%s\n%s\n%s\n", -"(Fascinating -- this is really a new-style context diff but without", -"the telltale extra asterisks on the *** line that usually indicate", -"the new style...)"); - diff_type = difftype = NEW_CONTEXT_DIFF; - } - - /* if there were omitted context lines, fill them in now */ - if (fillcnt) { - p_bfake = filldst; /* remember where not to free() */ - p_efake = filldst + fillcnt - 1; - while (fillcnt-- > 0) { - while (fillsrc <= p_end && fillsrc != repl_beginning - && p_Char[fillsrc] != ' ') - fillsrc++; - if (p_end < fillsrc || fillsrc == repl_beginning) - { - fatal ("replacement text or line numbers mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - } - p_line[filldst] = p_line[fillsrc]; - p_Char[filldst] = p_Char[fillsrc]; - p_len[filldst] = p_len[fillsrc]; - fillsrc++; filldst++; - } - while (fillsrc <= p_end && fillsrc != repl_beginning) - { - if (p_Char[fillsrc] == ' ') - fatal ("replacement text or line numbers mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - fillsrc++; - } - if (debug & 64) - printf ("fillsrc %s, filldst %s, rb %s, e+1 %s\n", - format_linenum (numbuf0, fillsrc), - format_linenum (numbuf1, filldst), - format_linenum (numbuf2, repl_beginning), - format_linenum (numbuf3, p_end + 1)); - assert(fillsrc==p_end+1 || fillsrc==repl_beginning); - assert(filldst==p_end+1 || filldst==repl_beginning); - } - } - else if (difftype == UNI_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - register LINENUM fillsrc; /* index of old lines */ - register LINENUM filldst; /* index of new lines */ - char ch = '\0'; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 4 - || strncmp (buf, "@@ -", 4) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = scan_linenum (buf + 4, &p_first); - if (*s == ',') - s = scan_linenum (s + 1, &p_ptrn_lines); - else - p_ptrn_lines = 1; - if (*s == ' ') s++; - if (*s != '+') - malformed (); - s = scan_linenum (s + 1, &p_newfirst); - if (*s == ',') - s = scan_linenum (s + 1, &p_repl_lines); - else - p_repl_lines = 1; - if (*s == ' ') s++; - if (*s != '@') - malformed (); - if (!p_ptrn_lines) - p_first++; /* do append rather than insert */ - if (!p_repl_lines) - p_newfirst++; - p_max = p_ptrn_lines + p_repl_lines + 1; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - fillsrc = 1; - filldst = fillsrc + p_ptrn_lines; - p_end = filldst + p_repl_lines; - sprintf (buf, "*** %s,%s ****\n", - format_linenum (numbuf0, p_first), - format_linenum (numbuf1, p_first + p_ptrn_lines - 1)); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - sprintf (buf, "--- %s,%s ----\n", - format_linenum (numbuf0, p_newfirst), - format_linenum (numbuf1, p_newfirst + p_repl_lines - 1)); - p_len[filldst] = strlen (buf); - if (! (p_line[filldst] = savestr (buf))) { - p_end = 0; - return -1; - } - p_Char[filldst++] = '='; - p_prefix_context = -1; - p_hunk_beg = p_input_line + 1; - while (fillsrc <= p_ptrn_lines || filldst <= p_end) { - chars_read = get_line (); - if (!chars_read) { - if (p_max - filldst < 3) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 2; - } else { - fatal ("unexpected end of file in patch"); - } - } - if (chars_read == (size_t) -1) - s = 0; - else if (*buf == '\t' || *buf == '\n') { - ch = ' '; /* assume the space got eaten */ - s = savebuf (buf, chars_read); - } - else { - ch = *buf; - s = savebuf (buf+1, --chars_read); - } - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - switch (ch) { - case '-': - if (fillsrc > p_ptrn_lines) { - free(s); - p_end = filldst-1; - malformed (); - } - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - break; - case '=': - ch = ' '; - /* FALL THROUGH */ - case ' ': - if (fillsrc > p_ptrn_lines) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - context++; - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - s = savebuf (s, chars_read); - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - /* FALL THROUGH */ - case '+': - if (filldst > p_end) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - chars_read -= filldst == p_end && incomplete_line (); - p_Char[filldst] = ch; - p_line[filldst] = s; - p_len[filldst++] = chars_read; - break; - default: - p_end = filldst; - malformed (); - } - if (ch != ' ') { - if (p_prefix_context == -1) - p_prefix_context = context; - context = 0; - } - }/* while */ - if (p_prefix_context == -1) - malformed (); - p_suffix_context = context; - } - else { /* normal diff--fake it up */ - char hunk_type; - register int i; - LINENUM min, max; - file_offset line_beginning = file_tell (pfp); - - p_prefix_context = p_suffix_context = 0; - chars_read = get_line (); - if (chars_read == (size_t) -1 || !chars_read || !ISDIGIT (*buf)) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = scan_linenum (buf, &p_first); - if (*s == ',') { - s = scan_linenum (s + 1, &p_ptrn_lines); - p_ptrn_lines += 1 - p_first; - } - else - p_ptrn_lines = (*s != 'a'); - hunk_type = *s; - if (hunk_type == 'a') - p_first++; /* do append rather than insert */ - s = scan_linenum (s + 1, &min); - if (*s == ',') - scan_linenum (s + 1, &max); - else - max = min; - if (hunk_type == 'd') - min++; - p_end = p_ptrn_lines + 1 + max - min + 1; - while (p_end >= hunkmax) - if (! grow_hunkmax ()) - { - p_end = -1; - return -1; - } - p_newfirst = min; - p_repl_lines = max - min + 1; - sprintf (buf, "*** %s,%s\n", - format_linenum (numbuf0, p_first), - format_linenum (numbuf1, p_first + p_ptrn_lines - 1)); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - for (i=1; i<=p_ptrn_lines; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (buf[0] != '<' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`<' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - chars_read -= 2 + (i == p_ptrn_lines && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '-'; - } - if (hunk_type == 'c') { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (! chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (*buf != '-') - fatal ("`---' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - } - sprintf (buf, "--- %s,%s\n", - format_linenum (numbuf0, min), - format_linenum (numbuf1, max)); - p_len[i] = strlen (buf); - if (! (p_line[i] = savestr (buf))) { - p_end = i-1; - return -1; - } - p_Char[i] = '='; - for (i++; i<=p_end; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (buf[0] != '>' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`>' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - chars_read -= 2 + (i == p_end && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '+'; - } - } - if (rev) /* backwards patch? */ - if (!pch_swap()) - say ("Not enough memory to swap next hunk!\n"); - if (debug & 2) { - LINENUM i; - char special; - - for (i=0; i <= p_end; i++) { - if (i == p_ptrn_lines) - special = '^'; - else - special = ' '; - fprintf (stderr, "%s %c %c ", format_linenum (numbuf0, i), - p_Char[i], special); - pch_write_line (i, stderr); - fflush (stderr); - } - } - if (p_end+1 < hunkmax) /* paranoia reigns supreme... */ - p_Char[p_end+1] = '^'; /* add a stopper for apply_hunk */ - return 1; -} - -static size_t -get_line (void) -{ - return pget_line (p_indent, p_rfc934_nesting, p_strip_trailing_cr, - p_pass_comments_through); -} - -/* Input a line from the patch file, worrying about indentation. - Strip up to INDENT characters' worth of leading indentation. - Then remove up to RFC934_NESTING instances of leading "- ". - If STRIP_TRAILING_CR is true, remove any trailing carriage-return. - Unless PASS_COMMENTS_THROUGH is true, ignore any resulting lines - that begin with '#'; they're comments. - Ignore any partial lines at end of input, but warn about them. - Succeed if a line was read; it is terminated by "\n\0" for convenience. - Return the number of characters read, including '\n' but not '\0'. - Return -1 if we ran out of memory. */ - -static size_t -pget_line (int indent, int rfc934_nesting, bool strip_trailing_cr, - bool pass_comments_through) -{ - register FILE *fp = pfp; - register int c; - register int i; - register char *b; - register size_t s; - - do - { - i = 0; - for (;;) - { - c = getc (fp); - if (c == EOF) - { - if (ferror (fp)) - read_fatal (); - return 0; - } - if (indent <= i) - break; - if (c == ' ' || c == 'X') - i++; - else if (c == '\t') - i = (i + 8) & ~7; - else - break; - } - - i = 0; - b = buf; - - while (c == '-' && 0 <= --rfc934_nesting) - { - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - if (c != ' ') - { - i = 1; - b[0] = '-'; - break; - } - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - s = bufsize; - - for (;;) - { - if (i == s - 1) - { - s *= 2; - b = realloc (b, s); - if (!b) - { - if (!using_plan_a) - memory_fatal (); - return (size_t) -1; - } - buf = b; - bufsize = s; - } - b[i++] = c; - if (c == '\n') - break; - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - p_input_line++; - } - while (*b == '#' && !pass_comments_through); - - if (strip_trailing_cr && 2 <= i && b[i - 2] == '\r') - b[i-- - 2] = '\n'; - b[i] = '\0'; - return i; - - patch_ends_in_middle_of_line: - if (ferror (fp)) - read_fatal (); - say ("patch unexpectedly ends in middle of line\n"); - return 0; -} - -static bool -incomplete_line (void) -{ - register FILE *fp = pfp; - register int c; - register file_offset line_beginning = file_tell (fp); - - if (getc (fp) == '\\') - { - while ((c = getc (fp)) != '\n' && c != EOF) - continue; - return true; - } - else - { - /* We don't trust ungetc. */ - Fseek (pfp, line_beginning, SEEK_SET); - return false; - } -} - -/* Reverse the old and new portions of the current hunk. */ - -bool -pch_swap (void) -{ - char **tp_line; /* the text of the hunk */ - size_t *tp_len; /* length of each line */ - char *tp_char; /* +, -, and ! */ - register LINENUM i; - register LINENUM n; - bool blankline = false; - register char *s; - - i = p_first; - p_first = p_newfirst; - p_newfirst = i; - - /* make a scratch copy */ - - tp_line = p_line; - tp_len = p_len; - tp_char = p_Char; - p_line = 0; /* force set_hunkmax to allocate again */ - p_len = 0; - p_Char = 0; - set_hunkmax(); - if (!p_line || !p_len || !p_Char) { - if (p_line) - free (p_line); - p_line = tp_line; - if (p_len) - free (p_len); - p_len = tp_len; - if (p_Char) - free (p_Char); - p_Char = tp_char; - return false; /* not enough memory to swap hunk! */ - } - - /* now turn the new into the old */ - - i = p_ptrn_lines + 1; - if (tp_char[i] == '\n') { /* account for possible blank line */ - blankline = true; - i++; - } - if (p_efake >= 0) { /* fix non-freeable ptr range */ - if (p_efake <= i) - n = p_end - i + 1; - else - n = -i; - p_efake += n; - p_bfake += n; - } - for (n=0; i <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '+') - p_Char[n] = '-'; - p_len[n] = tp_len[i]; - } - if (blankline) { - i = p_ptrn_lines + 1; - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - p_len[n] = tp_len[i]; - n++; - } - assert(p_Char[0] == '='); - p_Char[0] = '*'; - for (s=p_line[0]; *s; s++) - if (*s == '-') - *s = '*'; - - /* now turn the old into the new */ - - assert(tp_char[0] == '*'); - tp_char[0] = '='; - for (s=tp_line[0]; *s; s++) - if (*s == '*') - *s = '-'; - for (i=0; n <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '-') - p_Char[n] = '+'; - p_len[n] = tp_len[i]; - } - assert(i == p_ptrn_lines + 1); - i = p_ptrn_lines; - p_ptrn_lines = p_repl_lines; - p_repl_lines = i; - if (tp_line) - free (tp_line); - if (tp_len) - free (tp_len); - if (tp_char) - free (tp_char); - return true; -} - -/* Return whether file WHICH (false = old, true = new) appears to nonexistent. - Return 1 for empty, 2 for nonexistent. */ - -int -pch_says_nonexistent (bool which) -{ - return p_says_nonexistent[which]; -} - -/* Return timestamp of patch header for file WHICH (false = old, true = new), - or -1 if there was no timestamp or an error in the timestamp. */ - -time_t -pch_timestamp (bool which) -{ - return p_timestamp[which]; -} - -/* Return the specified line position in the old file of the old context. */ - -LINENUM -pch_first (void) -{ - return p_first; -} - -/* Return the number of lines of old context. */ - -LINENUM -pch_ptrn_lines (void) -{ - return p_ptrn_lines; -} - -/* Return the probable line position in the new file of the first line. */ - -LINENUM -pch_newfirst (void) -{ - return p_newfirst; -} - -/* Return the number of lines in the replacement text including context. */ - -LINENUM -pch_repl_lines (void) -{ - return p_repl_lines; -} - -/* Return the number of lines in the whole hunk. */ - -LINENUM -pch_end (void) -{ - return p_end; -} - -/* Return the number of context lines before the first changed line. */ - -LINENUM -pch_prefix_context (void) -{ - return p_prefix_context; -} - -/* Return the number of context lines after the last changed line. */ - -LINENUM -pch_suffix_context (void) -{ - return p_suffix_context; -} - -/* Return the length of a particular patch line. */ - -size_t -pch_line_len (LINENUM line) -{ - return p_len[line]; -} - -/* Return the control character (+, -, *, !, etc) for a patch line. */ - -char -pch_char (LINENUM line) -{ - return p_Char[line]; -} - -/* Return a pointer to a particular patch line. */ - -char * -pfetch (LINENUM line) -{ - return p_line[line]; -} - -/* Output a patch line. */ - -bool -pch_write_line (LINENUM line, FILE *file) -{ - bool after_newline = p_line[line][p_len[line] - 1] == '\n'; - if (! fwrite (p_line[line], sizeof (*p_line[line]), p_len[line], file)) - write_fatal (); - return after_newline; -} - -/* Return where in the patch file this hunk began, for error messages. */ - -LINENUM -pch_hunk_beg (void) -{ - return p_hunk_beg; -} - -/* Is the newline-terminated line a valid `ed' command for patch - input? If so, return the command character; if not, return 0. - This accepts accepts just a subset of the valid commands, but it's - good enough in practice. */ - -static char -get_ed_command_letter (char const *line) -{ - char const *p = line; - char letter; - bool pair = false; - if (! ISDIGIT (*p)) - return 0; - while (ISDIGIT (*++p)) - continue; - if (*p == ',') - { - if (! ISDIGIT (*++p)) - return 0; - while (ISDIGIT (*++p)) - continue; - pair = true; - } - letter = *p++; - - switch (letter) - { - case 'a': - case 'i': - if (pair) - return 0; - break; - - case 'c': - case 'd': - break; - - case 's': - if (strncmp (p, "/.//", 4) != 0) - return 0; - p += 4; - break; - - default: - return 0; - } - - while (*p == ' ' || *p == '\t') - p++; - if (*p == '\n') - return letter; - return 0; -} - -/* Apply an ed script by feeding ed itself. */ - -void -do_ed_script (FILE *ofp) -{ - static char const ed_program[] = ed_PROGRAM; - - register file_offset beginning_of_this_line; - register FILE *pipefp = 0; - register size_t chars_read; - - if (! dry_run && ! skip_rest_of_patch) { - int exclusive = TMPOUTNAME_needs_removal ? 0 : O_EXCL; - assert (! inerrno); - TMPOUTNAME_needs_removal = 1; - copy_file (inname, TMPOUTNAME, exclusive, instat.st_mode); - sprintf (buf, "%s %s%s", ed_program, verbosity == VERBOSE ? "" : "- ", - TMPOUTNAME); - fflush (stdout); - pipefp = popen(buf, binary_transput ? "wb" : "w"); - if (!pipefp) - pfatal ("Can't open pipe to %s", quotearg (buf)); - } - for (;;) { - char ed_command_letter; - beginning_of_this_line = file_tell (pfp); - chars_read = get_line (); - if (! chars_read) { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - ed_command_letter = get_ed_command_letter (buf); - if (ed_command_letter) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (ed_command_letter != 'd' && ed_command_letter != 's') { - p_pass_comments_through = true; - while ((chars_read = get_line ()) != 0) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (chars_read == 2 && strEQ (buf, ".\n")) - break; - } - p_pass_comments_through = false; - } - } - else { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - } - if (!pipefp) - return; - if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0 - || fflush (pipefp) != 0) - write_fatal (); - if (pclose (pipefp) != 0) - fatal ("%s FAILED", ed_program); - - if (ofp) - { - FILE *ifp = fopen (TMPOUTNAME, binary_transput ? "rb" : "r"); - int c; - if (!ifp) - pfatal ("can't open `%s'", TMPOUTNAME); - while ((c = getc (ifp)) != EOF) - if (putc (c, ofp) == EOF) - write_fatal (); - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - } -} Property changes on: vendor/misc-GNU/patch/2.5.9/pch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/xmalloc.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/xmalloc.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/xmalloc.c (nonexistent) @@ -1,113 +0,0 @@ -/* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#if STDC_HEADERS -# include -#else -void *calloc (); -void *malloc (); -void *realloc (); -void free (); -#endif - -#include "gettext.h" -#define _(msgid) gettext (msgid) -#define N_(msgid) msgid - -#include "error.h" -#include "xalloc.h" - -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -/* The following tests require AC_PREREQ(2.54). */ - -#ifndef HAVE_MALLOC -"you must run the autoconf test for a GNU libc compatible malloc" -#endif - -#ifndef HAVE_REALLOC -"you must run the autoconf test for a GNU libc compatible realloc" -#endif - -/* Exit value when the requested amount of memory is not available. - The caller may set it to some other value. */ -int xalloc_exit_failure = EXIT_FAILURE; - -/* If non NULL, call this function when memory is exhausted. */ -void (*xalloc_fail_func) PARAMS ((void)) = 0; - -/* If XALLOC_FAIL_FUNC is NULL, or does return, display this message - before exiting when memory is exhausted. Goes through gettext. */ -char const xalloc_msg_memory_exhausted[] = N_("memory exhausted"); - -void -xalloc_die (void) -{ - if (xalloc_fail_func) - (*xalloc_fail_func) (); - error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); - /* The `noreturn' cannot be given to error, since it may return if - its first argument is 0. To help compilers understand the - xalloc_die does terminate, call exit. */ - exit (EXIT_FAILURE); -} - -/* Allocate N bytes of memory dynamically, with error checking. */ - -void * -xmalloc (size_t n) -{ - void *p; - - p = malloc (n); - if (p == 0) - xalloc_die (); - return p; -} - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. */ - -void * -xrealloc (void *p, size_t n) -{ - p = realloc (p, n); - if (p == 0) - xalloc_die (); - return p; -} - -/* Allocate memory for N elements of S bytes, with error checking. */ - -void * -xcalloc (size_t n, size_t s) -{ - void *p; - - p = calloc (n, s); - if (p == 0) - xalloc_die (); - return p; -} Property changes on: vendor/misc-GNU/patch/2.5.9/xmalloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/INSTALL =================================================================== --- vendor/misc-GNU/patch/2.5.9/INSTALL (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/INSTALL (nonexistent) @@ -1,228 +0,0 @@ -Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for variables by setting -them in the environment. You can do that on the command line like this: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - Property changes on: vendor/misc-GNU/patch/2.5.9/INSTALL ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/pch.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/pch.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/pch.h (nonexistent) @@ -1,45 +0,0 @@ -/* reading patches */ - -/* $Id: pch.h,v 1.11 2003/05/20 13:56:03 eggert Exp $ */ - -/* Copyright (C) 1986, 1987, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -LINENUM pch_end (void); -LINENUM pch_first (void); -LINENUM pch_hunk_beg (void); -LINENUM pch_newfirst (void); -LINENUM pch_prefix_context (void); -LINENUM pch_ptrn_lines (void); -LINENUM pch_repl_lines (void); -LINENUM pch_suffix_context (void); -bool pch_swap (void); -bool pch_write_line (LINENUM, FILE *); -bool there_is_another_patch (void); -char *pfetch (LINENUM); -char pch_char (LINENUM); -int another_hunk (enum diff, bool); -int pch_says_nonexistent (bool); -size_t pch_line_len (LINENUM); -time_t pch_timestamp (bool); -void do_ed_script (FILE *); -void open_patch_file (char const *); -void re_patch (void); -void set_hunkmax (void); Property changes on: vendor/misc-GNU/patch/2.5.9/pch.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/unlocked-io.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/unlocked-io.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/unlocked-io.h (nonexistent) @@ -1,90 +0,0 @@ -/* Prefer faster, non-thread-safe stdio functions if available. - - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* Written by Jim Meyering. */ - -#ifndef UNLOCKED_IO_H -# define UNLOCKED_IO_H 1 - -# ifndef USE_UNLOCKED_IO -# define USE_UNLOCKED_IO 1 -# endif - -# if USE_UNLOCKED_IO - -/* These are wrappers for functions/macros from GNU libc. - The standard I/O functions are thread-safe. These *_unlocked ones are - more efficient but not thread-safe. That they're not thread-safe is - fine since all of the applications in this package are single threaded. */ - -# if HAVE_DECL_CLEARERR_UNLOCKED -# undef clearerr -# define clearerr(x) clearerr_unlocked (x) -# endif -# if HAVE_DECL_FEOF_UNLOCKED -# undef feof -# define feof(x) feof_unlocked (x) -# endif -# if HAVE_DECL_FERROR_UNLOCKED -# undef ferror -# define ferror(x) ferror_unlocked (x) -# endif -# if HAVE_DECL_FFLUSH_UNLOCKED -# undef fflush -# define fflush(x) fflush_unlocked (x) -# endif -# if HAVE_DECL_FGETS_UNLOCKED -# undef fgets -# define fgets(x,y,z) fgets_unlocked (x,y,z) -# endif -# if HAVE_DECL_FPUTC_UNLOCKED -# undef fputc -# define fputc(x,y) fputc_unlocked (x,y) -# endif -# if HAVE_DECL_FPUTS_UNLOCKED -# undef fputs -# define fputs(x,y) fputs_unlocked (x,y) -# endif -# if HAVE_DECL_FREAD_UNLOCKED -# undef fread -# define fread(w,x,y,z) fread_unlocked (w,x,y,z) -# endif -# if HAVE_DECL_FWRITE_UNLOCKED -# undef fwrite -# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) -# endif -# if HAVE_DECL_GETC_UNLOCKED -# undef getc -# define getc(x) getc_unlocked (x) -# endif -# if HAVE_DECL_GETCHAR_UNLOCKED -# undef getchar -# define getchar() getchar_unlocked () -# endif -# if HAVE_DECL_PUTC_UNLOCKED -# undef putc -# define putc(x,y) putc_unlocked (x,y) -# endif -# if HAVE_DECL_PUTCHAR_UNLOCKED -# undef putchar -# define putchar(x) putchar_unlocked (x) -# endif - -# endif /* USE_UNLOCKED_IO */ -#endif /* UNLOCKED_IO_H */ Property changes on: vendor/misc-GNU/patch/2.5.9/unlocked-io.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/basename.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/basename.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/basename.c (nonexistent) @@ -1,79 +0,0 @@ -/* basename.c -- return the last element in a path - Copyright (C) 1990, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#endif -#include "dirname.h" - -/* In general, we can't use the builtin `basename' function if available, - since it has different meanings in different environments. - In some environments the builtin `basename' modifies its argument. - - Return the address of the last file name component of NAME. If - NAME has no file name components because it is all slashes, return - NAME if it is empty, the address of its last slash otherwise. */ - -char * -base_name (char const *name) -{ - char const *base = name + FILESYSTEM_PREFIX_LEN (name); - char const *p; - - for (p = base; *p; p++) - { - if (ISSLASH (*p)) - { - /* Treat multiple adjacent slashes like a single slash. */ - do p++; - while (ISSLASH (*p)); - - /* If the file name ends in slash, use the trailing slash as - the basename if no non-slashes have been found. */ - if (! *p) - { - if (ISSLASH (*base)) - base = p - 1; - break; - } - - /* *P is a non-slash preceded by a slash. */ - base = p; - } - } - - return (char *) base; -} - -/* Return the length of of the basename NAME. Typically NAME is the - value returned by base_name. Act like strlen (NAME), except omit - redundant trailing slashes. */ - -size_t -base_len (char const *name) -{ - size_t len; - - for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) - continue; - - return len; -} Property changes on: vendor/misc-GNU/patch/2.5.9/basename.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/config.hin =================================================================== --- vendor/misc-GNU/patch/2.5.9/config.hin (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/config.hin (nonexistent) @@ -1,365 +0,0 @@ -/* config.hin. Generated from configure.ac by autoheader. */ - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define if there is a member named d_ino in the struct describing directory - headers. */ -#undef D_INO_IN_DIRENT - -/* Define on systems for which file names may have a so-called `drive letter' - prefix, define this to compute the length of that prefix, including the - colon. */ -#undef FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX - -/* Define if the backslash character may also serve as a file name component - separator. */ -#undef FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR - -#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif - -/* Define to 1 if you have the header file. */ -#undef HAVE_BP_SYM_H - -/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_CLEARERR_UNLOCKED - -/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_FEOF_UNLOCKED - -/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FERROR_UNLOCKED - -/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FFLUSH_UNLOCKED - -/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FGETS_UNLOCKED - -/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FPUTC_UNLOCKED - -/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FPUTS_UNLOCKED - -/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FREAD_UNLOCKED - -/* Define to 1 if you have the declaration of `free', and to 0 if you don't. - */ -#undef HAVE_DECL_FREE - -/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FWRITE_UNLOCKED - -/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_GETCHAR_UNLOCKED - -/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_GETC_UNLOCKED - -/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. - */ -#undef HAVE_DECL_GETENV - -/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. - */ -#undef HAVE_DECL_MALLOC - -/* Define to 1 if you have the declaration of `mktemp', and to 0 if you don't. - */ -#undef HAVE_DECL_MKTEMP - -/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_PUTCHAR_UNLOCKED - -/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_PUTC_UNLOCKED - -/* Define to 1 if you have the declaration of `strerror', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `getuid' function. */ -#undef HAVE_GETUID - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `isascii' function. */ -#undef HAVE_ISASCII - -/* Define to 1 if you have the `iswprint' function. */ -#undef HAVE_ISWPRINT - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you support file names longer than 14 characters. */ -#undef HAVE_LONG_FILE_NAMES - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ -#undef HAVE_MBRTOWC - -/* Define to 1 if you have the `mbsinit' function. */ -#undef HAVE_MBSINIT - -/* Define to 1 if declares mbstate_t. */ -#undef HAVE_MBSTATE_T - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memcmp' function. */ -#undef HAVE_MEMCMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have the `mktemp' function. */ -#undef HAVE_MKTEMP - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `pathconf' function. */ -#undef HAVE_PATHCONF - -/* Define to 1 if you have the `raise' function. */ -#undef HAVE_RAISE - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the DOS-style `setmode' function. */ -#undef HAVE_SETMODE_DOS - -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if you have the `sigprocmask' function. */ -#undef HAVE_SIGPROCMASK - -/* Define to 1 if you have the `sigsetmask' function. */ -#undef HAVE_SIGSETMASK - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strncasecmp' function. */ -#undef HAVE_STRNCASECMP - -/* Define if struct utimbuf is declared -- usually in . Some systems - have utime.h but don't declare the struct anywhere. */ -#undef HAVE_STRUCT_UTIMBUF - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VARARGS_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCTYPE_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if you have the `_doprintf' function. */ -#undef HAVE__DOPRINTF - -#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif - -/* Define if mkdir takes only one argument. */ -#undef MKDIR_TAKES_ONE_ARG - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to a type if does not define. */ -#undef mbstate_t - -/* Define to `int' if does not define. */ -#undef mode_t - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `unsigned' if does not define. */ -#undef size_t Index: vendor/misc-GNU/patch/2.5.9/configure.ac =================================================================== --- vendor/misc-GNU/patch/2.5.9/configure.ac (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/configure.ac (nonexistent) @@ -1,95 +0,0 @@ -# Configure `patch'. - -# Copyright (C) 1993, 1997, 1998, 1999, 2002, 2003 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_PREREQ(2.57) -AC_INIT(patch, 2.5.9, bug-patch@gnu.org) -AC_CONFIG_SRCDIR(patch.c) -AC_CONFIG_HEADER(config.h:config.hin) -AC_ARG_PROGRAM - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_MAKE_SET -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -AC_PATH_PROG(ed_PROGRAM, ed, ed) - -AC_GNU_SOURCE -AC_AIX -AC_MINIX -AC_PROG_CC_STDC -AC_ISC_POSIX -AC_SYS_LARGEFILE -AC_EXEEXT - -AC_C_PROTOTYPES -AC_C_CONST - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h string.h unistd.h utime.h varargs.h) - -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIGNAL -AC_TYPE_SIZE_T -AM_STDBOOL_H -jm_CHECK_TYPE_STRUCT_UTIMBUF - -gl_BACKUPFILE -gl_DIRNAME -gl_ERROR -gl_FUNC_MEMCHR -gl_FUNC_RMDIR -gl_GETOPT -gl_PREREQ_XMALLOC -gl_QUOTE -gl_QUOTEARG - -dnl This should be in gnulib, but isn't for some reason. -AC_DEFUN([jm_PREREQ_ADDEXT], -[ - dnl For addext.c. - AC_REQUIRE([AC_SYS_LONG_FILE_NAMES]) - AC_CHECK_FUNCS(pathconf) - AC_CHECK_HEADERS(limits.h string.h unistd.h) -]) -jm_PREREQ_ADDEXT - -AC_CHECK_DECLS([free, getenv, malloc, mktemp]) -AC_CHECK_FUNCS(_doprintf geteuid getuid isascii memcmp mktemp \ - pathconf raise sigaction sigprocmask sigsetmask strerror) -AC_REPLACE_FUNCS(mkdir strncasecmp) -AC_FUNC_FSEEKO -jm_FUNC_GLIBC_UNLOCKED_IO -jm_FUNC_MALLOC -jm_FUNC_REALLOC -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_SETMODE_DOS -AC_FUNC_VPRINTF -PATCH_FUNC_MKDIR_TAKES_ONE_ARG - -jm_AC_DOS -AC_SYS_LONG_FILE_NAMES - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT Index: vendor/misc-GNU/patch/2.5.9/version.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/version.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/version.c (nonexistent) @@ -1,29 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.c,v 1.13 2003/05/18 08:25:17 eggert Exp $ */ - -#define XTERN extern -#include -#undef XTERN -#define XTERN -#include - -static char const copyright_string[] = "\ -Copyright (C) 1988 Larry Wall\n\ -Copyright (C) 2003 Free Software Foundation, Inc."; - -static char const free_software_msgid[] = "\ -This program comes with NO WARRANTY, to the extent permitted by law.\n\ -You may redistribute copies of this program\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the file named COPYING."; - -static char const authorship_msgid[] = "\ -written by Larry Wall and Paul Eggert"; - -void -version (void) -{ - printf ("%s %s\n%s\n\n%s\n\n%s\n", PACKAGE_NAME, PACKAGE_VERSION, - copyright_string, free_software_msgid, authorship_msgid); -} Property changes on: vendor/misc-GNU/patch/2.5.9/version.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/dirname.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/dirname.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/dirname.c (nonexistent) @@ -1,121 +0,0 @@ -/* dirname.c -- return all but the last element in a path - Copyright 1990, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#endif - -#include "dirname.h" -#include "xalloc.h" - -/* Return the length of `dirname (PATH)', or zero if PATH is - in the working directory. Works properly even if - there are trailing slashes (by effectively ignoring them). */ -size_t -dir_len (char const *path) -{ - size_t prefix_length = FILESYSTEM_PREFIX_LEN (path); - size_t length; - - /* Strip the basename and any redundant slashes before it. */ - for (length = base_name (path) - path; prefix_length < length; length--) - if (! ISSLASH (path[length - 1])) - return length; - - /* But don't strip the only slash from "/". */ - return prefix_length + ISSLASH (path[prefix_length]); -} - -/* Return the leading directories part of PATH, - allocated with xmalloc. - Works properly even if there are trailing slashes - (by effectively ignoring them). */ - -char * -dir_name (char const *path) -{ - size_t length = dir_len (path); - int append_dot = (length == FILESYSTEM_PREFIX_LEN (path)); - char *newpath = xmalloc (length + append_dot + 1); - memcpy (newpath, path, length); - if (append_dot) - newpath[length++] = '.'; - newpath[length] = 0; - return newpath; -} - -#ifdef TEST_DIRNAME -/* - -Run the test like this (expect no output): - gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \ - basename.c dirname.c xmalloc.c error.c - sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out - -If it's been built on a DOS or Windows platforms, run another test like -this (again, expect no output): - sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out - -BEGIN-DATA -foo//// . -bar/foo//// bar -foo/ . -/ / -. . -a . -END-DATA - -BEGIN-DOS-DATA -c:///// c:/ -c:/ c:/ -c:/. c:/ -c:foo c:. -c:foo/bar c:foo -END-DOS-DATA - -*/ - -# define MAX_BUFF_LEN 1024 -# include - -char *program_name; - -int -main (int argc, char *argv[]) -{ - char buff[MAX_BUFF_LEN + 1]; - - program_name = argv[0]; - - buff[MAX_BUFF_LEN] = 0; - while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0]) - { - char path[MAX_BUFF_LEN]; - char expected_result[MAX_BUFF_LEN]; - char const *result; - sscanf (buff, "%s %s", path, expected_result); - result = dir_name (path); - if (strcmp (result, expected_result)) - printf ("%s: got %s, expected %s\n", path, result, expected_result); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/dirname.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/version.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/version.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/version.h (nonexistent) @@ -1,5 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.h,v 1.5 2002/05/28 07:24:05 eggert Exp $ */ - -void version (void); Property changes on: vendor/misc-GNU/patch/2.5.9/version.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quotearg.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/quotearg.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quotearg.c (nonexistent) @@ -1,630 +0,0 @@ -/* quotearg.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include "quotearg.h" - -#include "xalloc.h" - -#include -#include -#include -#include -#include - -#include "gettext.h" -#define _(msgid) gettext (msgid) -#define N_(msgid) msgid - -#if HAVE_WCHAR_H - -/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */ -# include -# include - -# include -#endif - -#if !HAVE_MBRTOWC -/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the - other macros are defined only for documentation and to satisfy C - syntax. */ -# undef MB_CUR_MAX -# define MB_CUR_MAX 1 -# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) -# define iswprint(wc) isprint ((unsigned char) (wc)) -# undef HAVE_MBSINIT -#endif - -#if !defined mbsinit && !HAVE_MBSINIT -# define mbsinit(ps) 1 -#endif - -#ifndef iswprint -# if HAVE_WCTYPE_H -# include -# endif -# if !defined iswprint && !HAVE_ISWPRINT -# define iswprint(wc) 1 -# endif -#endif - -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - -#define INT_BITS (sizeof (int) * CHAR_BIT) - -struct quoting_options -{ - /* Basic quoting style. */ - enum quoting_style style; - - /* Quote the characters indicated by this bit vector even if the - quoting style would not normally require them to be quoted. */ - int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; -}; - -/* Names of quoting styles. */ -char const *const quoting_style_args[] = -{ - "literal", - "shell", - "shell-always", - "c", - "escape", - "locale", - "clocale", - 0 -}; - -/* Correspondences to quoting style names. */ -enum quoting_style const quoting_style_vals[] = -{ - literal_quoting_style, - shell_quoting_style, - shell_always_quoting_style, - c_quoting_style, - escape_quoting_style, - locale_quoting_style, - clocale_quoting_style -}; - -/* The default quoting options. */ -static struct quoting_options default_quoting_options; - -/* Allocate a new set of quoting options, with contents initially identical - to O if O is not null, or to the default if O is null. - It is the caller's responsibility to free the result. */ -struct quoting_options * -clone_quoting_options (struct quoting_options *o) -{ - int e = errno; - struct quoting_options *p = xmalloc (sizeof *p); - *p = *(o ? o : &default_quoting_options); - errno = e; - return p; -} - -/* Get the value of O's quoting style. If O is null, use the default. */ -enum quoting_style -get_quoting_style (struct quoting_options *o) -{ - return (o ? o : &default_quoting_options)->style; -} - -/* In O (or in the default if O is null), - set the value of the quoting style to S. */ -void -set_quoting_style (struct quoting_options *o, enum quoting_style s) -{ - (o ? o : &default_quoting_options)->style = s; -} - -/* In O (or in the default if O is null), - set the value of the quoting options for character C to I. - Return the old value. Currently, the only values defined for I are - 0 (the default) and 1 (which means to quote the character even if - it would not otherwise be quoted). */ -int -set_char_quoting (struct quoting_options *o, char c, int i) -{ - unsigned char uc = c; - int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; - int shift = uc % INT_BITS; - int r = (*p >> shift) & 1; - *p ^= ((i & 1) ^ r) << shift; - return r; -} - -/* MSGID approximates a quotation mark. Return its translation if it - has one; otherwise, return either it or "\"", depending on S. */ -static char const * -gettext_quote (char const *msgid, enum quoting_style s) -{ - char const *translation = _(msgid); - if (translation == msgid && s == clocale_quoting_style) - translation = "\""; - return translation; -} - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using QUOTING_STYLE and the - non-quoting-style part of O to control quoting. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. - - This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG, - ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting - style specified by O, and O may not be null. */ - -static size_t -quotearg_buffer_restyled (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - enum quoting_style quoting_style, - struct quoting_options const *o) -{ - size_t i; - size_t len = 0; - char const *quote_string = 0; - size_t quote_string_len = 0; - int backslash_escapes = 0; - int unibyte_locale = MB_CUR_MAX == 1; - -#define STORE(c) \ - do \ - { \ - if (len < buffersize) \ - buffer[len] = (c); \ - len++; \ - } \ - while (0) - - switch (quoting_style) - { - case c_quoting_style: - STORE ('"'); - backslash_escapes = 1; - quote_string = "\""; - quote_string_len = 1; - break; - - case escape_quoting_style: - backslash_escapes = 1; - break; - - case locale_quoting_style: - case clocale_quoting_style: - { - /* Get translations for open and closing quotation marks. - - The message catalog should translate "`" to a left - quotation mark suitable for the locale, and similarly for - "'". If the catalog has no translation, - locale_quoting_style quotes `like this', and - clocale_quoting_style quotes "like this". - - For example, an American English Unicode locale should - translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and - should translate "'" to U+201D (RIGHT DOUBLE QUOTATION - MARK). A British English Unicode locale should instead - translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and - U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. */ - - char const *left = gettext_quote (N_("`"), quoting_style); - char const *right = gettext_quote (N_("'"), quoting_style); - for (quote_string = left; *quote_string; quote_string++) - STORE (*quote_string); - backslash_escapes = 1; - quote_string = right; - quote_string_len = strlen (quote_string); - } - break; - - case shell_always_quoting_style: - STORE ('\''); - quote_string = "'"; - quote_string_len = 1; - break; - - default: - break; - } - - for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) - { - unsigned char c; - unsigned char esc; - - if (backslash_escapes - && quote_string_len - && i + quote_string_len <= argsize - && memcmp (arg + i, quote_string, quote_string_len) == 0) - STORE ('\\'); - - c = arg[i]; - switch (c) - { - case '\0': - if (backslash_escapes) - { - STORE ('\\'); - STORE ('0'); - STORE ('0'); - c = '0'; - } - break; - - case '?': - switch (quoting_style) - { - case shell_quoting_style: - goto use_shell_always_quoting_style; - - case c_quoting_style: - if (i + 2 < argsize && arg[i + 1] == '?') - switch (arg[i + 2]) - { - case '!': case '\'': - case '(': case ')': case '-': case '/': - case '<': case '=': case '>': - /* Escape the second '?' in what would otherwise be - a trigraph. */ - c = arg[i + 2]; - i += 2; - STORE ('?'); - STORE ('\\'); - STORE ('?'); - break; - } - break; - - default: - break; - } - break; - - case '\a': esc = 'a'; goto c_escape; - case '\b': esc = 'b'; goto c_escape; - case '\f': esc = 'f'; goto c_escape; - case '\n': esc = 'n'; goto c_and_shell_escape; - case '\r': esc = 'r'; goto c_and_shell_escape; - case '\t': esc = 't'; goto c_and_shell_escape; - case '\v': esc = 'v'; goto c_escape; - case '\\': esc = c; goto c_and_shell_escape; - - c_and_shell_escape: - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; - c_escape: - if (backslash_escapes) - { - c = esc; - goto store_escape; - } - break; - - case '#': case '~': - if (i != 0) - break; - /* Fall through. */ - case ' ': - case '!': /* special in bash */ - case '"': case '$': case '&': - case '(': case ')': case '*': case ';': - case '<': case '>': case '[': - case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */ - case '`': case '|': - /* A shell special character. In theory, '$' and '`' could - be the first bytes of multibyte characters, which means - we should check them with mbrtowc, but in practice this - doesn't happen so it's not worth worrying about. */ - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; - break; - - case '\'': - switch (quoting_style) - { - case shell_quoting_style: - goto use_shell_always_quoting_style; - - case shell_always_quoting_style: - STORE ('\''); - STORE ('\\'); - STORE ('\''); - break; - - default: - break; - } - break; - - case '%': case '+': case ',': case '-': case '.': case '/': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': case ':': case '=': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': case ']': case '_': case 'a': case 'b': - case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': - case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': - case 'o': case 'p': case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': - case '{': case '}': - /* These characters don't cause problems, no matter what the - quoting style is. They cannot start multibyte sequences. */ - break; - - default: - /* If we have a multibyte sequence, copy it until we reach - its end, find an error, or come back to the initial shift - state. For C-like styles, if the sequence has - unprintable characters, escape the whole sequence, since - we can't easily escape single characters within it. */ - { - /* Length of multibyte sequence found so far. */ - size_t m; - - int printable; - - if (unibyte_locale) - { - m = 1; - printable = isprint (c); - } - else - { - mbstate_t mbstate; - memset (&mbstate, 0, sizeof mbstate); - - m = 0; - printable = 1; - if (argsize == SIZE_MAX) - argsize = strlen (arg); - - do - { - wchar_t w; - size_t bytes = mbrtowc (&w, &arg[i + m], - argsize - (i + m), &mbstate); - if (bytes == 0) - break; - else if (bytes == (size_t) -1) - { - printable = 0; - break; - } - else if (bytes == (size_t) -2) - { - printable = 0; - while (i + m < argsize && arg[i + m]) - m++; - break; - } - else - { - if (! iswprint (w)) - printable = 0; - m += bytes; - } - } - while (! mbsinit (&mbstate)); - } - - if (1 < m || (backslash_escapes && ! printable)) - { - /* Output a multibyte sequence, or an escaped - unprintable unibyte character. */ - size_t ilim = i + m; - - for (;;) - { - if (backslash_escapes && ! printable) - { - STORE ('\\'); - STORE ('0' + (c >> 6)); - STORE ('0' + ((c >> 3) & 7)); - c = '0' + (c & 7); - } - if (ilim <= i + 1) - break; - STORE (c); - c = arg[++i]; - } - - goto store_c; - } - } - } - - if (! (backslash_escapes - && o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) - goto store_c; - - store_escape: - STORE ('\\'); - - store_c: - STORE (c); - } - - if (quote_string) - for (; *quote_string; quote_string++) - STORE (*quote_string); - - if (len < buffersize) - buffer[len] = '\0'; - return len; - - use_shell_always_quoting_style: - return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - shell_always_quoting_style, o); -} - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using O to control quoting. - If O is null, use the default. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ -size_t -quotearg_buffer (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - struct quoting_options const *o) -{ - struct quoting_options const *p = o ? o : &default_quoting_options; - int e = errno; - size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - p->style, p); - errno = e; - return r; -} - -/* Use storage slot N to return a quoted version of argument ARG. - ARG is of size ARGSIZE, but if that is -1, ARG is a null-terminated string. - OPTIONS specifies the quoting options. - The returned value points to static storage that can be - reused by the next call to this function with the same value of N. - N must be nonnegative. N is deliberately declared with type "int" - to allow for future extensions (using negative values). */ -static char * -quotearg_n_options (int n, char const *arg, size_t argsize, - struct quoting_options const *options) -{ - int e = errno; - - /* Preallocate a slot 0 buffer, so that the caller can always quote - one small component of a "memory exhausted" message in slot 0. */ - static char slot0[256]; - static unsigned int nslots = 1; - unsigned int n0 = n; - struct slotvec - { - size_t size; - char *val; - }; - static struct slotvec slotvec0 = {sizeof slot0, slot0}; - static struct slotvec *slotvec = &slotvec0; - - if (n < 0) - abort (); - - if (nslots <= n0) - { - unsigned int n1 = n0 + 1; - size_t s = n1 * sizeof *slotvec; - - if (SIZE_MAX / UINT_MAX <= sizeof *slotvec - && n1 != s / sizeof *slotvec) - xalloc_die (); - - if (slotvec == &slotvec0) - { - slotvec = xmalloc (sizeof *slotvec); - *slotvec = slotvec0; - } - slotvec = xrealloc (slotvec, s); - memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec); - nslots = n1; - } - - { - size_t size = slotvec[n].size; - char *val = slotvec[n].val; - size_t qsize = quotearg_buffer (val, size, arg, argsize, options); - - if (size <= qsize) - { - slotvec[n].size = size = qsize + 1; - slotvec[n].val = val = xrealloc (val == slot0 ? 0 : val, size); - quotearg_buffer (val, size, arg, argsize, options); - } - - errno = e; - return val; - } -} - -char * -quotearg_n (int n, char const *arg) -{ - return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options); -} - -char * -quotearg (char const *arg) -{ - return quotearg_n (0, arg); -} - -/* Return quoting options for STYLE, with no extra quoting. */ -static struct quoting_options -quoting_options_from_style (enum quoting_style style) -{ - struct quoting_options o; - o.style = style; - memset (o.quote_these_too, 0, sizeof o.quote_these_too); - return o; -} - -char * -quotearg_n_style (int n, enum quoting_style s, char const *arg) -{ - struct quoting_options const o = quoting_options_from_style (s); - return quotearg_n_options (n, arg, SIZE_MAX, &o); -} - -char * -quotearg_n_style_mem (int n, enum quoting_style s, - char const *arg, size_t argsize) -{ - struct quoting_options const o = quoting_options_from_style (s); - return quotearg_n_options (n, arg, argsize, &o); -} - -char * -quotearg_style (enum quoting_style s, char const *arg) -{ - return quotearg_n_style (0, s, arg); -} - -char * -quotearg_char (char const *arg, char ch) -{ - struct quoting_options options; - options = default_quoting_options; - set_char_quoting (&options, ch, 1); - return quotearg_n_options (0, arg, SIZE_MAX, &options); -} - -char * -quotearg_colon (char const *arg) -{ - return quotearg_char (arg, ':'); -} Property changes on: vendor/misc-GNU/patch/2.5.9/quotearg.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/dirname.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/dirname.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/dirname.h (nonexistent) @@ -1,47 +0,0 @@ -/* Copyright (C) 1998, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef DIRNAME_H_ -# define DIRNAME_H_ 1 - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -# ifndef DIRECTORY_SEPARATOR -# define DIRECTORY_SEPARATOR '/' -# endif - -# ifndef ISSLASH -# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) -# endif - -# ifndef FILESYSTEM_PREFIX_LEN -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -# endif - -char *base_name PARAMS ((char const *path)); -char *dir_name PARAMS ((char const *path)); -size_t base_len PARAMS ((char const *path)); -size_t dir_len PARAMS ((char const *path)); - -int strip_trailing_slashes PARAMS ((char *path)); - -#endif /* not DIRNAME_H_ */ Property changes on: vendor/misc-GNU/patch/2.5.9/dirname.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quotesys.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/quotesys.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quotesys.c (nonexistent) @@ -1,125 +0,0 @@ -/* Shell command argument quoting. - Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -/* Place into QUOTED a quoted version of ARG suitable for `system'. - Return the length of the resulting string (which is not null-terminated). - If QUOTED is null, return the length without any side effects. */ - -size_t -quote_system_arg (quoted, arg) - char *quoted; - char const *arg; -{ - char const *a; - size_t len = 0; - - /* Scan ARG, copying it to QUOTED if QUOTED is not null, - looking for shell metacharacters. */ - - for (a = arg; ; a++) - { - char c = *a; - switch (c) - { - case 0: - /* ARG has no shell metacharacters. */ - return len; - - case '=': - if (*arg == '-') - break; - /* Fall through. */ - case '\t': case '\n': case ' ': - case '!': case '"': case '#': case '$': case '%': case '&': case '\'': - case '(': case ')': case '*': case ';': - case '<': case '>': case '?': case '[': case '\\': - case '^': case '`': case '|': case '~': - { - /* ARG has a shell metacharacter. - Start over, quoting it this time. */ - - len = 0; - c = *arg++; - - /* If ARG is an option, quote just its argument. - This is not necessary, but it looks nicer. */ - if (c == '-' && arg < a) - { - c = *arg++; - - if (quoted) - { - quoted[len] = '-'; - quoted[len + 1] = c; - } - len += 2; - - if (c == '-') - while (arg < a) - { - c = *arg++; - if (quoted) - quoted[len] = c; - len++; - if (c == '=') - break; - } - c = *arg++; - } - - if (quoted) - quoted[len] = '\''; - len++; - - for (; c; c = *arg++) - { - if (c == '\'') - { - if (quoted) - { - quoted[len] = '\''; - quoted[len + 1] = '\\'; - quoted[len + 2] = '\''; - } - len += 3; - } - if (quoted) - quoted[len] = c; - len++; - } - - if (quoted) - quoted[len] = '\''; - return len + 1; - } - } - - if (quoted) - quoted[len] = c; - len++; - } -} Property changes on: vendor/misc-GNU/patch/2.5.9/quotesys.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quotearg.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/quotearg.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quotearg.h (nonexistent) @@ -1,114 +0,0 @@ -/* quotearg.h - quote arguments for output - - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#ifndef QUOTEARG_H_ -# define QUOTEARG_H_ 1 - -# include - -/* Basic quoting styles. */ -enum quoting_style - { - literal_quoting_style, /* --quoting-style=literal */ - shell_quoting_style, /* --quoting-style=shell */ - shell_always_quoting_style, /* --quoting-style=shell-always */ - c_quoting_style, /* --quoting-style=c */ - escape_quoting_style, /* --quoting-style=escape */ - locale_quoting_style, /* --quoting-style=locale */ - clocale_quoting_style /* --quoting-style=clocale */ - }; - -/* For now, --quoting-style=literal is the default, but this may change. */ -# ifndef DEFAULT_QUOTING_STYLE -# define DEFAULT_QUOTING_STYLE literal_quoting_style -# endif - -/* Names of quoting styles and their corresponding values. */ -extern char const *const quoting_style_args[]; -extern enum quoting_style const quoting_style_vals[]; - -struct quoting_options; - -/* The functions listed below set and use a hidden variable - that contains the default quoting style options. */ - -/* Allocate a new set of quoting options, with contents initially identical - to O if O is not null, or to the default if O is null. - It is the caller's responsibility to free the result. */ -struct quoting_options *clone_quoting_options (struct quoting_options *o); - -/* Get the value of O's quoting style. If O is null, use the default. */ -enum quoting_style get_quoting_style (struct quoting_options *o); - -/* In O (or in the default if O is null), - set the value of the quoting style to S. */ -void set_quoting_style (struct quoting_options *o, enum quoting_style s); - -/* In O (or in the default if O is null), - set the value of the quoting options for character C to I. - Return the old value. Currently, the only values defined for I are - 0 (the default) and 1 (which means to quote the character even if - it would not otherwise be quoted). */ -int set_char_quoting (struct quoting_options *o, char c, int i); - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using O to control quoting. - If O is null, use the default. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ -size_t quotearg_buffer (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - struct quoting_options const *o); - -/* Use storage slot N to return a quoted version of the string ARG. - Use the default quoting options. - The returned value points to static storage that can be - reused by the next call to this function with the same value of N. - N must be nonnegative. */ -char *quotearg_n (int n, char const *arg); - -/* Equivalent to quotearg_n (0, ARG). */ -char *quotearg (char const *arg); - -/* Use style S and storage slot N to return a quoted version of the string ARG. - This is like quotearg_n (N, ARG), except that it uses S with no other - options to specify the quoting method. */ -char *quotearg_n_style (int n, enum quoting_style s, char const *arg); - -/* Use style S and storage slot N to return a quoted version of the - argument ARG of size ARGSIZE. This is like quotearg_n_style - (N, S, ARG), except it can quote null bytes. */ -char *quotearg_n_style_mem (int n, enum quoting_style s, - char const *arg, size_t argsize); - -/* Equivalent to quotearg_n_style (0, S, ARG). */ -char *quotearg_style (enum quoting_style s, char const *arg); - -/* Like quotearg (ARG), except also quote any instances of CH. */ -char *quotearg_char (char const *arg, char ch); - -/* Equivalent to quotearg_char (ARG, ':'). */ -char *quotearg_colon (char const *arg); - -#endif /* !QUOTEARG_H_ */ Property changes on: vendor/misc-GNU/patch/2.5.9/quotearg.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/maketime.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/maketime.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/maketime.c (nonexistent) @@ -1,501 +0,0 @@ -/* Convert struct partime into time_t. */ - -/* Copyright 1992, 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -/* For maximum portability, use only localtime and gmtime. - Make no assumptions about the time_t epoch or the range of time_t values. - Avoid mktime because it's not universal and because there's no easy, - portable way for mktime to yield the inverse of gmtime. */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif - /* MIPS RISCOS4.52 defines time_t in not . */ -# include -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#include - -char const maket_id[] = - "$Id: maketime.c,v 5.17 1999/08/29 11:12:37 eggert Exp $"; - -static int isleap P ((int)); -static int month_days P ((struct tm const *)); -static time_t maketime P ((struct partime const *, time_t)); - -/* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow. - Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1. - Then this yields nonzero if overflow occurred during the addition. - Overflow occurs if A and B have the same sign, but A and SUM differ in sign. - Use `^' to test whether signs differ, and `< 0' to isolate the sign. */ -#define overflow_sum_sign(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0) - -/* Quotient and remainder when dividing A by B, - truncating towards minus infinity, where B is positive. */ -#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0)) -#define MOD(a, b) ((a) % (b) + (b) * ((a) % (b) < 0)) - -/* Number of days in 400 consecutive Gregorian years. */ -#define Y400_DAYS (365 * 400L + 100 - 4 + 1) - -/* Number of years to add to tm_year to get Gregorian year. */ -#define TM_YEAR_ORIGIN 1900 - -static int -isleap (y) - int y; -{ - return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); -} - -/* days in year before start of months 0-12 */ -static int const month_yday[] = -{ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 -}; - -/* Yield the number of days in TM's month. */ -static int -month_days (tm) - struct tm const *tm; -{ - int m = tm->tm_mon; - return (month_yday[m + 1] - month_yday[m] - + (m == 1 && isleap (tm->tm_year + TM_YEAR_ORIGIN))); -} - -/* Convert UNIXTIME to struct tm form. - Use gmtime if available and if !LOCALZONE, localtime otherwise. */ -struct tm * -time2tm (unixtime, localzone) - time_t unixtime; - int localzone; -{ - struct tm *tm; -#ifdef TZ_is_unset - static char const *TZ; - if (!TZ && !(TZ = getenv ("TZ"))) - TZ_is_unset ("The TZ environment variable is not set; please set it to your timezone"); -#endif - if (localzone || !(tm = gmtime (&unixtime))) - tm = localtime (&unixtime); - return tm; -} - -/* Yield A - B, measured in seconds. */ -time_t -difftm (a, b) - struct tm const *a; - struct tm const *b; -{ - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); - int ac = DIV (ay, 100); - int bc = DIV (by, 100); - int difference_in_day_of_year = a->tm_yday - b->tm_yday; - int intervening_leap_days = (((ay >> 2) - (by >> 2)) - - (ac - bc) - + ((ac >> 2) - (bc >> 2))); - time_t difference_in_years = ay - by; - time_t difference_in_days - = (difference_in_years * 365 - + (intervening_leap_days + difference_in_day_of_year)); - return (((((difference_in_days * 24 - + (a->tm_hour - b->tm_hour)) - * 60) - + (a->tm_min - b->tm_min)) - * 60) - + (a->tm_sec - b->tm_sec)); -} - -/* Adjust time T by adding SECONDS. - The absolute value of SECONDS cannot exceed 59 * INT_MAX, - and also cannot exceed one month's worth of seconds; - this is enough to handle any POSIX or real-life daylight-saving offset. - Adjust only T's year, mon, mday, hour, min and sec members; - plus adjust wday if it is defined. */ -void -adjzone (t, seconds) - register struct tm *t; - long seconds; -{ - int days = 0; - - /* This code can be off by a second if SECONDS is not a multiple of 60, - if T is local time, and if a leap second happens during this minute. - But this bug has never occurred, and most likely will not ever occur. - Liberia, the last country for which SECONDS % 60 was nonzero, - switched to UTC in May 1972; the first leap second was in June 1972. */ - int leap_second = t->tm_sec == 60; - long sec = seconds + (t->tm_sec - leap_second); - if (sec < 0) - { - if ((t->tm_min -= (59 - sec) / 60) < 0 - && (t->tm_hour -= (59 - t->tm_min) / 60) < 0) - { - days = - ((23 - t->tm_hour) / 24); - if ((t->tm_mday += days) <= 0) - { - if (--t->tm_mon < 0) - { - --t->tm_year; - t->tm_mon = 11; - } - t->tm_mday += month_days (t); - } - } - } - else - { - if (60 <= (t->tm_min += sec / 60) - && (24 <= (t->tm_hour += t->tm_min / 60))) - { - days = t->tm_hour / 24; - if (month_days (t) < (t->tm_mday += days)) - { - if (11 < ++t->tm_mon) - { - ++t->tm_year; - t->tm_mon = 0; - } - t->tm_mday = 1; - } - } - } - if (TM_DEFINED (t->tm_wday)) - t->tm_wday = MOD (t->tm_wday + days, 7); - t->tm_hour = MOD (t->tm_hour, 24); - t->tm_min = MOD (t->tm_min, 60); - t->tm_sec = (int) MOD (sec, 60) + leap_second; -} - -/* Convert TM to time_t, using localtime if LOCALZONE and gmtime otherwise. - Use only TM's year, mon, mday, hour, min, and sec members. - Ignore TM's old tm_yday and tm_wday, but fill in their correct values. - Yield -1 on failure (e.g. a member out of range). - POSIX 1003.1 doesn't allow leap seconds, but some implementations - have them anyway, so allow them if localtime/gmtime does. */ -time_t -tm2time (tm, localzone) - struct tm *tm; - int localzone; -{ - /* Cache the most recent t,tm pairs; 1 for gmtime, 1 for localtime. */ - static time_t t_cache[2]; - static struct tm tm_cache[2]; - - time_t d, gt; - struct tm const *gtm; - /* The maximum number of iterations should be enough to handle any - combinations of leap seconds, time zone rule changes, and solar time. - 4 is probably enough; we use a bigger number just to be safe. */ - int remaining_tries = 8; - - /* Avoid subscript errors. */ - if (12 <= (unsigned) tm->tm_mon) - return -1; - - tm->tm_yday = month_yday[tm->tm_mon] + tm->tm_mday - - (tm->tm_mon < 2 || !isleap (tm->tm_year + TM_YEAR_ORIGIN)); - - /* Make a first guess. */ - gt = t_cache[localzone]; - gtm = gt ? &tm_cache[localzone] : time2tm (gt, localzone); - - /* Repeatedly use the error from the guess to improve the guess. */ - while ((d = difftm (tm, gtm)) != 0) - { - if (--remaining_tries == 0) - return -1; - gt += d; - gtm = time2tm (gt, localzone); - } - - /* Check that the guess actually matches; - overflow can cause difftm to yield 0 even on differing times, - or tm may have members out of range (e.g. bad leap seconds). */ -#define TM_DIFFER(a,b) \ - ( \ - ((a)->tm_year ^ (b)->tm_year) | \ - ((a)->tm_mon ^ (b)->tm_mon) | \ - ((a)->tm_mday ^ (b)->tm_mday) | \ - ((a)->tm_hour ^ (b)->tm_hour) | \ - ((a)->tm_min ^ (b)->tm_min) | \ - ((a)->tm_sec ^ (b)->tm_sec) \ - ) - if (TM_DIFFER (tm, gtm)) - { - /* If gt is a leap second, try gt+1; if it is one greater than - a leap second, try gt-1; otherwise, it doesn't matter. - Leap seconds always fall at month end. */ - int yd = tm->tm_year - gtm->tm_year; - gt += yd + (yd ? 0 : tm->tm_mon - gtm->tm_mon); - gtm = time2tm (gt, localzone); - if (TM_DIFFER (tm, gtm)) - return -1; - } - t_cache[localzone] = gt; - tm_cache[localzone] = *gtm; - - tm->tm_wday = gtm->tm_wday; - return gt; -} - -/* Check *PT and convert it to time_t. - If it is incompletely specified, use DEFAULT_TIME to fill it out. - Use localtime if PT->zone is the special value TM_LOCAL_ZONE. - Yield -1 on failure. - ISO 8601 day-of-year and week numbers are not yet supported. */ -static time_t -maketime (pt, default_time) - struct partime const *pt; - time_t default_time; -{ - int localzone, wday, year; - struct tm tm; - struct tm *tm0 = 0; - time_t r; - int use_ordinal_day; - - tm0 = 0; /* Keep gcc -Wall happy. */ - localzone = pt->zone == TM_LOCAL_ZONE; - - tm = pt->tm; - year = tm.tm_year; - wday = tm.tm_wday; - use_ordinal_day = (!TM_DEFINED (tm.tm_mday) - && TM_DEFINED (wday) && TM_DEFINED (pt->wday_ordinal)); - - if (use_ordinal_day || TM_DEFINED (pt->ymodulus) || !TM_DEFINED (year)) - { - /* Get tm corresponding to default time. */ - tm0 = time2tm (default_time, localzone); - if (!localzone) - adjzone (tm0, pt->zone); - } - - if (use_ordinal_day) - tm.tm_mday = (tm0->tm_mday - + ((wday - tm0->tm_wday + 7) % 7 - + 7 * (pt->wday_ordinal - (pt->wday_ordinal != 0)))); - - if (TM_DEFINED (pt->ymodulus)) - { - /* Yield a year closest to the default that has the given modulus. */ - int year0 = tm0->tm_year + TM_YEAR_ORIGIN; - int y0 = MOD (year0, pt->ymodulus); - int d = 2 * (year - y0); - year += (((year0 - y0) / pt->ymodulus - + (pt->ymodulus < d ? -1 : d < -pt->ymodulus)) - * pt->ymodulus); - } - else if (!TM_DEFINED (year)) - { - /* Set default year, month, day from current time. */ - year = tm0->tm_year + TM_YEAR_ORIGIN; - if (!TM_DEFINED (tm.tm_mon)) - { - tm.tm_mon = tm0->tm_mon; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = tm0->tm_mday; - } - } - - /* Set remaining default fields to be their minimum values. */ - if (!TM_DEFINED (tm.tm_mon)) - tm.tm_mon = 0; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = 1; - if (!TM_DEFINED (tm.tm_hour)) - tm.tm_hour = 0; - if (!TM_DEFINED (tm.tm_min)) - tm.tm_min = 0; - if (!TM_DEFINED (tm.tm_sec)) - tm.tm_sec = 0; - - tm.tm_year = year - TM_YEAR_ORIGIN; - if ((year < tm.tm_year) != (TM_YEAR_ORIGIN < 0)) - return -1; - - if (!localzone) - { - adjzone (&tm, -pt->zone); - wday = tm.tm_wday; - } - - /* Convert and fill in the rest of the tm. */ - r = tm2time (&tm, localzone); - if (r == -1) - return r; - - /* Check weekday. */ - if (TM_DEFINED (wday) && wday != tm.tm_wday) - return -1; - - /* Add relative time, except for seconds. - We handle seconds separately, at the end, - so that leap seconds are handled properly. */ - if (pt->tmr.tm_year | pt->tmr.tm_mon | pt->tmr.tm_mday - | pt->tmr.tm_hour | pt->tmr.tm_min) - { - int years = tm.tm_year + pt->tmr.tm_year; - int mons = tm.tm_mon + pt->tmr.tm_mon; - int mdays = tm.tm_mday + pt->tmr.tm_mday; - int hours = tm.tm_hour + pt->tmr.tm_hour; - int mins = tm.tm_min + pt->tmr.tm_min; - - int carried_hours = DIV (mins, 60); - int hours1 = hours + carried_hours; - int carried_days = DIV (hours1, 24); - int mdays1 = mdays + carried_days; - - int mon0 = MOD (mons, 12); - int carried_years0 = DIV (mons, 12); - int year0 = years + carried_years0; - int yday0 = (month_yday[mon0] - - (mon0 < 2 || !isleap (year0 + TM_YEAR_ORIGIN))); - - int yday1 = yday0 + mdays1; - int carried_years1 = DIV (yday1, Y400_DAYS) * 400; - int year1 = year0 + carried_years1; - int yday2 = MOD (yday1, Y400_DAYS); - int leap; - - if (overflow_sum_sign (tm.tm_year, pt->tmr.tm_year, years) - | overflow_sum_sign (tm.tm_mon, pt->tmr.tm_mon, mons) - | overflow_sum_sign (tm.tm_mday, pt->tmr.tm_mday, mdays) - | overflow_sum_sign (tm.tm_hour, pt->tmr.tm_hour, hours) - | overflow_sum_sign (tm.tm_min, pt->tmr.tm_min, mins) - | overflow_sum_sign (hours, carried_hours, hours1) - | overflow_sum_sign (mdays, carried_days, mdays1) - | overflow_sum_sign (years, carried_years0, year0) - | overflow_sum_sign (yday0, mdays1, yday1) - | overflow_sum_sign (year0, carried_years1, year1)) - return -1; - - for (;;) - { - int days_per_year = 365 + (leap = isleap (year1 + TM_YEAR_ORIGIN)); - if (yday2 < days_per_year) - break; - yday2 -= days_per_year; - year1++; - } - - tm.tm_year = year1; - - { - int mon; - for (mon = 11; - (tm.tm_mday = (yday2 - month_yday[mon] + (mon < 2 || !leap))) <= 0; - mon--) - continue; - tm.tm_mon = mon; - } - - tm.tm_hour = MOD (hours1, 24); - tm.tm_min = MOD (mins, 60); - - r = tm2time (&tm, localzone); - if (r == -1) - return r; - } - - /* Add the seconds' part of relative time. */ - { - time_t rs = r + pt->tmr.tm_sec; - if ((pt->tmr.tm_sec < 0) != (rs < r)) - return -1; - return rs; - } -} - -/* Parse a free-format date in *SOURCE, yielding a Unix format time. - Update *SOURCE to point to the first character after the date. - If *SOURCE is missing some information, take defaults from - DEFAULT_TIME and DEFAULT_ZONE. *SOURCE may even be the empty - string or an immediately invalid string, in which case the default - time and zone is used. - Return (time_t) -1 if the time is invalid or cannot be represented. */ -time_t -str2time (source, default_time, default_zone) - char const **source; - time_t default_time; - long default_zone; -{ - struct partime pt; - - *source = partime (*source, &pt); - if (pt.zone == TM_UNDEFINED_ZONE) - pt.zone = default_zone; - return maketime (&pt, default_time); -} - -#ifdef TEST -#include -int -main (argc, argv) - int argc; - char **argv; -{ - time_t default_time = time ((time_t *) 0); - long default_zone = argv[1] ? atol (argv[1]) : TM_LOCAL_ZONE; - char buf[1000]; - while (fgets (buf, sizeof (buf), stdin)) - { - char const *p = buf; - time_t t = str2time (&p, default_time, default_zone); - printf ("`%.*s' -> %s", - (int) (p - buf - (p[0] == '\0' && p[-1] == '\n')), buf, - asctime ((argv[1] ? gmtime : localtime) (&t))); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/maketime.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quote.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/quote.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quote.c (nonexistent) @@ -1,45 +0,0 @@ -/* quote.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#if HAVE_STDDEF_H -# include /* For the definition of size_t on windows w/MSVC. */ -#endif -#include -#include "quotearg.h" -#include "quote.h" - -/* Return an unambiguous printable representation of NAME, - allocated in slot N, suitable for diagnostics. */ -char const * -quote_n (int n, char const *name) -{ - return quotearg_n_style (n, locale_quoting_style, name); -} - -/* Return an unambiguous printable representation of NAME, - suitable for diagnostics. */ -char const * -quote (char const *name) -{ - return quote_n (0, name); -} Property changes on: vendor/misc-GNU/patch/2.5.9/quote.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quotesys.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/quotesys.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quotesys.h (nonexistent) @@ -1,9 +0,0 @@ -/* quotesys.h -- declarations for quoting system arguments */ - -#if defined __STDC__ || __GNUC__ -# define __QUOTESYS_P(args) args -#else -# define __QUOTESYS_P(args) () -#endif - -size_t quote_system_arg __QUOTESYS_P ((char *, char const *)); Property changes on: vendor/misc-GNU/patch/2.5.9/quotesys.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/common.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/common.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/common.h (nonexistent) @@ -1,297 +0,0 @@ -/* common definitions for `patch' */ - -/* $Id: common.h,v 1.34 2003/05/19 06:57:36 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef DEBUGGING -#define DEBUGGING 1 -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#if ! defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if ! defined S_ISREG && defined S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#ifndef S_IXOTH -#define S_IXOTH 1 -#endif -#ifndef S_IWOTH -#define S_IWOTH 2 -#endif -#ifndef S_IROTH -#define S_IROTH 4 -#endif -#ifndef S_IXGRP -#define S_IXGRP (S_IXOTH << 3) -#endif -#ifndef S_IWGRP -#define S_IWGRP (S_IWOTH << 3) -#endif -#ifndef S_IRGRP -#define S_IRGRP (S_IROTH << 3) -#endif -#ifndef S_IXUSR -#define S_IXUSR (S_IXOTH << 6) -#endif -#ifndef S_IWUSR -#define S_IWUSR (S_IWOTH << 6) -#endif -#ifndef S_IRUSR -#define S_IRUSR (S_IROTH << 6) -#endif -#ifdef MKDIR_TAKES_ONE_ARG -# define mkdir(name, mode) ((mkdir) (name)) -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif -/* The extra casts work around common compiler bugs, - e.g. Cray C 5.0.3.0 time_t. */ -#define TYPE_SIGNED(t) ((t) -1 < (t) 0) -#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ - ? (t) (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) \ - : (t) 0)) -#define TYPE_MAXIMUM(t) ((t) ((t) ~ (t) 0 - TYPE_MINIMUM (t))) -#ifndef CHAR_MAX -#define CHAR_MAX TYPE_MAXIMUM (char) -#endif -#ifndef INT_MAX -#define INT_MAX TYPE_MAXIMUM (int) -#endif -#ifndef LONG_MIN -#define LONG_MIN TYPE_MINIMUM (long) -#endif - -#if HAVE_INTTYPES_H -# include -#endif -#ifndef SIZE_MAX -/* On some nonstandard hosts, size_t is signed, - so SIZE_MAX != (size_t) -1. */ -#define SIZE_MAX TYPE_MAXIMUM (size_t) -#endif - -#include -/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to macros like `isspace'. */ -#if STDC_HEADERS -#define CTYPE_DOMAIN(c) 1 -#else -#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#ifndef ISSPACE -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#endif - -#ifndef ISDIGIT -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#endif - - -/* handy definitions */ - -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) - -/* typedefs */ - -typedef off_t LINENUM; /* must be signed */ - -/* globals */ - -XTERN char *program_name; /* The name this program was run with. */ - -XTERN char *buf; /* general purpose buffer */ -XTERN size_t bufsize; /* allocated size of buf */ - -XTERN bool using_plan_a; /* try to keep everything in memory */ - -XTERN char *inname; -XTERN char *outfile; -XTERN int inerrno; -XTERN int invc; -XTERN struct stat instat; -XTERN bool dry_run; -XTERN bool posixly_correct; - -XTERN char const *origprae; -XTERN char const *origbase; - -XTERN char const * volatile TMPINNAME; -XTERN char const * volatile TMPOUTNAME; -XTERN char const * volatile TMPPATNAME; - -XTERN int volatile TMPINNAME_needs_removal; -XTERN int volatile TMPOUTNAME_needs_removal; -XTERN int volatile TMPPATNAME_needs_removal; - -#ifdef DEBUGGING -XTERN int debug; -#else -# define debug 0 -#endif -XTERN bool force; -XTERN bool batch; -XTERN bool noreverse; -XTERN bool reverse; -XTERN enum { DEFAULT_VERBOSITY, SILENT, VERBOSE } verbosity; -XTERN bool skip_rest_of_patch; -XTERN int strippath; -XTERN bool canonicalize; -XTERN int patch_get; -XTERN bool set_time; -XTERN bool set_utc; - -enum diff - { - NO_DIFF, - CONTEXT_DIFF, - NORMAL_DIFF, - ED_DIFF, - NEW_CONTEXT_DIFF, - UNI_DIFF - }; - -XTERN enum diff diff_type; - -XTERN char *revision; /* prerequisite revision, if any */ - -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ -# define __attribute__(x) -#endif - -void fatal_exit (int) __attribute__ ((noreturn)); - -#include -#if !STDC_HEADERS && !defined errno -extern int errno; -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#else -# if !HAVE_MEMCHR -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# define memcpy(d, s, n) bcopy (s, d, n) -void *memchr (); -# endif -#endif - -#if STDC_HEADERS -# include -#else -char *getenv (); -void *malloc (); -void *realloc (); -#endif - -#if HAVE_UNISTD_H -# include -#else -# ifndef lseek - off_t lseek (); -# endif -#endif -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif -#if HAVE_FSEEKO - typedef off_t file_offset; -# define file_seek fseeko -# define file_tell ftello -#else - typedef long file_offset; -# define file_seek fseek -# define file_tell ftell -#endif -#if ! (HAVE_GETEUID || defined geteuid) -# if ! (HAVE_GETUID || defined getuid) -# define geteuid() (-1) -# else -# define geteuid() getuid () -# endif -#endif - -#if HAVE_FCNTL_H -# include -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif -#ifndef O_WRONLY -#define O_WRONLY 1 -#endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif -#ifndef _O_BINARY -#define _O_BINARY 0 -#endif -#ifndef O_BINARY -#define O_BINARY _O_BINARY -#endif -#ifndef O_CREAT -#define O_CREAT 0 -#endif -#ifndef O_EXCL -#define O_EXCL 0 -#endif -#ifndef O_TRUNC -#define O_TRUNC 0 -#endif - -#if HAVE_SETMODE_DOS - XTERN int binary_transput; /* O_BINARY if binary i/o is desired */ -#else -# define binary_transput 0 -#endif - -#ifndef NULL_DEVICE -#define NULL_DEVICE "/dev/null" -#endif - -#ifndef TTY_DEVICE -#define TTY_DEVICE "/dev/tty" -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/common.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/error.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/error.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/error.c (nonexistent) @@ -1,407 +0,0 @@ -/* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000, 2001, 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef _LIBC -# include -#else -# include "gettext.h" -#endif - -#ifdef _LIBC -# include -# define mbsrtowcs __mbsrtowcs -#endif - -#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC -# if __STDC__ -# include -# define VA_START(args, lastarg) va_start(args, lastarg) -# else -# include -# define VA_START(args, lastarg) va_start(args) -# endif -#else -# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 -# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; -#endif - -#if STDC_HEADERS || _LIBC -# include -# include -#else -void exit (); -#endif - -#include "error.h" - -#if !_LIBC -# include "unlocked-io.h" -#endif - -#ifndef _ -# define _(String) String -#endif - -/* If NULL, error will flush stdout, then print on stderr the program - name, a colon and a space. Otherwise, error will call this - function without parameters instead. */ -void (*error_print_progname) ( -#if __STDC__ - 0 - void -#endif - ); - -/* This variable is incremented each time `error' is called. */ -unsigned int error_message_count; - -#ifdef _LIBC -/* In the GNU C library, there is a predefined variable for this. */ - -# define program_name program_invocation_name -# include -# include - -/* In GNU libc we want do not want to use the common name `error' directly. - Instead make it a weak alias. */ -extern void __error (int status, int errnum, const char *message, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); -extern void __error_at_line (int status, int errnum, const char *file_name, - unsigned int line_number, const char *message, - ...) - __attribute__ ((__format__ (__printf__, 5, 6)));; -# define error __error -# define error_at_line __error_at_line - -# ifdef USE_IN_LIBIO -# include -# define fflush(s) INTUSE(_IO_fflush) (s) -# undef putc -# define putc(c, fp) INTUSE(_IO_putc) (c, fp) -# endif - -#else /* not _LIBC */ - -# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P -# ifndef HAVE_DECL_STRERROR_R -"this configure-time declaration test was not run" -# endif -char *strerror_r (); -# endif - -/* The calling program should define program_name and set it to the - name of the executing program. */ -extern char *program_name; - -# if HAVE_STRERROR_R || defined strerror_r -# define __strerror_r strerror_r -# else -# if HAVE_STRERROR -# ifndef HAVE_DECL_STRERROR -"this configure-time declaration test was not run" -# endif -# if !HAVE_DECL_STRERROR -char *strerror (); -# endif -# else -static char * -private_strerror (int errnum) -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum > 0 && errnum <= sys_nerr) - return _(sys_errlist[errnum]); - return _("Unknown system error"); -} -# define strerror private_strerror -# endif /* HAVE_STRERROR */ -# endif /* HAVE_STRERROR_R || defined strerror_r */ -#endif /* not _LIBC */ - -static void -print_errno_message (int errnum) -{ - char const *s; - -#if defined HAVE_STRERROR_R || _LIBC - char errbuf[1024]; -# if STRERROR_R_CHAR_P || _LIBC - s = __strerror_r (errnum, errbuf, sizeof errbuf); -# else - if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) - s = errbuf; - else - s = 0; -# endif -#else - s = strerror (errnum); -#endif - -#if !_LIBC - if (! s) - s = _("Unknown system error"); -#endif - -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - { - __fwprintf (stderr, L": %s", s); - return; - } -#endif - - fprintf (stderr, ": %s", s); -} - -#ifdef VA_START -static void -error_tail (int status, int errnum, const char *message, va_list args) -{ -# if HAVE_VPRINTF || _LIBC -# if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - { -# define ALLOCA_LIMIT 2000 - size_t len = strlen (message) + 1; - wchar_t *wmessage = NULL; - mbstate_t st; - size_t res; - const char *tmp; - - do - { - if (len < ALLOCA_LIMIT) - wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); - else - { - if (wmessage != NULL && len / 2 < ALLOCA_LIMIT) - wmessage = NULL; - - wmessage = (wchar_t *) realloc (wmessage, - len * sizeof (wchar_t)); - - if (wmessage == NULL) - { - fputws_unlocked (L"out of memory\n", stderr); - return; - } - } - - memset (&st, '\0', sizeof (st)); - tmp =message; - } - while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len); - - if (res == (size_t) -1) - /* The string cannot be converted. */ - wmessage = (wchar_t *) L"???"; - - __vfwprintf (stderr, wmessage, args); - } - else -# endif - vfprintf (stderr, message, args); -# else - _doprnt (message, args, stderr); -# endif - va_end (args); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); -# if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - putwc (L'\n', stderr); - else -# endif - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -} -#endif - - -/* Print the program name and error message MESSAGE, which is a printf-style - format string with optional args. - If ERRNUM is nonzero, print its corresponding system error message. - Exit with status STATUS if it is nonzero. */ -/* VARARGS */ -void -#if defined VA_START && __STDC__ -error (int status, int errnum, const char *message, ...) -#else -error (status, errnum, message, va_alist) - int status; - int errnum; - char *message; - va_dcl -#endif -{ -#ifdef VA_START - va_list args; -#endif - - fflush (stdout); -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif -#endif - if (error_print_progname) - (*error_print_progname) (); - else - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s: ", program_name); - else -#endif - fprintf (stderr, "%s: ", program_name); - } - -#ifdef VA_START - VA_START (args, message); - error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif - -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_funlockfile (stderr); -# else - __funlockfile (stderr); -# endif -#endif -} - -/* Sometimes we want to have at most one error per line. This - variable controls whether this mode is selected or not. */ -int error_one_per_line; - -void -#if defined VA_START && __STDC__ -error_at_line (int status, int errnum, const char *file_name, - unsigned int line_number, const char *message, ...) -#else -error_at_line (status, errnum, file_name, line_number, message, va_alist) - int status; - int errnum; - const char *file_name; - unsigned int line_number; - char *message; - va_dcl -#endif -{ -#ifdef VA_START - va_list args; -#endif - - if (error_one_per_line) - { - static const char *old_file_name; - static unsigned int old_line_number; - - if (old_line_number == line_number - && (file_name == old_file_name - || strcmp (old_file_name, file_name) == 0)) - /* Simply return and print nothing. */ - return; - - old_file_name = file_name; - old_line_number = line_number; - } - - fflush (stdout); -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif -#endif - if (error_print_progname) - (*error_print_progname) (); - else - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s: ", program_name); - else -#endif - fprintf (stderr, "%s:", program_name); - } - - if (file_name != NULL) - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s:%d: ", file_name, line_number); - else -#endif - fprintf (stderr, "%s:%d: ", file_name, line_number); - } - -#ifdef VA_START - VA_START (args, message); - error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif - -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_funlockfile (stderr); -# else - __funlockfile (stderr); -# endif -#endif -} - -#ifdef _LIBC -/* Make the weak alias. */ -# undef error -# undef error_at_line -weak_alias (__error, error) -weak_alias (__error_at_line, error_at_line) -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/error.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/memchr.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/memchr.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/memchr.c (nonexistent) @@ -1,216 +0,0 @@ -/* Copyright (C) 1991,93,96,97,99,2000 Free Software Foundation, Inc. - Based on strlen implementation by Torbjorn Granlund (tege@sics.se), - with help from Dan Sahlin (dan@sics.se) and - commentary by Jim Blandy (jimb@ai.mit.edu); - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), - and implemented by Roland McGrath (roland@ai.mit.edu). - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#undef __ptr_t -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -# define __ptr_t void * -#else /* Not C++ or ANSI C. */ -# define __ptr_t char * -#endif /* C++ or ANSI C. */ - -#if defined _LIBC -# include -# include -#else -# define reg_char char -#endif - -#if HAVE_STDLIB_H || defined _LIBC -# include -#endif - -#if HAVE_LIMITS_H || defined _LIBC -# include -#endif - -#define LONG_MAX_32_BITS 2147483647 - -#ifndef LONG_MAX -# define LONG_MAX LONG_MAX_32_BITS -#endif - -#include -#if HAVE_BP_SYM_H || defined _LIBC -# include -#else -# define BP_SYM(sym) sym -#endif - -#undef memchr -#undef __memchr - -/* Search no more than N bytes of S for C. */ -__ptr_t -__memchr (s, c_in, n) - const __ptr_t s; - int c_in; - size_t n; -{ - const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; - unsigned reg_char c; - - c = (unsigned char) c_in; - - /* Handle the first few characters by reading one character at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && ((unsigned long int) char_ptr - & (sizeof (longword) - 1)) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (__ptr_t) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to 8-byte longwords. */ - - longword_ptr = (unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - if (sizeof (longword) != 4 && sizeof (longword) != 8) - abort (); - -#if LONG_MAX <= LONG_MAX_32_BITS - magic_bits = 0x7efefeff; -#else - magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; -#endif - - /* Set up a longword, each of whose bytes is C. */ - charmask = c | (c << 8); - charmask |= charmask << 16; -#if LONG_MAX > LONG_MAX_32_BITS - charmask |= charmask << 32; -#endif - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof (longword)) - { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) - { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ - - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (__ptr_t) cp; - if (cp[1] == c) - return (__ptr_t) &cp[1]; - if (cp[2] == c) - return (__ptr_t) &cp[2]; - if (cp[3] == c) - return (__ptr_t) &cp[3]; -#if LONG_MAX > 2147483647 - if (cp[4] == c) - return (__ptr_t) &cp[4]; - if (cp[5] == c) - return (__ptr_t) &cp[5]; - if (cp[6] == c) - return (__ptr_t) &cp[6]; - if (cp[7] == c) - return (__ptr_t) &cp[7]; -#endif - } - - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - while (n-- > 0) - { - if (*char_ptr == c) - return (__ptr_t) char_ptr; - else - ++char_ptr; - } - - return 0; -} -#ifdef weak_alias -weak_alias (__memchr, BP_SYM (memchr)) -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/memchr.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/addext.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/addext.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/addext.c (nonexistent) @@ -1,120 +0,0 @@ -/* addext.c -- add an extension to a file name - - Copyright (C) 1990, 1997, 1998, 1999, 2001, 2003 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie and Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifndef HAVE_DOS_FILE_NAMES -# define HAVE_DOS_FILE_NAMES 0 -#endif -#ifndef HAVE_LONG_FILE_NAMES -# define HAVE_LONG_FILE_NAMES 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef _POSIX_NAME_MAX -# define _POSIX_NAME_MAX 14 -#endif - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - -#include -#ifndef errno -extern int errno; -#endif - -#include "backupfile.h" -#include "dirname.h" - -/* Append to FILENAME the extension EXT, unless the result would be too long, - in which case just append the character E. */ - -void -addext (char *filename, char const *ext, int e) -{ - char *s = base_name (filename); - size_t slen = base_len (s); - size_t extlen = strlen (ext); - size_t slen_max = HAVE_LONG_FILE_NAMES ? 255 : _POSIX_NAME_MAX; - -#if HAVE_PATHCONF && defined _PC_NAME_MAX - if (_POSIX_NAME_MAX < slen + extlen || HAVE_DOS_FILE_NAMES) - { - /* The new base name is long enough to require a pathconf check. */ - long name_max; - errno = 0; - if (s == filename) - name_max = pathconf (".", _PC_NAME_MAX); - else - { - char c = *s; - if (! ISSLASH (c)) - *s = 0; - name_max = pathconf (filename, _PC_NAME_MAX); - *s = c; - } - if (0 <= name_max || errno == 0) - { - long size = slen_max = name_max; - if (name_max != size) - slen_max = -1; - } - } -#endif - - if (HAVE_DOS_FILE_NAMES && slen_max <= 12) - { - /* Live within DOS's 8.3 limit. */ - char *dot = strchr (s, '.'); - if (dot) - { - slen -= dot + 1 - s; - s = dot + 1; - slen_max = 3; - } - else - slen_max = 8; - extlen = 9; /* Don't use EXT. */ - } - - if (slen + extlen <= slen_max) - strcpy (s + slen, ext); - else - { - if (slen_max <= slen) - slen = slen_max - 1; - s[slen] = e; - s[slen + 1] = 0; - } -} Property changes on: vendor/misc-GNU/patch/2.5.9/addext.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/maketime.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/maketime.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/maketime.h (nonexistent) @@ -1,39 +0,0 @@ -/* Yield time_t from struct partime yielded by partime. */ - -/* Copyright 1993, 1994, 1995 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if defined __STDC__ || has_prototypes -# define __MAKETIME_P(x) x -#else -# define __MAKETIME_P(x) () -#endif - -struct tm *time2tm __MAKETIME_P ((time_t, int)); -time_t difftm __MAKETIME_P ((struct tm const *, struct tm const *)); -time_t str2time __MAKETIME_P ((char const **, time_t, long)); -time_t tm2time __MAKETIME_P ((struct tm *, int)); -void adjzone __MAKETIME_P ((struct tm *, long)); Property changes on: vendor/misc-GNU/patch/2.5.9/maketime.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/quote.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/quote.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/quote.h (nonexistent) @@ -1,28 +0,0 @@ -/* quote.h - prototypes for quote.c - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - -char const *quote_n PARAMS ((int n, char const *name)); -char const *quote PARAMS ((char const *name)); Property changes on: vendor/misc-GNU/patch/2.5.9/quote.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/patch.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/patch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/patch.c (nonexistent) @@ -1,1369 +0,0 @@ -/* patch - a program to apply diffs to original files */ - -/* $Id: patch.c,v 1.44 2003/05/20 13:55:03 eggert Exp $ */ - -/* Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall - - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2002, - 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN -#include -#undef XTERN -#define XTERN extern -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_UTIME_H -# include -#endif -/* Some nonstandard hosts don't declare this structure even in . */ -#if ! HAVE_STRUCT_UTIMBUF -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif - -/* Output stream state. */ -struct outstate -{ - FILE *ofp; - bool after_newline; - bool zero_output; -}; - -/* procedures */ - -static FILE *create_output_file (char const *, int); -static LINENUM locate_hunk (LINENUM); -static bool apply_hunk (struct outstate *, LINENUM); -static bool copy_till (struct outstate *, LINENUM); -static bool patch_match (LINENUM, LINENUM, LINENUM, LINENUM); -static bool similar (char const *, size_t, char const *, size_t); -static bool spew_output (struct outstate *); -static char const *make_temp (char); -static int numeric_string (char const *, bool, char const *); -static void abort_hunk (void); -static void cleanup (void); -static void get_some_switches (void); -static void init_output (char const *, int, struct outstate *); -static void init_reject (void); -static void reinitialize_almost_everything (void); -static void remove_if_needed (char const *, int volatile *); -static void usage (FILE *, int) __attribute__((noreturn)); - -static bool make_backups; -static bool backup_if_mismatch; -static char const *version_control; -static char const *version_control_context; -static bool remove_empty_files; - -/* true if -R was specified on command line. */ -static bool reverse_flag_specified; - -/* how many input lines have been irretractably output */ -static LINENUM last_frozen_line; - -static char const *do_defines; /* symbol to patch using ifdef, ifndef, etc. */ -static char const if_defined[] = "\n#ifdef %s\n"; -static char const not_defined[] = "\n#ifndef %s\n"; -static char const else_defined[] = "\n#else\n"; -static char const end_defined[] = "\n#endif\n"; - -static int Argc; -static char * const *Argv; - -static FILE *rejfp; /* reject file pointer */ - -static char const *patchname; -static char *rejname; -static char const * volatile TMPREJNAME; -static int volatile TMPREJNAME_needs_removal; - -static LINENUM last_offset; -static LINENUM maxfuzz = 2; - -static char serrbuf[BUFSIZ]; - -/* Apply a set of diffs as appropriate. */ - -int -main (int argc, char **argv) -{ - char const *val; - bool somefailed = false; - struct outstate outstate; - char numbuf[LINENUM_LENGTH_BOUND + 1]; - - xalloc_exit_failure = 2; - program_name = argv[0]; - init_time (); - - setbuf(stderr, serrbuf); - - xalloc_fail_func = memory_fatal; - bufsize = 8 * 1024; - buf = xmalloc (bufsize); - - strippath = -1; - - val = getenv ("QUOTING_STYLE"); - { - int i = val ? argmatch (val, quoting_style_args, 0, 0) : -1; - set_quoting_style ((struct quoting_options *) 0, - i < 0 ? shell_quoting_style : (enum quoting_style) i); - } - - posixly_correct = getenv ("POSIXLY_CORRECT") != 0; - backup_if_mismatch = ! posixly_correct; - patch_get = ((val = getenv ("PATCH_GET")) - ? numeric_string (val, true, "PATCH_GET value") - : posixly_correct - 1); - - val = getenv ("SIMPLE_BACKUP_SUFFIX"); - simple_backup_suffix = val && *val ? val : ".orig"; - - if ((version_control = getenv ("PATCH_VERSION_CONTROL"))) - version_control_context = "$PATCH_VERSION_CONTROL"; - else if ((version_control = getenv ("VERSION_CONTROL"))) - version_control_context = "$VERSION_CONTROL"; - - /* Cons up the names of the global temporary files. - Do this before `cleanup' can possibly be called (e.g. by `pfatal'). */ - TMPOUTNAME = make_temp ('o'); - TMPINNAME = make_temp ('i'); - TMPREJNAME = make_temp ('r'); - TMPPATNAME = make_temp ('p'); - - /* parse switches */ - Argc = argc; - Argv = argv; - get_some_switches(); - - if (make_backups | backup_if_mismatch) - backup_type = get_version (version_control_context, version_control); - - init_output (outfile, 0, &outstate); - - /* Make sure we clean up in case of disaster. */ - set_signals (false); - - for ( - open_patch_file (patchname); - there_is_another_patch(); - reinitialize_almost_everything() - ) { /* for each patch in patch file */ - int hunk = 0; - int failed = 0; - bool mismatch = false; - char *outname = outfile ? outfile : inname; - - if (!skip_rest_of_patch) - get_input_file (inname, outname); - - if (diff_type == ED_DIFF) { - outstate.zero_output = false; - somefailed |= skip_rest_of_patch; - do_ed_script (outstate.ofp); - if (! dry_run && ! outfile && ! skip_rest_of_patch) - { - struct stat statbuf; - if (stat (TMPOUTNAME, &statbuf) != 0) - pfatal ("%s", TMPOUTNAME); - outstate.zero_output = statbuf.st_size == 0; - } - } else { - int got_hunk; - bool apply_anyway = false; - - /* initialize the patched file */ - if (! skip_rest_of_patch && ! outfile) - { - int exclusive = TMPOUTNAME_needs_removal ? 0 : O_EXCL; - TMPOUTNAME_needs_removal = 1; - init_output (TMPOUTNAME, exclusive, &outstate); - } - - /* initialize reject file */ - init_reject (); - - /* find out where all the lines are */ - if (!skip_rest_of_patch) - scan_input (inname); - - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ - - /* apply each hunk of patch */ - while (0 < (got_hunk = another_hunk (diff_type, reverse))) { - LINENUM where = 0; /* Pacify `gcc -Wall'. */ - LINENUM newwhere; - LINENUM fuzz = 0; - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM mymaxfuzz = (maxfuzz < context ? maxfuzz : context); - hunk++; - if (!skip_rest_of_patch) { - do { - where = locate_hunk(fuzz); - if (! where || fuzz || last_offset) - mismatch = true; - if (hunk == 1 && ! where && ! (force | apply_anyway) - && reverse == reverse_flag_specified) { - /* dwim for reversed patch? */ - if (!pch_swap()) { - say ( -"Not enough memory to try swapped hunk! Assuming unswapped.\n"); - continue; - } - /* Try again. */ - where = locate_hunk (fuzz); - if (where - && (ok_to_reverse - ("%s patch detected!", - (reverse - ? "Unreversed" - : "Reversed (or previously applied)")))) - reverse = ! reverse; - else - { - /* Put it back to normal. */ - if (! pch_swap ()) - fatal ("lost hunk on alloc error!"); - if (where) - { - apply_anyway = true; - fuzz--; /* Undo `++fuzz' below. */ - where = 0; - } - } - } - } while (!skip_rest_of_patch && !where - && ++fuzz <= mymaxfuzz); - - if (skip_rest_of_patch) { /* just got decided */ - if (outstate.ofp && ! outfile) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - } - } - - newwhere = pch_newfirst() + last_offset; - if (skip_rest_of_patch) { - abort_hunk(); - failed++; - if (verbosity == VERBOSE) - say ("Hunk #%d ignored at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } - else if (!where - || (where == 1 && pch_says_nonexistent (reverse) == 2 - && instat.st_size)) { - - if (where) - say ("Patch attempted to create file %s, which already exists.\n", - quotearg (inname)); - - abort_hunk(); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } - else if (! apply_hunk (&outstate, where)) { - abort_hunk (); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } else { - if (verbosity == VERBOSE - || (verbosity != SILENT && (fuzz || last_offset))) { - say ("Hunk #%d succeeded at %s", hunk, - format_linenum (numbuf, newwhere)); - if (fuzz) - say (" with fuzz %s", format_linenum (numbuf, fuzz)); - if (last_offset) - say (" (offset %s line%s)", - format_linenum (numbuf, last_offset), - "s" + (last_offset == 1)); - say (".\n"); - } - } - } - - if (!skip_rest_of_patch) - { - if (got_hunk < 0 && using_plan_a) - { - if (outfile) - fatal ("out of memory using Plan A"); - say ("\n\nRan out of memory using Plan A -- trying again...\n\n"); - if (outstate.ofp) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - fclose (rejfp); - continue; - } - - /* Finish spewing out the new file. */ - assert (hunk); - if (! spew_output (&outstate)) - { - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - } - } - } - - /* and put the output where desired */ - ignore_signals (); - if (! skip_rest_of_patch && ! outfile) { - if (outstate.zero_output - && (remove_empty_files - || (pch_says_nonexistent (! reverse) == 2 - && ! posixly_correct))) - { - if (verbosity == VERBOSE) - say ("Removing file %s%s\n", quotearg (outname), - dry_run ? " and any empty ancestor directories" : ""); - if (! dry_run) - { - move_file ((char *) 0, (int *) 0, outname, (mode_t) 0, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - removedirs (outname); - } - } - else - { - if (! outstate.zero_output - && pch_says_nonexistent (! reverse)) - { - mismatch = true; - if (verbosity != SILENT) - say ("File %s is not empty after patch, as expected\n", - quotearg (outname)); - } - - if (! dry_run) - { - time_t t; - - move_file (TMPOUTNAME, &TMPOUTNAME_needs_removal, - outname, instat.st_mode, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - - if ((set_time | set_utc) - && (t = pch_timestamp (! reverse)) != (time_t) -1) - { - struct utimbuf utimbuf; - utimbuf.actime = utimbuf.modtime = t; - - if (! force && ! inerrno - && pch_says_nonexistent (reverse) != 2 - && (t = pch_timestamp (reverse)) != (time_t) -1 - && t != instat.st_mtime) - say ("Not setting time of file %s (time mismatch)\n", - quotearg (outname)); - else if (! force && (mismatch | failed)) - say ("Not setting time of file %s (contents mismatch)\n", - quotearg (outname)); - else if (utime (outname, &utimbuf) != 0) - pfatal ("Can't set timestamp on file %s", - quotearg (outname)); - } - - if (! inerrno && chmod (outname, instat.st_mode) != 0) - pfatal ("Can't set permissions on file %s", - quotearg (outname)); - } - } - } - if (diff_type != ED_DIFF) { - if (fclose (rejfp) != 0) - write_fatal (); - if (failed) { - somefailed = true; - say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1), - skip_rest_of_patch ? "ignored" : "FAILED"); - if (outname) { - char *rej = rejname; - if (!rejname) { - rej = xmalloc (strlen (outname) + 5); - strcpy (rej, outname); - addext (rej, ".rej", '#'); - } - say (" -- saving rejects to file %s", quotearg (rej)); - if (! dry_run) - { - move_file (TMPREJNAME, &TMPREJNAME_needs_removal, - rej, instat.st_mode, false); - if (! inerrno - && (chmod (rej, (instat.st_mode - & ~(S_IXUSR|S_IXGRP|S_IXOTH))) - != 0)) - pfatal ("can't set permissions on file %s", - quotearg (rej)); - } - if (!rejname) - free (rej); - } - say ("\n"); - } - } - set_signals (true); - } - if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) - write_fatal (); - cleanup (); - if (somefailed) - exit (1); - return 0; -} - -/* Prepare to find the next patch to do in the patch file. */ - -static void -reinitialize_almost_everything (void) -{ - re_patch(); - re_input(); - - input_lines = 0; - last_frozen_line = 0; - - if (inname) { - free (inname); - inname = 0; - } - - last_offset = 0; - - diff_type = NO_DIFF; - - if (revision) { - free(revision); - revision = 0; - } - - reverse = reverse_flag_specified; - skip_rest_of_patch = false; -} - -static char const shortopts[] = "bB:cd:D:eEfF:g:i:lnNo:p:r:RstTuvV:x:Y:z:Z"; -static struct option const longopts[] = -{ - {"backup", no_argument, NULL, 'b'}, - {"prefix", required_argument, NULL, 'B'}, - {"context", no_argument, NULL, 'c'}, - {"directory", required_argument, NULL, 'd'}, - {"ifdef", required_argument, NULL, 'D'}, - {"ed", no_argument, NULL, 'e'}, - {"remove-empty-files", no_argument, NULL, 'E'}, - {"force", no_argument, NULL, 'f'}, - {"fuzz", required_argument, NULL, 'F'}, - {"get", no_argument, NULL, 'g'}, - {"input", required_argument, NULL, 'i'}, - {"ignore-whitespace", no_argument, NULL, 'l'}, - {"normal", no_argument, NULL, 'n'}, - {"forward", no_argument, NULL, 'N'}, - {"output", required_argument, NULL, 'o'}, - {"strip", required_argument, NULL, 'p'}, - {"reject-file", required_argument, NULL, 'r'}, - {"reverse", no_argument, NULL, 'R'}, - {"quiet", no_argument, NULL, 's'}, - {"silent", no_argument, NULL, 's'}, - {"batch", no_argument, NULL, 't'}, - {"set-time", no_argument, NULL, 'T'}, - {"unified", no_argument, NULL, 'u'}, - {"version", no_argument, NULL, 'v'}, - {"version-control", required_argument, NULL, 'V'}, - {"debug", required_argument, NULL, 'x'}, - {"basename-prefix", required_argument, NULL, 'Y'}, - {"suffix", required_argument, NULL, 'z'}, - {"set-utc", no_argument, NULL, 'Z'}, - {"dry-run", no_argument, NULL, CHAR_MAX + 1}, - {"verbose", no_argument, NULL, CHAR_MAX + 2}, - {"binary", no_argument, NULL, CHAR_MAX + 3}, - {"help", no_argument, NULL, CHAR_MAX + 4}, - {"backup-if-mismatch", no_argument, NULL, CHAR_MAX + 5}, - {"no-backup-if-mismatch", no_argument, NULL, CHAR_MAX + 6}, - {"posix", no_argument, NULL, CHAR_MAX + 7}, - {"quoting-style", required_argument, NULL, CHAR_MAX + 8}, - {NULL, no_argument, NULL, 0} -}; - -static char const *const option_help[] = -{ -"Input options:", -"", -" -p NUM --strip=NUM Strip NUM leading components from file names.", -" -F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.", -" -l --ignore-whitespace Ignore white space changes between patch and input.", -"", -" -c --context Interpret the patch as a context difference.", -" -e --ed Interpret the patch as an ed script.", -" -n --normal Interpret the patch as a normal difference.", -" -u --unified Interpret the patch as a unified difference.", -"", -" -N --forward Ignore patches that appear to be reversed or already applied.", -" -R --reverse Assume patches were created with old and new files swapped.", -"", -" -i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.", -"", -"Output options:", -"", -" -o FILE --output=FILE Output patched files to FILE.", -" -r FILE --reject-file=FILE Output rejects to FILE.", -"", -" -D NAME --ifdef=NAME Make merged if-then-else output using NAME.", -" -E --remove-empty-files Remove output files that are empty after patching.", -"", -" -Z --set-utc Set times of patched files, assuming diff uses UTC (GMT).", -" -T --set-time Likewise, assuming local time.", -"", -" --quoting-style=WORD output file names using quoting style WORD.", -" Valid WORDs are: literal, shell, shell-always, c, escape.", -" Default is taken from QUOTING_STYLE env variable, or 'shell' if unset.", -"", -"Backup and version control options:", -"", -" -b --backup Back up the original contents of each file.", -" --backup-if-mismatch Back up if the patch does not match exactly.", -" --no-backup-if-mismatch Back up mismatches only if otherwise requested.", -"", -" -V STYLE --version-control=STYLE Use STYLE version control.", -" STYLE is either 'simple', 'numbered', or 'existing'.", -" -B PREFIX --prefix=PREFIX Prepend PREFIX to backup file names.", -" -Y PREFIX --basename-prefix=PREFIX Prepend PREFIX to backup file basenames.", -" -z SUFFIX --suffix=SUFFIX Append SUFFIX to backup file names.", -"", -" -g NUM --get=NUM Get files from RCS etc. if positive; ask if negative.", -"", -"Miscellaneous options:", -"", -" -t --batch Ask no questions; skip bad-Prereq patches; assume reversed.", -" -f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.", -" -s --quiet --silent Work silently unless an error occurs.", -" --verbose Output extra information about the work being done.", -" --dry-run Do not actually change any files; just print what would happen.", -" --posix Conform to the POSIX standard.", -"", -" -d DIR --directory=DIR Change the working directory to DIR first.", -#if HAVE_SETMODE_DOS -" --binary Read and write data in binary mode.", -#else -" --binary Read and write data in binary mode (no effect on this platform).", -#endif -"", -" -v --version Output version info.", -" --help Output this help.", -"", -"Report bugs to <" PACKAGE_BUGREPORT ">.", -0 -}; - -static void -usage (FILE *stream, int status) -{ - char const * const *p; - - if (status != 0) - { - fprintf (stream, "%s: Try `%s --help' for more information.\n", - program_name, Argv[0]); - } - else - { - fprintf (stream, "Usage: %s [OPTION]... [ORIGFILE [PATCHFILE]]\n\n", - Argv[0]); - for (p = option_help; *p; p++) - fprintf (stream, "%s\n", *p); - } - - exit (status); -} - -/* Process switches and filenames. */ - -static void -get_some_switches (void) -{ - register int optc; - - if (rejname) - free (rejname); - rejname = 0; - if (optind == Argc) - return; - while ((optc = getopt_long (Argc, Argv, shortopts, longopts, (int *) 0)) - != -1) { - switch (optc) { - case 'b': - make_backups = true; - /* Special hack for backward compatibility with CVS 1.9. - If the last 4 args are `-b SUFFIX ORIGFILE PATCHFILE', - treat `-b' as if it were `-b -z'. */ - if (Argc - optind == 3 - && strcmp (Argv[optind - 1], "-b") == 0 - && ! (Argv[optind + 0][0] == '-' && Argv[optind + 0][1]) - && ! (Argv[optind + 1][0] == '-' && Argv[optind + 1][1]) - && ! (Argv[optind + 2][0] == '-' && Argv[optind + 2][1])) - { - optarg = Argv[optind++]; - if (verbosity != SILENT) - say ("warning: the `-b %s' option is obsolete; use `-b -z %s' instead\n", - optarg, optarg); - goto case_z; - } - break; - case 'B': - if (!*optarg) - fatal ("backup prefix is empty"); - origprae = savestr (optarg); - break; - case 'c': - diff_type = CONTEXT_DIFF; - break; - case 'd': - if (chdir(optarg) < 0) - pfatal ("Can't change to directory %s", quotearg (optarg)); - break; - case 'D': - do_defines = savestr (optarg); - break; - case 'e': - diff_type = ED_DIFF; - break; - case 'E': - remove_empty_files = true; - break; - case 'f': - force = true; - break; - case 'F': - maxfuzz = numeric_string (optarg, false, "fuzz factor"); - break; - case 'g': - patch_get = numeric_string (optarg, true, "get option value"); - break; - case 'i': - patchname = savestr (optarg); - break; - case 'l': - canonicalize = true; - break; - case 'n': - diff_type = NORMAL_DIFF; - break; - case 'N': - noreverse = true; - break; - case 'o': - if (strcmp (optarg, "-") == 0) - fatal ("can't output patches to standard output"); - outfile = savestr (optarg); - break; - case 'p': - strippath = numeric_string (optarg, false, "strip count"); - break; - case 'r': - rejname = savestr (optarg); - break; - case 'R': - reverse = true; - reverse_flag_specified = true; - break; - case 's': - verbosity = SILENT; - break; - case 't': - batch = true; - break; - case 'T': - set_time = true; - break; - case 'u': - diff_type = UNI_DIFF; - break; - case 'v': - version(); - exit (0); - break; - case 'V': - version_control = optarg; - version_control_context = "--version-control or -V option"; - break; -#if DEBUGGING - case 'x': - debug = numeric_string (optarg, true, "debugging option"); - break; -#endif - case 'Y': - if (!*optarg) - fatal ("backup basename prefix is empty"); - origbase = savestr (optarg); - break; - case 'z': - case_z: - if (!*optarg) - fatal ("backup suffix is empty"); - simple_backup_suffix = savestr (optarg); - break; - case 'Z': - set_utc = true; - break; - case CHAR_MAX + 1: - dry_run = true; - break; - case CHAR_MAX + 2: - verbosity = VERBOSE; - break; - case CHAR_MAX + 3: -#if HAVE_SETMODE_DOS - binary_transput = O_BINARY; -#endif - break; - case CHAR_MAX + 4: - usage (stdout, 0); - case CHAR_MAX + 5: - backup_if_mismatch = true; - break; - case CHAR_MAX + 6: - backup_if_mismatch = false; - break; - case CHAR_MAX + 7: - posixly_correct = true; - break; - case CHAR_MAX + 8: - { - int i = argmatch (optarg, quoting_style_args, 0, 0); - if (i < 0) - { - invalid_arg ("quoting style", optarg, i); - usage (stderr, 2); - } - set_quoting_style ((struct quoting_options *) 0, - (enum quoting_style) i); - } - break; - default: - usage (stderr, 2); - } - } - - /* Process any filename args. */ - if (optind < Argc) - { - inname = savestr (Argv[optind++]); - invc = -1; - if (optind < Argc) - { - patchname = savestr (Argv[optind++]); - if (optind < Argc) - { - fprintf (stderr, "%s: %s: extra operand\n", - program_name, quotearg (Argv[optind])); - usage (stderr, 2); - } - } - } -} - -/* Handle STRING (possibly negative if NEGATIVE_ALLOWED is nonzero) - of type ARGTYPE_MSGID by converting it to an integer, - returning the result. */ -static int -numeric_string (char const *string, - bool negative_allowed, - char const *argtype_msgid) -{ - int value = 0; - char const *p = string; - int sign = *p == '-' ? -1 : 1; - - p += *p == '-' || *p == '+'; - - do - { - int v10 = value * 10; - int digit = *p - '0'; - int signed_digit = sign * digit; - int next_value = v10 + signed_digit; - - if (9 < (unsigned) digit) - fatal ("%s %s is not a number", argtype_msgid, quotearg (string)); - - if (v10 / 10 != value || (next_value < v10) != (signed_digit < 0)) - fatal ("%s %s is too large", argtype_msgid, quotearg (string)); - - value = next_value; - } - while (*++p); - - if (value < 0 && ! negative_allowed) - fatal ("%s %s is negative", argtype_msgid, quotearg (string)); - - return value; -} - -/* Attempt to find the right place to apply this hunk of patch. */ - -static LINENUM -locate_hunk (LINENUM fuzz) -{ - register LINENUM first_guess = pch_first () + last_offset; - register LINENUM offset; - LINENUM pat_lines = pch_ptrn_lines(); - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM prefix_fuzz = fuzz + prefix_context - context; - LINENUM suffix_fuzz = fuzz + suffix_context - context; - LINENUM max_where = input_lines - (pat_lines - suffix_fuzz) + 1; - LINENUM min_where = last_frozen_line + 1 - (prefix_context - prefix_fuzz); - LINENUM max_pos_offset = max_where - first_guess; - LINENUM max_neg_offset = first_guess - min_where; - LINENUM max_offset = (max_pos_offset < max_neg_offset - ? max_neg_offset : max_pos_offset); - - if (!pat_lines) /* null range matches always */ - return first_guess; - - /* Do not try lines <= 0. */ - if (first_guess <= max_neg_offset) - max_neg_offset = first_guess - 1; - - if (prefix_fuzz < 0) - { - /* Can only match start of file. */ - - if (suffix_fuzz < 0) - /* Can only match entire file. */ - if (pat_lines != input_lines || prefix_context < last_frozen_line) - return 0; - - offset = 1 - first_guess; - if (last_frozen_line <= prefix_context - && offset <= max_pos_offset - && patch_match (first_guess, offset, (LINENUM) 0, suffix_fuzz)) - { - last_offset += offset; - return first_guess + offset; - } - else - return 0; - } - - if (suffix_fuzz < 0) - { - /* Can only match end of file. */ - offset = first_guess - (input_lines - pat_lines + 1); - if (offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, (LINENUM) 0)) - { - last_offset -= offset; - return first_guess - offset; - } - else - return 0; - } - - for (offset = 0; offset <= max_offset; offset++) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - if (offset <= max_pos_offset - && patch_match (first_guess, offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %s to %s\n", - format_linenum (numbuf0, last_offset), - format_linenum (numbuf1, last_offset + offset)); - last_offset += offset; - return first_guess+offset; - } - if (0 < offset && offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %s to %s\n", - format_linenum (numbuf0, last_offset), - format_linenum (numbuf1, last_offset - offset)); - last_offset -= offset; - return first_guess-offset; - } - } - return 0; -} - -/* We did not find the pattern, dump out the hunk so they can handle it. */ - -static void -abort_hunk (void) -{ - register LINENUM i; - register LINENUM pat_end = pch_end (); - /* add in last_offset to guess the same as the previous successful hunk */ - LINENUM oldfirst = pch_first() + last_offset; - LINENUM newfirst = pch_newfirst() + last_offset; - LINENUM oldlast = oldfirst + pch_ptrn_lines() - 1; - LINENUM newlast = newfirst + pch_repl_lines() - 1; - char const *stars = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : ""; - char const *minuses = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----"; - - fprintf(rejfp, "***************\n"); - for (i=0; i<=pat_end; i++) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - switch (pch_char(i)) { - case '*': - if (oldlast < oldfirst) - fprintf(rejfp, "*** 0%s\n", stars); - else if (oldlast == oldfirst) - fprintf (rejfp, "*** %s%s\n", - format_linenum (numbuf0, oldfirst), stars); - else - fprintf (rejfp, "*** %s,%s%s\n", - format_linenum (numbuf0, oldfirst), - format_linenum (numbuf1, oldlast), stars); - break; - case '=': - if (newlast < newfirst) - fprintf(rejfp, "--- 0%s\n", minuses); - else if (newlast == newfirst) - fprintf (rejfp, "--- %s%s\n", - format_linenum (numbuf0, newfirst), minuses); - else - fprintf (rejfp, "--- %s,%s%s\n", - format_linenum (numbuf0, newfirst), - format_linenum (numbuf1, newlast), minuses); - break; - case ' ': case '-': case '+': case '!': - fprintf (rejfp, "%c ", pch_char (i)); - /* fall into */ - case '\n': - pch_write_line (i, rejfp); - break; - default: - fatal ("fatal internal error in abort_hunk"); - } - if (ferror (rejfp)) - write_fatal (); - } -} - -/* We found where to apply it (we hope), so do it. */ - -static bool -apply_hunk (struct outstate *outstate, LINENUM where) -{ - register LINENUM old = 1; - register LINENUM lastline = pch_ptrn_lines (); - register LINENUM new = lastline+1; - register enum {OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE} def_state = OUTSIDE; - register char const *R_do_defines = do_defines; - register LINENUM pat_end = pch_end (); - register FILE *fp = outstate->ofp; - - where--; - while (pch_char(new) == '=' || pch_char(new) == '\n') - new++; - - while (old <= lastline) { - if (pch_char(old) == '-') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + not_defined, - R_do_defines); - def_state = IN_IFNDEF; - } - else if (def_state == IN_IFDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->after_newline = pch_write_line (old, fp); - outstate->zero_output = false; - } - last_frozen_line++; - old++; - } - else if (new > pat_end) { - break; - } - else if (pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - else if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - if (ferror (fp)) - write_fatal (); - } - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = false; - new++; - } - else if (pch_char(new) != pch_char(old)) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - if (debug & 1) - say ("oldchar = '%c', newchar = '%c'\n", - pch_char (old), pch_char (new)); - fatal ("Out-of-sync patch, lines %s,%s -- mangled text or line numbers, maybe?", - format_linenum (numbuf0, pch_hunk_beg() + old), - format_linenum (numbuf1, pch_hunk_beg() + new)); - } - else if (pch_char(new) == '!') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return false; - assert (outstate->after_newline); - if (R_do_defines) { - fprintf (fp, 1 + not_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_IFNDEF; - } - - do - { - if (R_do_defines) { - outstate->after_newline = pch_write_line (old, fp); - } - last_frozen_line++; - old++; - } - while (pch_char (old) == '!'); - - if (R_do_defines) { - fprintf (fp, outstate->after_newline + else_defined); - if (ferror (fp)) - write_fatal (); - def_state = IN_ELSE; - } - - do - { - outstate->after_newline = pch_write_line (new, fp); - new++; - } - while (pch_char (new) == '!'); - outstate->zero_output = false; - } - else { - assert(pch_char(new) == ' '); - old++; - new++; - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = true; - def_state = OUTSIDE; - } - } - } - if (new <= pat_end && pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - else if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->zero_output = false; - } - - do - { - if (! outstate->after_newline && putc ('\n', fp) == EOF) - write_fatal (); - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = false; - new++; - } - while (new <= pat_end && pch_char (new) == '+'); - } - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = true; - } - return true; -} - -/* Create an output file. */ - -static FILE * -create_output_file (char const *name, int open_flags) -{ - int fd = create_file (name, O_WRONLY | binary_transput | open_flags, - instat.st_mode); - FILE *f = fdopen (fd, binary_transput ? "wb" : "w"); - if (! f) - pfatal ("Can't create file %s", quotearg (name)); - return f; -} - -/* Open the new file. */ - -static void -init_output (char const *name, int open_flags, struct outstate *outstate) -{ - outstate->ofp = name ? create_output_file (name, open_flags) : (FILE *) 0; - outstate->after_newline = true; - outstate->zero_output = true; -} - -/* Open a file to put hunks we can't locate. */ - -static void -init_reject (void) -{ - int exclusive = TMPREJNAME_needs_removal ? 0 : O_EXCL; - TMPREJNAME_needs_removal = 1; - rejfp = create_output_file (TMPREJNAME, exclusive); -} - -/* Copy input file to output, up to wherever hunk is to be applied. */ - -static bool -copy_till (register struct outstate *outstate, register LINENUM lastline) -{ - register LINENUM R_last_frozen_line = last_frozen_line; - register FILE *fp = outstate->ofp; - register char const *s; - size_t size; - - if (R_last_frozen_line > lastline) - { - say ("misordered hunks! output would be garbled\n"); - return false; - } - while (R_last_frozen_line < lastline) - { - s = ifetch (++R_last_frozen_line, false, &size); - if (size) - { - if ((! outstate->after_newline && putc ('\n', fp) == EOF) - || ! fwrite (s, sizeof *s, size, fp)) - write_fatal (); - outstate->after_newline = s[size - 1] == '\n'; - outstate->zero_output = false; - } - } - last_frozen_line = R_last_frozen_line; - return true; -} - -/* Finish copying the input file to the output file. */ - -static bool -spew_output (struct outstate *outstate) -{ - if (debug & 256) - { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - say ("il=%s lfl=%s\n", - format_linenum (numbuf0, input_lines), - format_linenum (numbuf1, last_frozen_line)); - } - - if (last_frozen_line < input_lines) - if (! copy_till (outstate, input_lines)) - return false; - - if (outstate->ofp && ! outfile) - { - if (fclose (outstate->ofp) != 0) - write_fatal (); - outstate->ofp = 0; - } - - return true; -} - -/* Does the patch pattern match at line base+offset? */ - -static bool -patch_match (LINENUM base, LINENUM offset, - LINENUM prefix_fuzz, LINENUM suffix_fuzz) -{ - register LINENUM pline = 1 + prefix_fuzz; - register LINENUM iline; - register LINENUM pat_lines = pch_ptrn_lines () - suffix_fuzz; - size_t size; - register char const *p; - - for (iline=base+offset+prefix_fuzz; pline <= pat_lines; pline++,iline++) { - p = ifetch (iline, offset >= 0, &size); - if (canonicalize) { - if (!similar(p, size, - pfetch(pline), - pch_line_len(pline) )) - return false; - } - else if (size != pch_line_len (pline) - || memcmp (p, pfetch (pline), size) != 0) - return false; - } - return true; -} - -/* Do two lines match with canonicalized white space? */ - -static bool -similar (register char const *a, register size_t alen, - register char const *b, register size_t blen) -{ - /* Ignore presence or absence of trailing newlines. */ - alen -= alen && a[alen - 1] == '\n'; - blen -= blen && b[blen - 1] == '\n'; - - for (;;) - { - if (!blen || (*b == ' ' || *b == '\t')) - { - while (blen && (*b == ' ' || *b == '\t')) - b++, blen--; - if (alen) - { - if (!(*a == ' ' || *a == '\t')) - return false; - do a++, alen--; - while (alen && (*a == ' ' || *a == '\t')); - } - if (!alen || !blen) - return alen == blen; - } - else if (!alen || *a++ != *b++) - return false; - else - alen--, blen--; - } -} - -/* Make a temporary file. */ - -#if HAVE_MKTEMP && ! HAVE_DECL_MKTEMP && ! defined mktemp -char *mktemp (char *); -#endif - -#ifndef TMPDIR -#define TMPDIR "/tmp" -#endif - -static char const * -make_temp (char letter) -{ - char *r; -#if HAVE_MKTEMP - char const *tmpdir = getenv ("TMPDIR"); /* Unix tradition */ - if (!tmpdir) tmpdir = getenv ("TMP"); /* DOS tradition */ - if (!tmpdir) tmpdir = getenv ("TEMP"); /* another DOS tradition */ - if (!tmpdir) tmpdir = TMPDIR; - r = xmalloc (strlen (tmpdir) + 10); - sprintf (r, "%s/p%cXXXXXX", tmpdir, letter); - - /* It is OK to use mktemp here, since the rest of the code always - opens temp files with O_EXCL. It might be better to use mkstemp - to avoid some DoS problems, but simply substituting mkstemp for - mktemp here will not fix the DoS problems; a more extensive - change would be needed. */ - mktemp (r); - - if (!*r) - pfatal ("mktemp"); -#else - r = xmalloc (L_tmpnam); - if (! (tmpnam (r) == r && *r)) - pfatal ("tmpnam"); -#endif - return r; -} - -/* Fatal exit with cleanup. */ - -void -fatal_exit (int sig) -{ - cleanup (); - - if (sig) - exit_with_signal (sig); - - exit (2); -} - -static void -remove_if_needed (char const *name, int volatile *needs_removal) -{ - if (*needs_removal) - { - unlink (name); - *needs_removal = 0; - } -} - -static void -cleanup (void) -{ - remove_if_needed (TMPINNAME, &TMPINNAME_needs_removal); - remove_if_needed (TMPOUTNAME, &TMPOUTNAME_needs_removal); - remove_if_needed (TMPPATNAME, &TMPPATNAME_needs_removal); - remove_if_needed (TMPREJNAME, &TMPREJNAME_needs_removal); -} Property changes on: vendor/misc-GNU/patch/2.5.9/patch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/inp.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/inp.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/inp.c (nonexistent) @@ -1,468 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.c,v 1.25 2003/05/20 13:58:02 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - Copyright (C) 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -/* Input-file-with-indexable-lines abstract type */ - -static char *i_buffer; /* plan A buffer */ -static char const **i_ptr; /* pointers to lines in plan A buffer */ - -static size_t tibufsize; /* size of plan b buffers */ -#ifndef TIBUFSIZE_MINIMUM -#define TIBUFSIZE_MINIMUM (8 * 1024) /* minimum value for tibufsize */ -#endif -static int tifd = -1; /* plan b virtual string array */ -static char *tibuf[2]; /* plan b buffers */ -static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ -static LINENUM lines_per_buf; /* how many lines per buffer */ -static size_t tireclen; /* length of records in tmp file */ -static size_t last_line_size; /* size of last input line */ - -static bool plan_a (char const *); /* yield false if memory runs out */ -static void plan_b (char const *); -static void report_revision (bool); -static void too_many_lines (char const *) __attribute__((noreturn)); - -/* New patch--prepare to edit another file. */ - -void -re_input (void) -{ - if (using_plan_a) { - if (i_buffer) - { - free (i_buffer); - i_buffer = 0; - free (i_ptr); - } - } - else { - close (tifd); - tifd = -1; - if (tibuf[0]) - { - free (tibuf[0]); - tibuf[0] = 0; - } - tiline[0] = tiline[1] = -1; - tireclen = 0; - } -} - -/* Construct the line index, somehow or other. */ - -void -scan_input (char *filename) -{ - using_plan_a = ! (debug & 16) && plan_a (filename); - if (!using_plan_a) - plan_b(filename); - - if (verbosity != SILENT) - { - filename = quotearg (filename); - - if (verbosity == VERBOSE) - say ("Patching file %s using Plan %s...\n", - filename, using_plan_a ? "A" : "B"); - else - say ("patching file %s\n", filename); - } -} - -/* Report whether a desired revision was found. */ - -static void -report_revision (bool found_revision) -{ - char const *rev = quotearg (revision); - - if (found_revision) - { - if (verbosity == VERBOSE) - say ("Good. This file appears to be the %s version.\n", rev); - } - else if (force) - { - if (verbosity != SILENT) - say ("Warning: this file doesn't appear to be the %s version -- patching anyway.\n", - rev); - } - else if (batch) - fatal ("This file doesn't appear to be the %s version -- aborting.", - rev); - else - { - ask ("This file doesn't appear to be the %s version -- patch anyway? [n] ", - rev); - if (*buf != 'y') - fatal ("aborted"); - } -} - - -static void -too_many_lines (char const *filename) -{ - fatal ("File %s has too many lines", quotearg (filename)); -} - - -void -get_input_file (char const *filename, char const *outname) -{ - bool elsewhere = strcmp (filename, outname) != 0; - char const *cs; - char *diffbuf; - char *getbuf; - - if (inerrno == -1) - inerrno = stat (inname, &instat) == 0 ? 0 : errno; - - /* Perhaps look for RCS or SCCS versions. */ - if (patch_get - && invc != 0 - && (inerrno - || (! elsewhere - && (/* No one can write to it. */ - (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0 - /* Only the owner (who's not me) can write to it. */ - || ((instat.st_mode & (S_IWGRP|S_IWOTH)) == 0 - && instat.st_uid != geteuid ())))) - && (invc = !! (cs = (version_controller - (filename, elsewhere, - inerrno ? (struct stat *) 0 : &instat, - &getbuf, &diffbuf))))) { - - if (!inerrno) { - if (!elsewhere - && (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) != 0) - /* Somebody can write to it. */ - fatal ("File %s seems to be locked by somebody else under %s", - quotearg (filename), cs); - if (diffbuf) - { - /* It might be checked out unlocked. See if it's safe to - check out the default version locked. */ - - if (verbosity == VERBOSE) - say ("Comparing file %s to default %s version...\n", - quotearg (filename), cs); - - if (systemic (diffbuf) != 0) - { - say ("warning: Patching file %s, which does not match default %s version\n", - quotearg (filename), cs); - cs = 0; - } - } - } - - if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, - &instat)) - inerrno = 0; - - free (getbuf); - if (diffbuf) - free (diffbuf); - - } else if (inerrno && !pch_says_nonexistent (reverse)) - { - errno = inerrno; - pfatal ("Can't find file %s", quotearg (filename)); - } - - if (inerrno) - { - instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; - instat.st_size = 0; - } - else if (! S_ISREG (instat.st_mode)) - fatal ("File %s is not a regular file -- can't patch", - quotearg (filename)); -} - - -/* Try keeping everything in memory. */ - -static bool -plan_a (char const *filename) -{ - register char const *s; - register char const *lim; - register char const **ptr; - register char *buffer; - register LINENUM iline; - size_t size = instat.st_size; - - /* Fail if the file size doesn't fit in a size_t, - or if storage isn't available. */ - if (! (size == instat.st_size - && (buffer = malloc (size ? size : (size_t) 1)))) - return false; - - /* Read the input file, but don't bother reading it if it's empty. - When creating files, the files do not actually exist. */ - if (size) - { - int ifd = open (filename, O_RDONLY|binary_transput); - size_t buffered = 0, n; - if (ifd < 0) - pfatal ("can't open file %s", quotearg (filename)); - - while (size - buffered != 0) - { - n = read (ifd, buffer + buffered, size - buffered); - if (n == 0) - { - /* Some non-POSIX hosts exaggerate st_size in text mode; - or the file may have shrunk! */ - size = buffered; - break; - } - if (n == (size_t) -1) - { - /* Perhaps size is too large for this host. */ - close (ifd); - free (buffer); - return false; - } - buffered += n; - } - - if (close (ifd) != 0) - read_fatal (); - } - - /* Scan the buffer and build array of pointers to lines. */ - lim = buffer + size; - iline = 3; /* 1 unused, 1 for SOF, 1 for EOF if last line is incomplete */ - for (s = buffer; (s = (char *) memchr (s, '\n', lim - s)); s++) - if (++iline < 0) - too_many_lines (filename); - if (! (iline == (size_t) iline - && (size_t) iline * sizeof *ptr / sizeof *ptr == (size_t) iline - && (ptr = (char const **) malloc ((size_t) iline * sizeof *ptr)))) - { - free (buffer); - return false; - } - iline = 0; - for (s = buffer; ; s++) - { - ptr[++iline] = s; - if (! (s = (char *) memchr (s, '\n', lim - s))) - break; - } - if (size && lim[-1] != '\n') - ptr[++iline] = lim; - input_lines = iline - 1; - - if (revision) - { - char const *rev = revision; - int rev0 = rev[0]; - bool found_revision = false; - size_t revlen = strlen (rev); - - if (revlen <= size) - { - char const *limrev = lim - revlen; - - for (s = buffer; (s = (char *) memchr (s, rev0, limrev - s)); s++) - if (memcmp (s, rev, revlen) == 0 - && (s == buffer || ISSPACE ((unsigned char) s[-1])) - && (s + 1 == limrev || ISSPACE ((unsigned char) s[revlen]))) - { - found_revision = true; - break; - } - } - - report_revision (found_revision); - } - - /* Plan A will work. */ - i_buffer = buffer; - i_ptr = ptr; - return true; -} - -/* Keep (virtually) nothing in memory. */ - -static void -plan_b (char const *filename) -{ - register FILE *ifp; - register int c; - register size_t len; - register size_t maxlen; - register bool found_revision; - register size_t i; - register char const *rev; - register size_t revlen; - register LINENUM line = 1; - int exclusive; - - if (instat.st_size == 0) - filename = NULL_DEVICE; - if (! (ifp = fopen (filename, binary_transput ? "rb" : "r"))) - pfatal ("Can't open file %s", quotearg (filename)); - exclusive = TMPINNAME_needs_removal ? 0 : O_EXCL; - TMPINNAME_needs_removal = 1; - tifd = create_file (TMPINNAME, O_RDWR | O_BINARY | exclusive, (mode_t) 0); - i = 0; - len = 0; - maxlen = 1; - rev = revision; - found_revision = !rev; - revlen = rev ? strlen (rev) : 0; - - while ((c = getc (ifp)) != EOF) - { - len++; - - if (c == '\n') - { - if (++line < 0) - too_many_lines (filename); - if (maxlen < len) - maxlen = len; - len = 0; - } - - if (!found_revision) - { - if (i == revlen) - { - found_revision = ISSPACE ((unsigned char) c); - i = (size_t) -1; - } - else if (i != (size_t) -1) - i = rev[i]==c ? i + 1 : (size_t) -1; - - if (i == (size_t) -1 && ISSPACE ((unsigned char) c)) - i = 0; - } - } - - if (revision) - report_revision (found_revision); - Fseek (ifp, (off_t) 0, SEEK_SET); /* rewind file */ - for (tibufsize = TIBUFSIZE_MINIMUM; tibufsize < maxlen; tibufsize <<= 1) - continue; - lines_per_buf = tibufsize / maxlen; - tireclen = maxlen; - tibuf[0] = xmalloc (2 * tibufsize); - tibuf[1] = tibuf[0] + tibufsize; - - for (line = 1; ; line++) - { - char *p = tibuf[0] + maxlen * (line % lines_per_buf); - char const *p0 = p; - if (! (line % lines_per_buf)) /* new block */ - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - if ((c = getc (ifp)) == EOF) - break; - - for (;;) - { - *p++ = c; - if (c == '\n') - { - last_line_size = p - p0; - break; - } - - if ((c = getc (ifp)) == EOF) - { - last_line_size = p - p0; - line++; - goto EOF_reached; - } - } - } - EOF_reached: - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - - if (line % lines_per_buf != 0) - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - input_lines = line - 1; -} - -/* Fetch a line from the input file. - WHICHBUF is ignored when the file is in memory. */ - -char const * -ifetch (LINENUM line, bool whichbuf, size_t *psize) -{ - register char const *q; - register char const *p; - - if (line < 1 || line > input_lines) { - *psize = 0; - return ""; - } - if (using_plan_a) { - p = i_ptr[line]; - *psize = i_ptr[line + 1] - p; - return p; - } else { - LINENUM offline = line % lines_per_buf; - LINENUM baseline = line - offline; - - if (tiline[0] == baseline) - whichbuf = false; - else if (tiline[1] == baseline) - whichbuf = true; - else { - tiline[whichbuf] = baseline; - if (lseek (tifd, (off_t) (baseline/lines_per_buf * tibufsize), - SEEK_SET) == -1 - || read (tifd, tibuf[whichbuf], tibufsize) < 0) - read_fatal (); - } - p = tibuf[whichbuf] + (tireclen*offline); - if (line == input_lines) - *psize = last_line_size; - else { - for (q = p; *q++ != '\n'; ) - continue; - *psize = q - p; - } - return p; - } -} Property changes on: vendor/misc-GNU/patch/2.5.9/inp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/README =================================================================== --- vendor/misc-GNU/patch/2.5.9/README (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/README (nonexistent) @@ -1,54 +0,0 @@ -This version of `patch' has many changes made by the Free Software Foundation. -They add support for: - * handling arbitrary binary data and large files - * the unified context diff format that GNU diff can produce - * making GNU Emacs-style backup files - * improved interaction with RCS and SCCS - * the GNU conventions for option parsing and configuring and compilation. - * better POSIX compliance -They also fix some bugs. See the NEWS and ChangeLog files for details. - -Tutorial-style documentation for patch is included in the GNU -Diffutils package; get GNU Diffutils 2.8 or later for up-to-date -documentation for patch. - -For GNU and Unix build and installation instructions, see the file INSTALL. -Use `configure --disable-largefile' to disable large file support; -this is reportedly necessary on Red Hat GNU/Linux 6.0 to avoid a C library bug. -For MS-DOS using DJGPP tools, see the file pc/djgpp/README. -For other systems, copy config.hin to config.h and change -#undef statements in it to #define as appropriate for your system, -and copy Makefile.in to Makefile and set the variables that are -enclosed in @ signs as appropriate for your system. - -Please send bug reports for this version of patch to -. - -The Free Software Foundation is distributing this version of patch -independently because as of this writing, Larry Wall has not released a -new version of patch since mid-1988. We have heard that he has been -too busy working on other things, like Perl. He has graciously agreed -to let GNU `patch' be distributed under the terms of the GNU General -Public License. - ------- - -Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall - -Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1999, 2002 Free -Software Foundation, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this file; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/2.5.9/README ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/error.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/error.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/error.h (nonexistent) @@ -1,78 +0,0 @@ -/* Declaration for error-reporting function - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _ERROR_H -#define _ERROR_H 1 - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__STDC__) && __STDC__ - -/* Print a message with `fprintf (stderr, FORMAT, ...)'; - if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). - If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ - -extern void error (int status, int errnum, const char *format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); - -extern void error_at_line (int status, int errnum, const char *fname, - unsigned int lineno, const char *format, ...) - __attribute__ ((__format__ (__printf__, 5, 6))); - -/* If NULL, error will flush stdout, then print on stderr the program - name, a colon and a space. Otherwise, error will call this - function without parameters instead. */ -extern void (*error_print_progname) (void); - -#else -void error (); -void error_at_line (); -extern void (*error_print_progname) (); -#endif - -/* This variable is incremented each time `error' is called. */ -extern unsigned int error_message_count; - -/* Sometimes we want to have at most one error per line. This - variable controls whether this mode is selected or not. */ -extern int error_one_per_line; - -#ifdef __cplusplus -} -#endif - -#endif /* error.h */ Property changes on: vendor/misc-GNU/patch/2.5.9/error.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/stdbool.h.in =================================================================== --- vendor/misc-GNU/patch/2.5.9/stdbool.h.in (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/stdbool.h.in (nonexistent) @@ -1,47 +0,0 @@ -/* Copyright (C) 2001-2002 Free Software Foundation, Inc. - Written by Bruno Haible , 2001. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _STDBOOL_H -#define _STDBOOL_H - -/* ISO C 99 for platforms that lack it. */ - -/* 7.16. Boolean type and values */ - -/* BeOS already #defines false 0, true 1. We use the same - definitions below, but temporarily we have to #undef them. */ -#ifdef __BEOS__ -# undef false -# undef true -#endif - -/* For the sake of symbolic names in gdb, define _Bool as an enum type. */ -#ifndef __cplusplus -# if !@HAVE__BOOL@ -typedef enum { false = 0, true = 1 } _Bool; -# endif -#else -typedef bool _Bool; -#endif -#define bool _Bool - -/* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 -#define __bool_true_false_are_defined 1 - -#endif /* _STDBOOL_H */ Property changes on: vendor/misc-GNU/patch/2.5.9/stdbool.h.in ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/strncasecmp.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/strncasecmp.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/strncasecmp.c (nonexistent) @@ -1,2 +0,0 @@ -#define LENGTH_LIMIT -#include "strcasecmp.c" Property changes on: vendor/misc-GNU/patch/2.5.9/strncasecmp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/ChangeLog =================================================================== --- vendor/misc-GNU/patch/2.5.9/ChangeLog (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/ChangeLog (nonexistent) @@ -1,2291 +0,0 @@ -2003-05-20 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.9 released. - - * Makefile.in (HDRS): Add gettext.h. - - Use bool, not int, for booleans. - - * pch.c (pch_says_nonexistent): Returns int, not bool. - - * configure.ac: Add AM_STDBOOL_H. - - * Makefile.in (MISC): Add stdbool.h.in. - (stdbool.h): New rule. - (ACINCLUDE_INPUTS): Add stdbool.m4. - (mostlyclean): Remove stdbool.h. - (COMMON): New macro; use it instead of common.h for dependencies. - - * common.h: Include . - Remove TRUE, FALSE, bool. All uses changed to standard names. - - * common.h (reverse, set_time, set_utc): - Use bool, not int, for booleans. - * pch.c (p_strip_trailing_cr, p_pass_comments_through, - prefix_components, pget_line, re_patch, - there_is_another_patch, intuit_diff_type, scan_linenum, - another_hunk, pget_line, pch_timestamp): Likewise. - * inp.h (ifetch): Likewise. - * util.c (move_file, version_controller, version_get, ok_to_reverse, - set_signals): Likewise. - * inp.c (report_revision, get_input_file, plan_a, plan_b, ifetch): - Likewise. - * util.h (ok_to_reverse, version_controller, version_get, - move_file, set_signals): Likewise. - * pch.h (another_hunk, pch_says_nonexistent, pch_timestamp): - Likewise. - * patch.c (struct outstate, numeric_string, make_backups, - backup_if_mismatch, remove_empty_files, - reverse_flag_specified, main, reinitialize_almost_everything, - get_some_switches, apply_hunk, init_output, copy_till): - Likewise. - -2003-05-18 Paul Eggert - - * pch.c (p_pass_comments_through): New var. - (pget_line): Accept new arg for pass_comments_through. - All callers changed. - (there_is_another_patch): Do not suggest -p for ed diffs. - (intuit_diff_type): Check ed command for correct syntax. - Do not set p_strip_trailing_cr merely because a -p line contains a CR. - (get_ed_command_letter): New function. - (do_ed_script): Use it. Do not treat '#' data lines as comments in ed - scripts. - - * util.c (move_file): - Don't assume that when 'rename(A,B)' succeeds then A no - longer exists. This is not true of POSIX 1003.1-2001 rename when A - and B are links to the same file. - (fetchname): Fix test for file names with internal spaces. - - * version.c: Don't include patchlevel.h. - (version): Use PACKAGE_NAME and PACKAGE_VERSION instead of obsolete - PROGRAM_NAME and PATCH_VERSION. - (copyright_string): Bump to 2003. - - * common.h (FILESYSTEM_PREFIX_LEN, ISSLASH): - Remove; now done by 'configure'. - (PROGRAM_NAME): Remove; now done by 'configure' as PACKAGE_NAME. - - * patch.c: Do not include . - (main): Set xalloc_exit_failure, not exit_failure. - Add "&& !skip_rest_of_patch" when deciding to continue ed scripts. - (option_help): Use PACKAGE_BUGREPORT rather than hardcoding. - - * configure.ac (AC_PREREQ): Bump to 2.57. - (AC_GNU_SOURCE): Add, early on. - (gl_BACKUPFILE, gl_DIRNAME, gl_ERROR, gl_FUNC_MEMCHR, gl_FUNC_RMDIR, - gl_GETOPT, gl_PREREQ_XMALLOC, gl_QUOTE, gl_QUOTEARG): Add. - (jm_PREREQ_ADDEXT): Add, with definition. - (jm_PREREQ_DIRNAME, jm_PREREQ_ERROR, jm_PREREQ_MEMCHR, - jm_PREREQ_QUOTEARG): Remove. - (AC_REPLACE_FUNCS): Remove memchr, rename, rmdir). - (jm_FUNC_GLIBC_UNLOCKED_IO, jm_AC_DOS): Add. - (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Do not call directly. - (AC_OUTPUT): Use new style, with AC_CONFIG_FILES. - - Update to current CVS gnulib. - - * exitfail.c, exitfail.h, patchlevel.h, rename.c, m4/c-bs-a.m4, - m4/jm-glibc-io.m4, m4/prereq.m4: Remove. - * m4/backupfile.m4, m4/dirname.m4, m4/dos.m4, m4/getopt.m4, - m4/memchr.m4, m4/onceonly.m4, m4/quote.m4, m4/quotearg.m4, - m4/rmdir.m4, m4/unlocked-io.m4, m4/xalloc.m4: New files. - * Makefile.in (LIBSRCS): Move error.c here from SRCS. - Remove rename.c. - (OBJS): Remove error.$(OBJEXT). - (HDRS): Remove exitfail.h, patchlevel.h. - (ACINCLUDE_INPUTS): Remove c-bs-a.m4, jm-glibc-io.m4, prereq.m4. - Add backupfile.m4, dirname.m4, dos.m4, getopt.m4, memchr.m4, - onceonly.m4, quote.m4, quotearg.m4, rmdir.m4, unlocked-io.m4, - xalloc.m4. - (patchlevel.h): Remove. All uses removed. - (argmatch.$(OBJEXT), error.$(OBJEXT), quotesys.$(OBJEXT)), - xmalloc.$(OBJEXT)): Depend on gettext.h. - (dirname.$(OBJEXT), quote.$(OBJEXT), strncasecmp.$(OBJEXT)): New rules. - (patch.$(OBJEXT), xmalloc.$(OBJEXT)): Remove exitfail.h. - (rename.$(OBJEXT)): Remove. - (version.$(OBJEXT)): Remove util.h. - (xmalloc.$(OBJEXT)): Add error.h. - -2002-11-23 Paul Eggert - - * patch.c (main): Don't check for zero-sized file after 'ed' - when skipping patch. From Michael Fedrowitz. - -2002-06-03 Paul Eggert - - * configure.ac (AC_OUTPUT): Use new form, with AC_CONFIG_FILES, - instead of obsolescent form. Patch from Art Haas. - - * pch.c (intuit_diff_type): Do not warn about trailing white space - after Prereq: word. Bug reported by Mike Castle. - -2002-06-02 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.8 released. - - * README: POSIX.2 -> POSIX. - * inp.c (report_revision): Don't modify 'revision', since - it gets freed later. Bug reported by Mike Castle. - -2002-05-30 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.7 released. - - * Makefile.in (MISC): Remove README-alpha. - (patchlevel.h): Depend on configure, not configure.ac. - - * INSTALL: Upgrade to Autoconf 2.53 version. - -2002-05-28 Paul Eggert - - * patch.c (end_defined, apply_hunk): Output #endif without - the comment, as POSIX 1003.1-2001 requires. - - * pch.c (there_is_another_patch): Flush stderr after perror. - - * NEWS, configure.ac (AC_INIT): Version 2.5.6 released. - - * strcasecmp.c, strncasecmp.c: New files, taken from fileutils. - * config.guess, config.sub: Remove. - * Makefile.in (LIBSRCS): Add strcasecmp.c, strncasecmp.c. - (MISC): Remove config.guess, config.sub. - - The code already assumes C89 or better, so remove K&R stuff. - * common.h (volatile): Remove. - (GENERIC_OBJECT): Remove; all uses changed to 'void'. - (PARAMS): Remove; all uses changed to prototypes. - * configure.ac (AC_PROG_CC_STDC): Add. - * util.c (vararg_start): Remove. All uses changed to va_start. - Always include . - - * configure.ac (AC_CANONICAL_HOST): Remove. - (AC_REPLACE_FUNCS): Add strncasecmp. - (AC_CHECK_DECLS): Add mktemp. - - * patch.c (main): Remove useless prototype decl. - (mktemp): Don't declare if HAVE_DECL_MKTEMP || defined mktemp. - (make_temp): Now accepts char, not int. - -2002-05-26 Paul Eggert - - * patch.c (not_defined): Prepend newline. All uses changed. - (apply_hunk): Fix bug: -D was outputting #ifdef when it should - have been outputting #ifndef. Bug report and partial fix by - Jason Short. - - * pch.c (intuit_diff_type): When reading an ed diff, don't use - indent and trailing-CR-ness of "." line; instead, use that of the - command. Bug reported by Anthony Towns; partial fix by Michael - Fedrowitz. - (intuit_diff_type): If the index line exists, don't report a - missing header. Fix by Chip Salzenberg. - -2002-05-26 Alessandro Rubini - - * patch.c (locate_hunk): Fixed updating of last_offset. - -2002-05-25 Paul Eggert - - * NEWS, README: Diffutils doc is up to date now. - Bug reporting address is now . - * README: Describe '--disable-largefile'. - - * NEWS-alpha, dirname.c, dirname.h, exitfail.c, exitfail.h, - quote.c, quote.h, unlocked-io.h: New files, taken from diffutils - and fileutils. - - * argmatch.c: [STDC_HEADERS]: Include stdlib.h, for 'exit'. - - * addext.c, argmatch.c, argmatch.h, backupfile.c, basename.c: - Update from diffutils and fileutils. - - * ansi2knr.1, ansi2knr.c: Remove. - - * common.h: HAVE_SETMODE && O_BINARY -> HAVE_SETMODE_DOS. - * patch.c (usage): Likewise. - * pch.c (open_patch_file): Likewise. - - * configure.ac: Renamed from configure.in. Add copyright notice. - (AC_PREREQ): Bump to 2.53. - (AC_INIT): Use 2.5x style. - (AC_CONFIG_SRCDIR): Add. - (PACKAGE, VERSION): Remove. - (AC_C_PROTOTYPES): Use this instead of AM_C_PROTOTYPES. - (jm_CHECK_TYPE_STRUCT_UTIMBUF): Use this instead of jm_STRUCT_UTIMBUF. - (jm_PREREQ_ADDEXT, jm_PREREQ_DIRNAME, jm_PREREQ_ERROR, - jm_PREREQ_MEMCHR, jm_PREREQ_QUOTEARG): Add. - (AC_CHECK_DECLS): Add free, getenv, malloc. - (AC_CHECK_FUNCS): Remove setmode. - (AC_FUNC_SETMODE_DOS): Add. - (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use this instead of - jm_STRUCT_DIRENT_D_INO. - - * Makefile.in (OBJEXT): New var. - (PACKAGE_NAME): Renamed from PACKAGE. All uses changed. - (PACKAGE_VERSION): Renamed from VERSION. All uses changed. - (U): Remove. All uses of "$U.o" changed to ".$(OBJEXT)". - (LIBSRCS): REmove getopt.c getopt1.c. Add mkdir.c, rmdir.c. - (SRCS): Add dirname.c, exitfail.c, getopt.c, getopt1.c, quote.c. - Remove mkdir.c. - (OBJS): Keep in sync with SRCS. - (HDRS): Remove basename.h. - Add dirname.h, exitfail.h, quote.h, unlocked-io.h. - (MISC, configure, config.hin, patchlevel.h): - configure.ac renamed from configure.in. - (MISC): Add README-alpha. Remove ansi2knr.1, ansi2knr.c. - (.c.$(OBJEXT)): Renamed from .c.o. - (ACINCLUDE_INPUTS): Add c-bs-a.m4, error.m4, jm-glibc-io.m4, - mbstate_t.m4, mkdir.m4, mbrtowc.m4, prereq.m4, setmode.m4. - Remove ccstdc.m4, inttypes_h.m4, largefile.m4, protos.m4. - (mostlyclean): Don't clean ansi2knr. - (ansi2knr.o, ansi2knr): Remove. - Redo dependencies. - - * patch.c: Include . - (main): Initialize exit_failure. - - * patch.man: Update copyright notice. - - * pch.c, util.c: Include , not . - - * version.c (copyright_string): Update copyright notice. - -2002-02-17 Paul Eggert - - * partime.c (parse_pattern_letter): Don't overrun buffer if it - contains only alphanumerics. Bug reported by Winni - . - -2001-07-28 Paul Eggert - - * util.c (fetchname), NEWS: - Allow file names with internal spaces, so long as they - don't contain tabs. - - * pch.c (intuit_diff_type): Do not allow Prereq with multiple words. - - * configure.in (AC_PREREQ): Bump to 2.50. - (AC_CHECK_FUNCS): Remove fseeko. - (AC_FUNC_FSEEKO): Add. - * Makefile.in (ACINCLUDE_INPUTS): - Remove largefile.m4; no longer needed with Autoconf 2.50. - -2001-02-07 "Tony E. Bennett" - - * util.c (PERFORCE_CO): New var. - (version_controller): Support Perforce. - * patch.man: Document this. - -2000-06-30 Paul Eggert - - * patch.man: Ignore comment lines. - - * NEWS, pch.c: Ignore lines beginning with "#". - -1999-10-24 Paul Eggert - - * pch.c (another_hunk): Report a fatal error if a regular - context hunk's pattern has a different number of unchanged - lines than the replacement. - -1999-10-18 Paul Eggert - - * patch.c (main): If we skipped an ed patch, exit with nonzero status. - -1999-10-17 Paul Eggert - - * patch.c (main): Apply do_ed_script even if dry_run, because - we need to make progress on the patch file. - * pch.c (do_ed_script): If skip_rest_of_patch is nonzero, - gobble up the patch without any other side effect. - -1999-10-12 Paul Eggert - - * NEWS, README: New bug reporting address. - * NEWS: Report change in 2.5.4 that we forgot to document. - * README: Document `configure --disable-largefile'. - - * basename.c, COPYING, getopt.c, getopt.h, getopt1.c, m4/largefile.m4: - Update to latest version. - * Makefile.in (basename$U.o): Depend on basename.h. - (config.hin): Depend on $(srcdir)/aclocal.m4. - - * ansi2knr.c, maketime.c, mkinstalldirs, partime.c: Fix $Id. - - FreeBSD has an unrelated setmode function; work around this. - * common.h (binary_transput): Don't declare unless O_BINARY. - * patch.c (option_help, get_some_switches): - Don't use setmode unless O_BINARY. - * pch.c (open_patch_file): Don't invoke setmode unless O_BINARY. - - Fix incompatiblities with error.c. - * common.h (program_name): Now XTERN char *, for compatibility - with error.c. All uses changed. - (PROGRAM_NAME): New macro. - (PARAMS): Use ANSI C version only if defined PROTOTYPES - || (defined __STDC__ && __STDC__), for compatibilty with error.c. - * util.c (vararg_start): Likewise. - * patch.c (program_name): Remove. - (main): Initialize program_name. - * version.c (version): Print PROGRAM_NAME, not program_name. - - Accommodate mingw32 port, which has one-argument mkdir (yuck!) - and no geteuid. - * m4/mkdir.m4: New file. - * Makefile.in (ACINCLUDE_INPUTS): Add $(M4DIR)/mkdir.m4. - * configure.in (AC_CHECK_FUNCS): Add geteuid, getuid. - (PATCH_FUNC_MKDIR_TAKES_ONE_ARG): Add. - * common.h (mkdir): Define if mkdir takes one arg. - (geteuid): New macro, if not already defined. - -1999-10-11 Christopher R. Gabriel - - * patch.c (option_help): Updated bug report address - * configure.in (VERSION): Version 2.5.5 released. - -1999-09-01 Paul Eggert - - * patch.c (main): Default simple_backup_suffix to ".orig". - -1999-10-08 Paul Eggert - - * patch.man: Make it clear that `patch -o F' should not be - used if F is one of the files to be patched. - -1999-08-30 Paul Eggert - - Version 2.5.4 fixes a few minor bugs, converts C sources to - ANSI prototypes, and modernizes auxiliary sources and autoconf - scripts. - - * configure.in (VERSION): Version 2.5.4 released. - (AC_CANONICAL_HOST): Add. - (AC_SYS_LARGEFILE): Add, replacing inline code. - (AC_EXEEXT): Add. - (jm_AC_HEADER_INTTYPES_H): Add, replacing inline code. - (AC_TYPE_PID_T): Add. - (jm_STRUCT_UTIMBUF): Add, replacing inline code. - (HAVE_MEMCHR): Remove obsolescent test; nobody uses NetBSD 1.0 now. - (getopt_long): Append $U to object file basenames. - (AC_CHECK_FUNCS): Add fseeko, setmode. Remove mkdir. - (AC_REPLACE_FUNCS): Add mkdir, rmdir. - (jm_STRUCT_DIRENT_D_INO): Add, replacing inline code. - - * Makefile.in (EXEEXT): New macro. - (mandir): New macro. - (man1dir): Define in terms of mandir. - (SRCS): Add mkdir.c, rmdir.c. - (OBJS): Change .o to $U.o for addext, argmatch, backupfile, basename, - error, inp, patch ,,pch, quotearg, util, version, xmalloc. - (HDRS): Add basename.h, patchlevel.h. - (MISC): Add ansi2knr.1, config.guess, config.sub. - (MISC, config.hin): Remove acconfig.h; no longer needed. - (DISTFILES_M4): New macro. - (all): patch -> patch$(EXEEXT). - (patch$(EXEEXT)): Renamed from patch. All uses changed. - (uninstall): Remove manual page. - (configure): Depend on aclocal.m4. - (M4DIR, ACINCLUDE_INPUTS): New macros. - ($(srcdir)/aclocal.m4): New rule. - (patchlevel.h): Depend on configure.in, not Makefile, - since we now distribute it. - (distclean): Don't remove patchlevel.h. - (dist): Distribute $(DISTFILES_M4). - (addext_.c argmatch_.c backupfile_.c basename_.c error_.c - getopt_.c getopt1_.c inp_.c malloc_.c mkdir_.c patch_.c pch_.c - rename_.c util_.c version_.c xmalloc_.c): Depend on ansi2knr. - Update dependencies to match sources. - - * common.h (_LARGEFILE_SOURCE): Remove; now autoconfigured. - (file_offset): Depend on HAVE_FSEEKO, not _LFS_LARGEFILE. - - * patch.c (version_control_context): New variable. - Convert to ANSI prototypes. - Adjust to new argmatch calling convention. - Similarly for get_version. - Complain about creating an existing file only if - pch_says_nonexistent returns 2 (not merely nonzero). - Similarly for time mismatch check. - (get_some_switches): Adjust to new get_version calling convention. - Similarly for argmatch. - - * pch.c (): Include. - (intuit_diff_type): Improve quality of test for empty file. - (another_hunk): Don't assume off_t is no longer than long. - - * util.h (backup_type): New decl. - * util.c (): Include. - (move_file): Adjust to new find_backup_file_name convention. - (doprogram, mkdir, rmdir): Remove; now in separate files. - (fetchame): Match "/dev/null", not NULL_DEVICE. - Ignore names that don't have enough slashes to strip off. - - * version.c: Update copyright notice. - -1998-03-20 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.3. - * quotearg.h (quotearg_quoting_options): - Remove; it ran afoul of the Borland C compiler. - Its address is now represented by the null pointer. - * quotearg.c (default_quoting_options): - Renamed from quotearg_quoting_options, - and now static instead of extern. - (clone_quoting_options, get_quoting_style, set_quoting_style, - set_char_quoting, quotearg_buffer): - Use default_quoting_options when passed a null pointer. - * patch.c (main, get_some_switches): - Pass a null pointer instead of address of quotearg_quoting_options. - -1998-03-17 Paul Eggert - - * patch.c (option_help): Update bug reporting address to gnu.org. - * patch.man: Fix copyright and bug reporting address. - -1998-03-16 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.2. - (AC_CHECK_FUNCS): Add strerror. - (jm_FUNC_MALLOC, jm_FUNC_REALLOC): Add. - (AM_C_PROTOTYPES): Add. - - * NEWS, patch.c (longopts, get_some_switches), patch.man: - Add --quoting-style, --posix options. - - * Makefile.in (LIBSRCS): Add malloc.c, realloc.c. - (SRCS): Add error.c, quotesys.c, xmalloc.c. - (OBJS): Likewise. - (HDRS): Add error.h, quotesys.h, xalloc.h. - (MISC): Add AUTHORS, aclocal.m4, ansi2knr.c. - (clean): Use mostlyclean rule. - (argmatch.o, inp.o, patch.o, pch.o): Now also depends on quotearg.h. - (inp.o, patch.o, util.o): Now also depends on xalloc.h. - (error.o, quotearg.o, quotesys.o, xmalloc.o, - ansi2knr.o, ansi2knr, quotearg_.c, .c_.c): New rules. - (U): New macro. - (OBJS, quotearg$U.o): Rename quotearg.o to quotearg$U.o. - (mostlyclean): Remove ansi2knr, *_.c. - (.SUFFIXES): Add _.c. - - * acconfig.h (PROTOTYPES): New undef. - - * acconfig.h, configure.in (HAVE_INTTYPES_H, malloc, realloc): - New macros. - - * aclocal.m4, error.c, error.h, malloc.c, - quotearg.h, quotearg.c, realloc.c, xalloc.h, xmalloc.c: New files. - - * argmatch.c: Include before . - Include . - - * argmatch.c (invalid_arg), - inp.c (scan_input, report_revision, too_many_lines, get_input_file, - plan_a), - patch.c (main, get_some_switches, numeric_string), - pch.c (open_patch_file, intuit_diff_type, do_ed_script): - util.c (move_file, create_file, copy_file, version_get, removedirs): - Quote output operands properly. - - * common.h: Include if available. - (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, - CHAR_MAX, INT_MAX, LONG_MIN, SIZE_MAX, O_EXCL): New macros. - (TMPINNAME_needs_removal, TMPOUTNAME_needs_removal, - TMPPATNAME_needs_removal): New variables. - (xmalloc): Remove decl; now in xalloc.h. - - * inp.c: Include , . - - * inp.c (get_input_file), - pch.c (intuit_diff_type), - util.c (version_controller): - Don't do diff operation if diffbuf is null; used by ClearCase support. - - * inp.c (plan_b), - patch.c (init_reject), - pch.c (open_patch_file, do_ed_script): - Create temporary file with O_EXCL to avoid races. - - * patch.c: Include , . - (create_output_file, init_output): New open_flags arg. - All callers changed. - (init_reject): No longer takes filename arg. All callers changed. - (remove_if_needed): New function. - (cleanup): Use it to remove temporary files only if needed. - (TMPREJNAME_needs_removal): New var. - (main): Set xalloc_fail_func to memory_fatal; needed for xalloc. - Initialize quoting style from QUOTING_STYLE. - (longopts, get_some_switches): Offset longarg options by CHAR_MAX, - not 128; this is needed for EBCDIC ports. - - * patch.c (main, locate_hunk, abort_hunk, spew_output), - pch.c (there_is_another_patch, intuit_diff_type, malformed, - another_hunk): - The LINENUM type now might be longer than long, - so print and read line numbers more carefully. - - * patch.c (main), - pch.c (there_is_another_patch): - util.c (fetchname): - strippath now defaults to -1, so that we can distinguish unset - value from largest possible. - - * patch.man: Clarify how file name is chosen from candidates. - - * pch.c: Include . - (p_strip_trailing_cr): New variable. - (scan_linenum): New function. - (pget_line, re_patch, there_is_another_patch, intuit_diff_type, - get_line): Strip trailing CRs from context diffs that need this. - (best_name): Use SIZE_MAX instead of (size_t) -1 for max size_t. - - * quotesys.c, quotearg.h: Renamed from quotearg.c and quotearg.h. - All uses changed. - * quotesys.h (__QUOTESYS_P): Renamed from __QUOTEARG_P. - - * util.c: Include , . - (raise): Don't define if already defined. - (move_file): New arg from_needs_removal. All callers changed. - (copy_file): New arg to_flags. All callers changed. - (CLEARTOOL_CO): New constant. - (version_controller): Add ClearCase support. - (format_linenum): New function. - (fetchname): Allow any POSIX.1 time zone spec, which means - any local time offset in the range -25:00 < offset < +26:00. - Ignore the name if it doesn't have enough slashes to strip off. - (xmalloc): Remove; now in xmalloc.c. - - * util.h (LINENUM_LENGTH_BOUND): New macro. - (format_linenum): New decl. - - * version.c (copyright_string): Update years of copyrights. - -1997-09-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.1. - * inp.c (re_input): Don't free buffers twice when input is garbled. - * patch.c (main): If skipping patch and Plan A fails, don't - bother trying Plan B. - -1997-08-31 Paul Eggert - - * configure.in (VERSION): Version 2.5 released. - -1997-07-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.4. - * pch.c (there_is_another_patch), NEWS: Report an error if the patch - input contains garbage but no patches. - - * pch.c (open_patch_file): - Check for patch file too long (i.e., its size - doesn't fit in a `long', and LFS isn't available). - - * inp.c (plan_a): - Cast malloc return value, in case malloc returns char *. - -1997-07-16 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.3. - - * NEWS, patch.man, pch.c (intuit_diff_type, get_line, pget_line): - Now demangles RFC 934 encapsulation. - * pch.c (p_rfc934_nesting): New var. - - * pch.c (intuit_diff_type): Don't bother to check file names carefully - if we're going to return NO_DIFF. - - * inp.c (plan_a): Count the number of lines before allocating - pointer-to-line buffer; this reduces memory requirements - considerably (roughly by a factor of 5 on 32-bit hosts). - Decrease `size' only when read unexpectedly reports EOF. - (i_buffer): New var. - (too_many_lines): New fn. - (re_input): Free i_buffer if using plan A. - Free buffers unconditionally; they can't be zero. - - * inp.c (plan_a, plan_b): Check for overflow of line counter. - - * pch.c (malformed), util.h (memory_fatal, read_fatal, write_fatal): - Declare as noreturn. - -1997-07-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.2. - - * util.c (ok_to_reverse), NEWS: The default answer is now `n'; - this is better for Emacs. - - * Makefile.in (dist): Use cp -p, not ln; - some hosts do the wrong thing with ln if the source is a symbolic link. - - * patch.man: Fix typo: -y -> -Y. - -1997-07-05 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.1. - - * patch.c: (main, get_some_switches), NEWS, patch.man: - Version control is now independent of whether backups are made. - * patch.c (option_help): Put version control options together. - (get_some_switches): With CVS 1.9 hack, treat -b foo like -b -z foo, - not just -z foo. This change is needed due to recent change in -z. - * backupfile.c (find_backup_file_name): - backup_type == none causes undefined behavior; - this undoes the previous change to this file. - - * patch.c (locate_hunk): Fix bug when locating context diff hunks - near end of file with nonzero fuzz. - - * util.c (move_file): Don't assume that ENOENT is reported when both - ENOENT and EXDEV apply; this isn't true with DJGPP, and - Posix doesn't require it. - - * pch.c (there_is_another_patch): - Suggest -p when we can't intuit a file. - -1997-06-19 Paul Eggert - - * configure.in (VERSION): Version 2.4 released. - * NEWS: Patch is now verbose when patches do not match exactly. - -1997-06-17 Paul Eggert - - * pc/djgpp/configure.sed (config.h): Remove redundant $(srcdir). - - * configure.in (VERSION): Bump to 2.3.9. - * patch.c (main): By default, warn about hunks that succeed - with nonzero offset. - * patch.man: Add LC_ALL=C advice for making patches. - * pc/djgpp/configure.sed (config.h): Fix paths to dependent files. - -1997-06-17 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.8. - - * pch.c (open_patch_file): Test stdin for fseekability. - (intuit_diff_type): Missing context diff headers are now warnings, - not errors; some people use patches with them (e.g. when retrying - rejects). - - * patch.c (struct outstate): - New type, collecting together some output state vars. - (apply_hunk, copy_till, spew_output, init_output): Use it. - Keep track of whether some output has been generated. - (backup_if_mismatch): New var. - (ofp): Remove, in favor of local struct outstate vars. - (main): Use struct outstate. Initialize backup_if_mismatch to - be the inverse of posixly_correct. Keep track of whether mismatches - occur, and use this to implement backup_if_mismatch. - Report files that are not empty after patching, but should be. - (longopts, option_help, get_some_switches): New options - --backup-if-mismatch, --no-backup-if-mismatch. - (get_some_switches): -B, -Y, -z no longer set backup_type. - * backupfile.c (find_backup_file_name): - Treat backup_type == none like simple. - - * Makefile.in (CONFIG_HDRS): - Remove var; no longer needed by djgpp port. - (DISTFILES_PC_DJGPP): Rename pc/djgpp/config.sed to - pc/djgpp/configure.sed; remove pc/djgpp/config.h in favor of - new file that edits it, called pc/djgpp/config.sed. - * pc/djgpp/configure.bat: Rename config.sed to configure.sed. - * pc/djgpp/configure.sed (CONFIG_HDRS): Remove. - (config.h): Add rule to build this from config.hin and - pc/djgpp/config.sed. - * pc/djgpp/config.sed: - Convert from .h file to .sed script that generates .h file. - - * NEWS: Describe --backup-if-mismatch, --no-backup-if-mismatch. - * patch.man: - Describe new options --backup-if-mismatch, --no-backup-if-mismatch - and their ramifications. Use unreadable backup to represent - nonexistent file. - -1997-06-12 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.7. - (AC_CHECK_FUNCS): Add `raise'. - - * Makefile.in (inp.o): No longer depends on quotearg.h. - - * common.h (outfile): New decl (was private var named `output'). - (invc): New decl. - (GENERIC_OBJECT): Renamed from VOID. - (NULL_DEVICE, TTY_DEVICE): New macros. - - * patch.c (output): Remove; renamed to `outfile' and moved to common.h. - (main): `failed' is count, not boolean. - Say "Skipping patch." when deciding to skip patch. - (get_some_switches): Set invc when setting inname. - - * inp.c: Do not include . - (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF1, SCCSDIFF2, SCCSDIFF3, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1, RCSDIFF2): - Move to util.c. - (get_input_file): Invoke new functions version_controller and - version_get to simplify this code. - (plan_b): "/dev/tty" -> NULL_DEVICE - - * pch.h (pch_timestamp): New decl. - * pch.c (p_timestamp): New var; takes over from global timestamp array. - (pch_timestamp): New function to export p_timestamp. - (there_is_another_patch): Use blander wording when you can't intuit - the file name. - Say "Skipping patch." when deciding to skip patch. - (intuit_diff_type): Look for version-controlled but nonexistent files - when intuiting file names; set invc accordingly. - Ignore Index: line if either old or new line is present, and if - POSIXLY_CORRECT is not set. - (do_ed_script): Flush stdout before invoking popen, since it may - send output to stdout. - - * util.h (version_controller, version_get): New decls. - * util.c: Include earlier. - (raise): New macro, if ! HAVE_RAISE. - (move_file): Create empty unreadable file when backing up a nonexistent - file. - (DEV_NULL): New constant. - (SCCSPREFIX, GET. GET_LOCKED, SCCSDIFF1, SCCSDIFF2, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c. - (version_controller, version_get): New functions. - (ask): Look only at /dev/tty for answers; and when standard output is - not a terminal and ! posixly_correct, don't even look there. - Remove unnecessary fflushes of stdout. - (ok_to_reverse): Say "Skipping patch." when deciding to skip patch.. - (sigs): SIGPIPE might not be defined. - (exit_with_signal): Use `raise' instead of `kill'. - (systemic): fflush stdout before invoking subsidiary command. - - * patch.man: Document recent changes. - Add "COMPATIBILITY ISSUES" section. - - * NEWS: New COMPATIBILITY ISSUES for man page. - Changed verbosity when fuzz is found. - File name intuition is changed, again. - Backups are made unreadable when the file did not exist. - - * pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): Define. - (HAVE_RAISE): New macro. - (HAVE_UTIME_H): Define. - (TZ_is_unset): Do not define; it's not a serious problem with `patch' - to have TZ be unset in DOS. - -1997-06-08 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.6. - (AC_CHECK_HEADERS): Add utime.h. - * acconfig.h, configure.in, pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): - New macro. - * pc/djgpp/config.h (HAVE_UTIME_H, TZ_is_unset): New macros. - - * NEWS, patch.man: Describe new -Z, -T options, new numeric - option for -G, retired -G, and more verbose default behavior - with fuzz. - - * pch.c (intuit_diff_type): Record times reported for files in headers. - Remove head_says_nonexistent[x], since it's now equivalent to - !timestamp[x]. - * util.h (fetchname): Change argument head_says_nonexistent to - timestamp. - * util.c: #include for TM_LOCAL_ZONE. - Don't include since common.h now includes it. - (ok_to_reverse): noreverse and batch cases now output regardless of - verbosity. - (fetchname): Change argument head_says_nonexistent to pstamp, and - store header timestamp into *pstamp. - If -T or -Z option is given, match time stamps more precisely. - (ask): Remove unnecessary close of ttyfd. - When there is no terminal at all, output a newline to make the - output look nicer. After reporting EOF, flush stdout; - when an input error, report the error type. - - * inp.c (get_input_file): - Ask user whether to get file if patch_get is negative. - - * Makefile.in (clean): Don't clean */*.o; clean core* and *core. - -1997-06-04 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.5. - - * util.c (ok_to_reverse): - Be less chatty if verbosity is SILENT and we don't - have to ask the user. If force is nonzero, apply the patch anyway. - - * pch.c (there_is_another_patch): - Before skipping rest of patch, skip to - the patch start, so that another_hunk can skip it properly. - (intuit_diff_type): Slight wording change for missing headers, to - regularize with other diagnostics. Fix off-by-one error when setting - p_input_line when scanning the first hunk to check for deleted files. - -1997-06-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.4. - - * NEWS: Now matches more generously against nonexistent or empty files. - - * pch.c (there_is_another_patch): Move warning about not being - able to intuit file names here from skip_to. - (intuit_diff_type): Fatal error if we find a headless unified - or context diff. - - * util.c (ask): Null-terminate buffer properly even if it grew. - (fetchname): No need to test for null first argument. - -1997-06-02 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.3. - * pch.c (p_says_nonexistent, pch_says_nonexistent): Is now 1 for empty, - 2 for nonexistent. - (intuit_diff_type): Set p_says_nonexistent according to new meaning. - Treat empty files like nonexistent files when reversing. - (skip_to): Output better diagnostic when we can't intuit a file name. - * patch.c (main): - Count bytes, not lines, when testing whether a file is empty, - since it may contain only non-newline chars. - pch_says_nonexistent now returns 2 for nonexistent files. - -1997-06-01 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.2. - * pch.c (open_patch_file): - Fix bug when computing size of patch read from a pipe. - -1997-05-30 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.1. - - * Makefile.in (transform, patch_name): New vars, - for proper implementation of AC_ARG_PROGRAM. - (install, uninstall): Use them. - (install-strip): New rule. - * pc/djgpp/config.sed (program_transform_name): Set to empty. - -1997-05-30 Paul Eggert - - * configure.in (VERSION), NEWS: Version 2.3 released. - * patch.man: Fix two font typos. - * util.c (doprogram): Fix misspelled decl. - -1997-05-26 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.93. - - * pch.c (open_patch_file): - Fatal error if binary_transput and stdin is a tty. - - * pc/djgpp/config.sed (chdirsaf.c): - Use sed instead of cp, since cp might not be installed. - * pc/djgpp/configure.bat: - Prepend %srcdir% to pathname of config.sed, for crosscompiles. - -1997-05-25 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.92. - (D_INO_IN_DIRENT): New macro. - * pc/djgpp/config.h, acconfig.h (D_INO_IN_DIRENT): New macro. - * backupfile.c (REAL_DIR_ENTRY): - Depend on D_INO_IN_DIRENT, not _POSIX_VERSION. - - * addext.c (addext): Adjust slen when adjusting s for DOS 8.3 limit. - Do not use xxx.h -> xxxh~ hack. - - * util.c: (move_file): Avoid makedirs test when possible even - if FILESYSTEM_PREFIX_LEN (p) is nonzero. Don't play - case-changing tricks to come up with backup file name; it's - not portable to case-insensitive file systems. - * common.h (ISLOWER): Remove. - - * inp.c (scan_input): Don't use Plan A if (debug & 16). - - * patch.c (shortopts): Add -g, -G. - (longopts): --help now maps to 132, not 'h', to avoid confusion. - (get_some_switches): Likewise. - Don't invoke setmode on input if --binary; wait until needed. - Don't ever invoke setmode on stdout. - * pch.c (open_patch_file): Setmode stdin to binary if binary_transput. - - * patch.man: Fix documentation of backup file name to match behavior. - Add advice for ordering of patches of derived files. - Add /dev/tty to list of files used. - * README: Adjust instructions for building on DOS. - * pc/djgpp/README: Remove tentative wording. - * NEWS: The DOS port is now tested. - Backup file names are no longer computed by switching case. - - * pc/chdirsaf.c (ERANGE): Include to define it. - (restore_wd): chdir unconditionally. - (chdir_safer): Invoke atexit successfully at most once. - * pc/djgpp/config.sed: Use chdirsaf.o, not pc/chdirsaf.o. - Replace CONFIG_HDRS, don't append. - Use $(srcdir) in CONFIG_STATUS. - Don't apply $(SHELL) to $(CONFIG_STATUS). - Append rules for chdirsaf.o, chdirsaf.c; clean chdirsaf.c at the end. - * pc/djgpp/configure.bat: Append CR to each line; DOS needs this. - Don't use | as sed s delimiter; DOS can't handle it. - -1997-05-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.91. - - * pch.c (another_hunk): - Fix bug with computing size of prefix and suffix context - with ordinary context diffs. Report malformed patch if a unified diff - has nothing but context. - - * inp.c (get_input_file): - Use patch_get, not backup_type, to decide whether to - get from RCS or SCCS. Use the word `get' in diagnostics. - * patch.c (main): Initialize patch_get from PATCH_GET. - Omit DEFAULT_VERSION_CONTROL hook; it just leads to nonstandarization. - (longopts, option_help, get_some_switches): Add support for -g, -G. - (option_help): Add bug report address. - * common.h (patch_get): New decl. - * patch.man: Add -g and -G options; use `get' instead of `check out'. - Add PATCH_GET. Recommend -Naur instead of -raNU2 for diff. - * NEWS: Describe -g, -G, PATCH_GET. - - * version.c (copyright_string): Use only most recent copyright year, - as per GNU standards. - - * Makefile.in (DISTFILES_PC): Remove pc/quotearg.c. - * pc/djgpp/config.sed: Remove unnecessary hooks for quotearg and SHELL. - -1997-05-18 Paul Eggert - - * configure.in (VERSION): Increase to 2.2.9. - (AC_TYPE_MODE_T): Add. - - * pch.h (another_hunk): New parameter REV. - * pch.c (hunkmax): Now of type LINENUM. - (malformed): Add decl. - (there_is_another_patch): Skip inname-detection if skip_rest_of_patch. - (intuit_diff_type): To determine whether file appears to have been - deleted, look at replacement, not pattern. - If there is a mismatch between existence of file and whether the - patch claims to change whether the file exists, ask whether to - reverse the patch. - (another_hunk): New parameter REV specifying whether to reverse the - hunk. All callers changed. - (do_ed_script): Add assertion to ensure input file exists. - - * util.h (create_file): New function. - (copy_file): Now takes mode, not struct stat. - (makedirs): No longer exported. - (move_file): Now takes mode, not struct stat. - * util.c (makedirs): No longer exported. - (move_file): Accept mode of destination, not struct stat. - All callers changed. - Quote file names in diagnostics. - Create parent dir of destination if necessary. - Don't use ENOTDIR. - Don't unlink source; it will be unlinked later. - Unlink destination if FROM is zero. - (create_file): New function. - (copy_file): Accept mode of destination, not struct stat. - All callers changed. - Use create_file to create file. - (ok_to_reverse): Moved here from patch.c. Now accepts format and args; - all callers changed. - (mkdir): 2nd arg is now mode_t, for better compatibility. - (replace_slashes): Ignore slashes at the end of the filename. - - * common.h (noreverse): New decl. - (ok_to_reverse): Remove decl. - - * patch.c (noreverse): Now extern. - (main): New environment var PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - Don't assert(hunk) if we're skipping the patch; we may not have any hunks. - When removing a file, back it up if backups are desired. - Don't chmod output file if input file did not exist. - chmod rej file to input file's mode minus executable bits. - (locate_hunk): Go back to old way of a single fuzz parameter, but - handle it more precisely: context diffs with partial contexts - can only match file ends, since the partial context can occur - only at the start or end of file. - All callers changed. - (create_output_file): Use create_file to create files. - (ok_to_reverse): Move to util.c. - - * inp.c (scan_input, get_input_file): Quote file names in diagnostics. - (get_input_file): Set inerrno if it's not already set. - Don't create file; it's now the caller's responsibility. - (plan_b): Use /dev/null if input size is zero, since it might not exist. - Use create_file to create temporary file. - - * NEWS: Add PATCH_VERSION_CONTROL; DOS port is untested. - - * pc/djgpp/config.h: Add comment for mode_t. - - * pc/djgpp/README: Note that it's not tested. - - * patch.man: PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - -1997-05-15 Paul Eggert - - * configure.in: Add AC_PREREQ(2.12). - (VERSION): Bump to 2.2.8. - (ed_PROGRAM): Rename from ED_PROGRAM. - - * pch.c (prefix_components): Support DOS file names better. - Fix typo that caused fn to almost always yield 0. - - * util.c (, ): Include. - (move_file, copy_file): Add support for DOS filenames. - Preserve mode of input files when creating temp files. - Add binary file support. - (doprogram, rmdir): New functions. - (mkdir): Use doprogram. - (replace_slashes): Add support for DOS filenames. - (removedirs): New function. - (init_time)): New function. - (initial_time): New var. - (fetchname): Add support for deleted files, DOS filenames. - - * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): - New macros, for DOS port. - (base_name): Use them. - - * addext.c (HAVE_DOS_FILE_NAMES): New macro. - : Include if HAVE_LIMITS_H. - (addext): Handle hosts with DOS file name limits. - - * common.h (LONG_MIN): New macro. - (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. - (ok_to_create_file): Remove. - (reverse): Now int. - (ok_to_reverse): New function decl. - (O_WRONLY, _O_BINARY, O_BINARY, O_CREAT, O_TRUNC): New macros. - (binary_transput): New var decl. - - * Makefile.in (ed_PROGRAM): Renamed from ED_PROGRAM. - (CONFIG_HDRS, CONFIG_STATUS): New vars. - (SRCS): Add maketime.c, partime.c. - (OBJS): Likewise. - (HDRS): Add maketime.h, partime.h. - (DISTFILES_PC, DISTFILES_PC_DJGPP): New vars. - (Makefile, config.status): Use CONFIG_STATUS, not config.status. - (clean): Remove */*.o. - (dist): Add pc and pc/djgpp subdirectories. - ($(OBJS)): Depend on $(CONFIG_HDRS) instead of config.h. - (maketime.o, partime.o): New rules. - (util.o): Depend on maketime.h. - - * patch.c (main): - Call init_time. Add DEFAULT_VERSION_CONTROL hook for people who - prefer the old ways. Build temp file names before we might invoke cleanup. - Add support for deleted files and clean up the patch-swapping code a bit. - Delete empty ancestors of deleted files. - When creating temporaries, use file modes of original files. - (longopts, get_some_switches): New option --binary. - (get_some_switches): Report non-errno errors with `fatal', not `pfatal'. - (create_output_file): New function, which preserves modes of original files - and supports binary transput. - (init_output, init_reject): Use it. - (ok_to_reverse): New function. - (TMPDIR): New macro. - (make_temp): Use $TMPDIR, $TMP, $TEMP, or TMPDIR, whichever comes first. - - * pch.c (p_says_nonexistent): New var. - (open_patch_file): Add binary transput support. - Apply stat to file names retrieved from user. - Reject them if they don't exist. - (intuit_diff_type): Add support for deleting files. - Don't treat trivial directories any differently. - Avoid stating the same file twice in common case of context diffs. - (prefix_components): Don't treat trivial directories any differently. - Add support for DOS filenames. - (pch_says_nonexistent): New function. - (do_ed_script): Preserve mode of input files when creating temp files. - Add support for binary transput. - - * pch.h (pch_says_nonexistent): New decl. - - * util.h (replace_slashes): No longer exported. - (fetchname): Add support for deleted files. - (copy_file, move_file): Add support for preserving file modes. - (init_time, removedirs): New functions. - - * argmatch.c: Converge with fileutils. - - * backupfile.c: Converge with fileutils. - (find_backup_file_name): Treat .~N~ suffix just like any other suffix - when handling file names that are too long. - - * inp.c: - In messages, put quotes around file names and spaces around "--". - (get_input_file): Allow files to be deleted. Do the expense of - makedirs only if we can't create the file. - (plan_a, plan_b): Add support for binary transput. - - * pc/chdirsaf.c, pc/djgpp/README, pc/djgpp/config.h, pc/djgpp/config.sed, pc/djgpp/configure.bat, pc/quotearg.c: - New file. - - * NEWS: - New methods for removing files; adjust file name intuition again. - Add description of MS-DOS and MS-Windows ports. - - * patch.man: - Simplify file name intuition slightly (no distinction for trivial dirs). - Add --binary. Describe how files and directories are deleted. - Suggest diff -a. Include caveats about what context diffs cannot represent. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.7. - (CPPFLAGS, LDFLAGS, LIBS): If the user has not set any of these vars, - prefer support for large files if available. - - * common.h (_LARGEFILE_SOURCE): Define. - (file_offset): New typedef. - (file_seek, file_tell): New macros. - - * patch.c (main): - Remove empty files by default unless POSIXLY_CORRECT is set. - - * util.c, util.h (Fseek): - Use file_offset instead of long, for portability to large-file hosts. - - * pch.c: (p_base, p_start, next_intuit_at, skip_to, open_patch_file, - intuit_diff_type, another_hunk, incomplete_line, do_ed_script): - Use file_offset instead of long, for portability to large-file hosts. - (prefix_components): Renamed from path_name_components; count only - nontrivial prefix components, and take a 2nd EXISTING arg. - (existing_prefix_components): Remove; subsumed by prefix_components. - (intuit_diff_type): When creating files, try for the creation of the - fewest directories. - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: - When creating a file, use a name whose existing directory prefix - contains the most nontrivial path name components. - Add advice for creating patches and applying them. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: Describe above change to pch.c. - Add advice for creating patches and applying them. - -1997-05-05 Paul Eggert - - * configure.in (VERSION): Update to 2.2.5. - - * quotearg.h, quotearg.c: New files. - * Makefile.in (SRCS, OBJS, HDRS): Mention new files. - (inp.o, util.o): Now depends on quotearg.h. - (quotearg.o): New makefile rule. - - * common.h (posixly_correct): New var. - * patch.c (main): Initialize it. - If ! posixly_correct, default backup type is now `existing'. - SIMPLE_BACKUP_SUFFIX no longer affects backup type. - (backup): Remove var. - - * util.h: (countdirs): Remove. - (systemic): New decl. - * util.c (move_file): Try making the parent directory of TO - if backup prefix or suffix contain a slash. - (ask): Remove arbitrary limit on size of result. - (systemic): New function. - (mkdir): Work even if arg contains shell metacharacters. - (replace_slashes): Return 0 if none were replaced. - Don't replace slash after . or .. since it's redundant. - (countdirs): Remove. - (makedirs): Ignore mkdir failures. - - * NEWS, patch.man: More POSIXLY_CORRECT adjustments. - Describe new rules for how file names are intuited. - -1997-04-17 Paul Eggert - - * configure.in (VERSION): Version 2.2 released. - - * Makefile.in (config.hin): - Remove before building; we always want the timestamp updated. - - * inp.c (get_input_file): - Look for RCS files only if backup_type == numbered_existing. - - * NEWS, patch.man: - Remove mention of never-implemented -V rcs and -V sccs options. - * patch.man: `pathname' -> `file name' - Correct the description of how file names are found in diff headers. - Clarify the distinction between ordinary and unified context diffs. - -1997-04-13 Paul Eggert - - * configure.in (VERSION): Update to 2.1.7. - - * patch.c (numeric_optarg): New function. - (get_some_switches): Use it. - - * pch.c (intuit_diff_type): When creating a file, prefer a name whose - existing dir prefix is the longest. - - * util.h (countdirs): New function. - * util.c (replace_slashes, countdirs): New functions. - (makedirs): Use replace_slashes, to be more like countdirs. - - * patch.man: Explain -pN vs -p N. Recommend --new-file. - Explain possible incompatibility with strip count. - -1997-04-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.1.6. - (AC_CHECK_HEADERS): Remove stdlib.h (i.e. remove HAVE_STDLIB_H). - - * Makefile.in: (HDRS, patchlevel.h, TAGS, distclean, maintainer-clean): - Don't distribute patchlevel.h; let the user do it. - This works around some obscure (possibly nonexistent?) `make' bugs. - - * common.h (program_name): extern, not XTERN. - (): Include if STDC_HEADERS, not if HAVE_STDLIB_H. - (atol, getenv, malloc, realloc): Don't worry whether they're #defined. - - * patch.c (get_some_switches): - Add special hack for backwards compatibility with CVS 1.9. - (-B, -Y, -z): Now set backup_type = simple. - - * NEWS: Fix misspellings; minor reformatting. - * README: Report POSIX.2 compliance. - -1997-04-06 Paul Eggert - - Move all old RCS $Log entries into ChangeLog. - #include all files with < >, not " ". - - * addext.c, argmatch.c, argmatch.h, memchr.c, install-sh: - New files. - * EXTERN.h, INTERN.h: Removed. - * config.hin: Renamed from config.h.in. - - * acconfig.h (NODIR): Remove. - (HAVE_MEMCHR): Add. - - * configure.in (AC_ARG_PROGRAM, AC_PROG_MAKE_SET, HAVE_MEMCHR): Add. - (AC_CHECK_HEADERS): Replaces obsolescent AC_HAVE_HEADERS. - Add stdlib.h, string.h, unistd.h, varargs.h. - Delete obsolete call to AC_UNISTD_H. - (AC_CONFIG_HEADER): Rename config.h.in to config.hin. - (AC_C_CONST): Replaces obsolescent AC_CONST. - (AC_CHECK_FUNC): Check for getopt_long; define LIBOBJS and substitute - for it accordingly. - (AC_CHECK_FUNCS): Replaces obsolescent AC_HAVE_FUNCS. - Add _doprintf, isascii, mktemp, sigaction, sigprocmask, sigsetmask. - Remove strerror. - (AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VPRINTF): Add. - (AC_HEADER_DIRENT): Replaces obsolescent AC_DIR_HEADER. - (AC_HEADER_STDC): Replaces obsolescent AC_STDC_HEADERS. - (AC_SYS_LONG_FILE_NAMES): Replaces obsolescent AC_LONG_FILE_NAMES. - (AC_TYPE_OFF_T): Replaces obsolescent AC_OFF_T. - (AC_TYPE_SIGNAL): Replaces obsolescent AC_RETSIGTYPE. - (AC_TYPE_SIZE_T): Replaces obsolescent AC_SIZE_T. - (AC_XENIX_DIR): Remove. - (ED_PROGRAM): New var. - (NODIR): Remove. - (PACKAGE, VERSION): New vars; substitute them with AC_SUBST. - - * Makefile.in: Conform to current GNU build standards. - Redo dependencies. Use library getopt_long if available. - Use `&&' instead of `;' inside shell commands where applicable; - GNU make requires this. - Use double-colon rules for actions that do not build files. - (@SET_MAKE@): Added. - (CFLAGS, LDFLAGS, prefix, exec_prefix): Base on @ versions of symbols. - (COMPILE, CPPFLAGS, DEFS, ED_PROGRAM, LIBOBJS, LIBSRCS, PACKAGE, - VERSION): New symbols. - (SRCS, OBJS, HDRS, MISC): Add new files. - (man1dir): Renamed from mandir. - (man1ext): Renamed from manext. - (patch): Put -o first. - (install): Use $(transform) to allow program to be renamed by configure. - (patchlevel.h): Build from $(VERSION). - (dist): Get version number from $(VERSION) and package name from - $(PACKAGE). - (TAGS): Scan $(HDRS). - (maintainer-clean): Renamed from realclean. Remove patchlevel.h. - - * backupfile.h (simple_backup_suffix): Now const *. - (find_backup_file_name, base_name, get_version): Args are now const *. - (base_name): New decl. - * backupfile.c (): Include only if HAVE_CONFIG_H. - (): Include. - (): Include if HAVE_STRING_H, not if STDC_HEADERS. - (): Include if !HAVE_STRING_H. - (): Do not include. - (): Redo include as per current autoconf standards. - (): Include if HAVE_LIMITS_H. Define CHAR_BIT if not defined. - (NLENGTH): Now returns size_t. - (CLOSEDIR, INT_STRLEN_BOUND): New macros. - (ISDIGIT): Use faster method. - (find_backup_file_name): No longer depends on NODIR. - Remove redundant code. - (make_version_name): Remove; do it more portably. - (max_backup_version): Args are now const *. - (version_number): Simplify digit checking. - (basename, concat, dirname): Remove. - (argmatch, invalid_arg): Move to argmatch.c. Simplify test for - ambiguous args. When reporting an error, use program_name not "patch". - (addext): Move to addext.c. Treat all negative values from pathconf - like -1. Always use long extension if it fits, even if the filesystem - does not support long file names. - (backup_types): Now const. - - * common.h, inp.h (XTERN): Renamed from EXT to avoid collision - with errno.h reserved name space. - - * common.h (DEBUGGING): Now an integer; default is 1. - (enum diff): New type. - (diff_type): Use it instead of small integers. - (CONTEXT_DIFF, NORMAL_DIFF, ED_DIFF, NEW_CONTEXT_DIFF, UNI_DIFF): - Now enumerated values instead of macros. - (NO_DIFF): New enumerated value (used instead of 0). - (volatile): Default to the empty string if __STDC__ is not defined. - (): Do not include. - (Chmod, Close, Fclose, Fflush, Fputc, Signal, Sprintf, Strcat, - Strcpy, Unlink, Write): Remove these macros; casts to void are - not needed for GNU coding standards. - (INITHUNKMAX): Move to pch.c. - (malloc, realloc, INT_MIN, MAXLINELEN, strNE, strnNE, - Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, Reg8, Reg9, Reg10, Reg11, - Reg12, Reg13, Reg14, Reg15, Reg16): Remove these macros. - (S_IXOTH, S_IWOTH, S_IROTH, S_IXGRP, S_IWGRP, - S_IRGRP, S_IXUSR, S_IWUSR, S_IRUSR, O_RDONLY, O_RDWR): - Define these macros, if not defined. - (CTYPE_DOMAIN, ISLOWER, ISSPACE, ISDIGIT, PARAMS): New macros. - (instat): Renamed from filestat; used for input file now. - (bufsize, using_plan_a, debug, strippath): Not statically initialized. - (debug): #define to 0 if not DEBUGGING, so that users of `debug' - no longer need to be surrounded by `#if DEBUGGING'. - (out_of_mem, filec, filearg, outname, toutkeep, trejkeep): Remove. - (inname, inerrno, dry_run, origbase): New variables. - (origprae): Now const*. - (TMPOUTNAME, TMPINNAME, TMPPATNAME): Now const*volatile. - (verbosity): New variable; subsumes `verbose'. - (DEFAULT_VERBOSITY, SILENT, VERBOSE): Values in a new enum. - (verbose): Removed. - (VOID): Use `#ifdef __STDC__' instead of`#if __STDC__', - for consistency elsewhere. - (__attribute__): New macro (empty if not a recent GCC). - (fatal_exit): Renamed from my_exit. - (errno): Don't define if STDC_HEADERS. - (): Include if either STDC_HEADERS or HAVE_STRING_H. - (memcmp, memcpy): Define if !STDC_HEADERS && !HAVE_STRING_H - && !HAVE_MEMCHR. - (): Include if HAVE_STDLIB_H, not if STDC_HEADERS. - (atol, getenv, malloc, realloc, lseek): Declare only if not defined - as a macro. - (popen, strcpy, strcat, mktemp): Do not declare. - (lseek): Declare to yield off_t, not long. - (): Include only if HAVE_FCNTL_H. - - * inp.h (get_input_file): New decl. - * inp.c (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF, RCSSUFFIX, CHECKOUT, - CHECKOUT_LOCKED, RCSDIFF): Moved here from common.h. - (i_ptr): Now char const **. - (i_size): Remove. - (TIBUFSIZE_MINIMUM): Define only if not already defined. - (plan_a, plan_b): Arg is now const *. - (report_revision): Declare before use. It's now the caller's - responsibility to test whether revision is 0. - (scan_input, report_revision, get_input_file): - Be less chatty unless --verbose. - (get_input_file): New function, split off from plan_a. - Reuse file status gotten by pch if possible. Allow for dry run. - Use POSIX bits for creat, not number. Check for creation and - close failure, and use fstat not stat. Use memcpy not strncpy. - (plan_a): Rewrite for speed. - Caller now assigns result to using_plan_a. - Don't bother reading empty files; during dry runs they might not exist. - Use ISSPACE, not isspace. - (plan_b): Allow for dry runs. Use ISSPACE, and handle sign extension - correctly on arg. Use POSIX symbol for open arg. - - * patch.c (backup, output, patchname, program_name): New vars. - (last_frozen_line): Moved here from inp.h. - (TMPREJNAME): Moved here from common.h. - (optind_last): Removed. - (do_defines, if_defined, not_defined, else_defined, end_defined): - Now char const. Prepend with \n (except for not_defined) to - allow for files ending in non-newline. - (Argv): Now char*const*. - (main, get_some_switches): Exit status 0 means success, - 1 means hunks were rejected, 2 means trouble. - (main, locate_hunk, patch_match): Keep track of patch prefix context - separately from suffix context; this fixes several bugs. - (main): Initialize bufsize, strippath. - Be less chatty unless --verbose. - No more NODIR; always have version control available. - Require environment variables to be nonempty to have effect. - Add support for --dry-run, --output, --verbose. - Invoke get_input_file first, before deciding among do_ed_script, - plan_a, or plan_b. - Clear ofp after closing it, to keep discipline that ofp is either - 0 or open, to avoid file descriptor leaks. Conversely, rejfp doesn't - need this trick since static analysis is enough to show when it - needs to be closed. - Don't allow file-creation patches to be applied to existing files. - Misordered hunks are now not fatal errors; just go on to the next file. - It's a fatal error to fall back on plan B when --output is given, - since the moving hand has writ. - Add support for binary files. - Check for I/O errors. - chmod output file ourselves, rather than letting move_file do it; - this saves global state. - Use better grammar when outputting hunks messages, e.g. avoid - `1 hunks'. - (main, reinitialize_almost_everything): - Remove support for multiple file arguments. - Move get_some_switches call from reinitialize_almost_everything - to main. - (reinitialize_almost_everything): No need to reinitialize things - that are no longer global variables, e.g. outname. - (shortopts): Remove leading "-"; it's no longer important to - return options and arguments in order. '-b' no longer takes operand. - -p's operand is no longer optional. Add -i, -Y, -z. Remove -S. - (longopts): --suffix is now pared with -z, not -b. --backup now - means -b. Add --input, --basename-prefix, --dry-run, --verbose. - Remove --skip. --strip's operand is now required. - (option_help): New variable. Use style of current coding standards. - Change to match current option set. - (usage): Use it. - (get_some_switches): Get all switches, since `+' is defunct. - New options -i, -Y, -z, --verbose, --dry-run. - Option -S removed. - -b now means backup (backup_type == simple), not simple_backup_suffix. - -B now implies backup, and requires nonempty operand. - -D no longer requires first char of argument to be an identifier. - `-o -' is now disallowed (formerly output to regular file named "-"). - -p operand is now required. - -v no longer needs to cleanup (no temp files can exist at that point). - -V now implies backup. - Set inname, patchname from file name arguments, if any; - do not set filearg. It's now an error if extra operands are given. - (abort_junk): Check for write errors in reject file. - (apply_hunk, copy_till): Return error flag, so that failure to apply - out-of-order hunk is no longer fatal. - (apply_hunk): New arg after_newline, - for patching files not ending in newline. - Cache ofp for speed. Check for write errors. - (OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE): Now part of an enumerated type - instead of being #defined to small integers. - Change while-do to do-while when copying !-part for R_do_defines, - since condition is always true the first time through the loop. - (init_output, init_reject): Arg is now const *. - (copy_till, spew_output): Do not insert ``missing'' newlines; - propagate them via new after_newline argument. - (spew_output): Nothing to copy if last_frozen_line == input lines. - Do not close (ofp) if it's null. - (dump_line): Remove. - (similar): Ignore presence or absence of trailing newlines. - Check for only ' ' or '\t', not isspace (as per POSIX.2). - (make_temp): Use tmpnam if mktemp is not available. - (cleanup): New function. - (fatal_exit): Use it. Renamed from my_exit. - Take signal to exit with, not exit status (which is now always 2). - - * pch.h, pch.c (pch_prefix_context, pch_suffix_context): - New fns replacing pch_context. - (another_hunk): Now yields int, not bool; -1 means out of memory. - Now takes difftype as argument. - (pch_write_line): Now returns boolean indicating whether we're after - a newline just after the write, for supporting non-text files. - * pch.c (isdigit): Remove; use ISDIGIT instead. - (INITHUNKMAX): Moved here from common.h. - (p_context): Removed. We need to keep track of the pre- and post- - context separately, in: - (p_prefix_context, p_suffix_context): New variables. - (bestguess): Remove. - (open_patch_file): Arg is now char const *. - Copy file a buffer at a time, not a char at a time, for speed. - (grow_hunkmax): Now returns success indicator. - (there_is_another_patch, skip_to, another_hunk, do_ed_script): - Be less chatty unless --verbose. - (there_is_another_patch): - Avoid infinite loop if user input keeps yielding EOF. - (intuit_diff_type): New returns enum diff, not int. - Strip paths as they're being fetched. - Set ok_to_create_file correctly even if patch is reversed. - Set up file names correctly with unidiff output. - Use algorithm specified by POSIX 1003.2b/D11 to deduce - name of file to patch, with the exception of patches - that can create files. - (skip_to): Be verbose if !inname, since we're about to ask the - user for a file name and the context will help the user choose. - (another_hunk): Keep context as LINENUM, not int. - If the replacement is missing, calculate its context correctly. - Don't assume input ends in newline. - Keep track of patch prefix context separately from suffix context; - this fixes several bugs. - Don't assume blank lines got chopped if the replacement is missing. - Report poorly-formed hunks instead of aborting. - Do not use strcpy on overlapping strings; it's not portable. - Work even if lines are incomplete. - Fix bugs associated with context-less context hunks, - particularly when patching in reverse. - (pget_line): Now takes just 1 arg; instead of second arg, - just examine using_plan_a global. Return -1 if we ran out - of memory. - (do_ed_script): Now takes output FILE * argument. - Take name of editor from ED_PROGRAM instead of hardwiring /bin/ed. - Don't bother unlinking TMPOUTNAME. - Check for popen failure. - Flush pipe to check for output errors. - If ofp is nonzero, copy result to it, instead of trying to - move the result. - - * util.h, util.c (say1, say2, say3, say4, fatal1, fatal2, fatal3, - fatal4, pfatal1, pfatal2, pfatal3, pfatal4, ask1, ask2, ask3, ask4): - Remove; replaced with following. - (ask, say, fatal, pfatal): New stdarg functions. - (fetchname): Remove last, `assume_exists' parameter. - (savebuf, savestr, move_file, copy_file): Args are now const *. - (exit_with_signal): New function, for proper process status if - a signal is received as per POSIX.2. - (basename): Rename to `base_name' and move to backupfile. - * util.c (): Include here, not in common.h. - (vararg_start): New macro. - (va_dcl, va_start, va_arg, va_end): Define if neither - nor are available. - (SIGCHLD): Define to SIGCLD if SIGCLD is defined and - SIGCHLD isn't. - (private_strerror): Remove. - (move_file): Remove option of moving to stdout. - Add support for -Y, -z. - Don't assume chars in file name are nonnegative. - Use copy_file if rename fails due to EXDEV; - report failure if rename fails for any other reason. - (copy_file, makedirs): Use POSIX symbols for permissions. - (copy_file): Open source before destination. - (remove_prefix): New function. - (vfprintf): New function, if !HAVE_VPRINTF. - (afatal, apfatal, zfatal, zpfatal, errnum): Remove. - (fatal, pfatal, say): New functions that use stdarg. - All callers changed. - (zask): Renamed from `ask'. Now uses stdarg. Output to stdout, - and read from /dev/tty, or if that cannot be opened, from - stderr, stdout, stdin, whichever is first a tty. - Print "EOF" when an EOF is read. Do not echo input. - (sigs): New array. - (sigset_t, sigemptyset, sigmask, sigaddset, sigismember, SIG_BLOCK, - SIG_UNBLOCK, SIG_SETMASK, sigprocmask, sigblock, sigsetmask): - Define substitutes if not available. - (initial_signal_mask, signals_to_block): New vars. - (fatal_exit_handler): New function, if !HAVE_SIGACTION. - (set_signals, ignore_signals): Use sigaction and sigprocmask style - signal-handling if possible; it doesn't lose signals. - (set_signals): Default SIGCHLD to work around SysV fork+wait bug. - (mkdir): First arg is now const *. - (makedirs): Handle multiple adjacent slashes correctly. - (fetchname): Do not worry about whether the file exists - (that is now the caller's responsibility). - Treat a sequence of one or more slashes like one slash. - Do not unstrip leading directories if they all exist and if - no -p option was given; POSIX doesn't allow this. - (memcmp): Remove (now a macro in common.h). - - * version.c (copyright_string, free_software_msgid, authorship_msgid): - New constants. - (version): Use them. Use program_name instead of hardwiring it. - - * patch.man: Generate date from RCS Id. - Rewrite to match the above changes. - -Fri Jul 30 02:02:51 1993 Paul Eggert (eggert@twinsun.com) - - * configure.in (AC_HAVE_FUNCS): Add mkdir. - - * common.h (Chmod, Fputc, Write, VOID): New macros. - (malloc, realloc): Yield `VOID *', not `char *'. - - * util.h (makedirs): Omit `striplast' argument. Remove `aask'. - - * inp.c (plan_a): Remove fixed internal buffer. Remove lint. - - * util.c (set_signals, ignore_signals): Trap SIGTERM, too. - (makedirs): Removed fixed internal buffer. Omit `striplast' argument. - (mkdir): New function, if !HAVE_MKDIR. - (fetchname): Remove fixed internal buffer. - Remove lint from various functions. - - * patch.c, pch.c: Remove lint. - -Thu Jul 29 20:52:07 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * Makefile.in (config.status): Run config.status --recheck, not - configure, to get the right args passed. - -Thu Jul 29 07:46:16 1993 Paul Eggert (eggert@twinsun.com) - - * The following changes remove all remaining fixed limits on memory, - and fix bugs in patch's handling of null bytes and files that do not - end in newline. `Patch' now works on binary files. - - * backupfile.c (find_backup_file_name): Don't dump core if malloc fails. - - * EXTERN.h, INTERN.h (EXITING): New macro. - * backupfile.[ch], patch.c, pch.c: Add PARAMS to function declarations. - - * common.h (bool): Change to int, so ANSI C prototype promotion works. - (CANVARARG): Remove varargs hack; it wasn't portable. - (filearg): Now a pointer, not an array, so that it can be reallocated. - (GET*, SCCSDIFF, CHECKOUT*, RCSDIFF): Quote operands to commands. - (my_exit): Declare here. - (BUFFERSIZE, Ctl, filemode, Fseek, Fstat, Lseek, MAXFILEC, MAXHUNKSIZE, - Mktemp, myuid, Null, Nullch, Nullfp, Nulline, Pclose, VOIDUSED): Remove. - All invokers changed. - (Argc, Argv, *define[sd], last_offset, maxfuzz, noreverse, ofp, - optind_last, rejfp, rejname): No longer externally visible; all - definers changed. - (INT_MAX, INT_MIN, STD*_FILENO, SEEK_SET): Define if the underlying - system doesn't. Include for this. - - * configure.in: Add limits.h, memcmp. Delete getline. - - * inp.c (tibufsize): New variable; buffers grow as needed. - (TIBUFSIZE_MINIMUM): New macro. - (report_revision): New function. - (plan_a): Do not search patch as a big string, since that fails - if it contains null bytes. - Prepend `./' to filenames starting with `-', for RCS and SCCS. - If file does not match default RCS/SCCS version, go ahead and patch - it anyway; warn about the problem but do not report a fatal error. - (plan_b): Do not use a fixed buffer to read lines; read byte by byte - instead, so that the lines can be arbitrarily long. Do not search - lines as strings, since they may contain null bytes. - (plan_a, plan_b): Report I/O errors. - - * inp.c, inp.h (rev_in_string): Remove. - (ifetch): Yield size of line too, since strlen no longer applies. - (plan_a, plan_b): No longer exported. - - * patch.c (abort_hunk, apply_hunk, patch_match, similar): - Lines may contain NUL and need not end in newline. - (copy_till, dump_line): Insert newline if appending after partial line. - All invokers changed. - (main, get_some_switches, apply_hunk): Allocate *_define[ds], filearg, - rejname dynamically. - (make_temp): New function. - (main): Use it. - (main, spew_output, dump_line) Check for I/O errors. - - * pch.c (open_patch_file): Don't copy stdin to a temporary file if - it's a regular file, since we can seek on it directly. - (open_patch_file, skip_to, another_hunk): The patch file may contain - NULs. - (another_hunk): The patch file may contain lines starting with '\', - which means the preceding line lacked a trailing newline. - (pgetline): Rename to pget_line. - (get_line, incomplete_line, pch_write_line): New functions. - (pch_line_len): Return size_t, not short; lines may be very long. - (do_ed_script): Check for I/O errors. Allow scripts to contain - 'i' and 's' commands, too. - - * pch.h (pfp, grow_hunkmax, intuit_diff_type, next_intuit_at, skip_to, - pfetch, pgetline): No longer exported. - (pch_write_line): New declaration. - (getline): Removed. - - * util.c (move_file, fetchname): Use private stat buffer, so that - filestat isn't lost. Check for I/O errors. - (savestr): Use savebuf. - (zask): Use STD*_FILENO instead of 0, 1, 2. - (fetchname): strip_leading defaults to INT_MAX instead of 957 (!). - (memcmp): Define if !HAVE_MEMCMP. - - * util.c, util.h (say*, fatal*, pfatal*, ask*): Delete; these - pseudo-varargs functions weren't ANSI C. Replace by macros - that invoke [fs]printf directly, and invoke new functions - [az]{say,fatal,pfatal,ask} before and after. - (savebuf, read_fatal, write_fatal, memory_fatal, Fseek): New functions. - (fatal*): Output trailing newline after message. All invokers changed. - - * version.c (version): Don't exit. - - * Makefile.in (SRCS): Remove getline.c. - -Thu Jul 22 15:24:24 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * EXTERN.h, INTERN.h (PARAMS): Define. - * backupfile.h, common.h, inp.h, pch.h, util.h: Use. - * backupfile.c: Include EXTERN.h. - -Wed Jul 21 13:14:05 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * getline.c: New file. - * configure.in: Check for getline (GNU libc has it). - * pch.c: Use it instead of fgets. - (pgetline): Renamed from pgets. Change callers. - * pch.h: Change decl. - - * pch.c (pgets): Tab adjusts by 8 - (indent % 8), not % 7. - Be consistent with similar code in pch.c::intuit_diff_type. - - * common.h (MEM): Typedef removed. - inp.c, pch.c, util.c: Use size_t instead of MEM. - inp.c, pch.c: Use off_t. - configure.in: Add AC_SIZE_T and AC_OFF_T. - - * common.h: Make buf a pointer and add a bufsize variable. - * util.c, pch.c, inp.c: Replace sizeof buf with bufsize. - * patch.c: malloc buf to bufsize bytes. - -Tue Jul 20 20:40:03 1993 Paul Eggert (eggert@twinsun.com) - - * common.h (BUFFERSIZE): Grow it to 8k too, just in case. - (buf): Turn `buf' back into an array; making it a pointer broke - things seriously. - * patch.c (main): Likewise. - -Tue Jul 20 20:02:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Move Reg[1-16] and CANVARARG decls from config.h.in to common.h. - * acconfig.h: New file. - * Makefile (HDRS): Add it. - -Tue Jul 20 16:35:27 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in: Remove alloca.[co]; getopt no longer needs it. - * configure.in (AC_ALLOCA): Remove. - - * util.c (set_signals, ignore_signals): Do nothing if SIGHUP - and SIGINT aren't defined. - -Tue Jul 20 17:59:56 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (main): Call xmalloc, not malloc. xmalloc buf. - * common.h: Declare xmalloc. Make buf a pointer, not an array. - - * util.c (xmalloc): Call fatal1, not fatal. - - * common.h [MAXLINELEN]: Bump from 1k to 8k. - -Thu Jul 8 19:56:16 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in (installdirs): New target. - (install): Use it. - (Makefile, config.status, configure): New targets. - -Wed Jul 7 13:25:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (get_some_switches, longopts): Recognize --help - option, and call usage. - (usage): New function. - -Fri Jun 25 07:49:45 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Don't use .orig if - numbered_existing with no existing numbered backup. - (addext): Don't use ext if !HAVE_LONG_FILE_NAMES, - even if it would fit. This matches patch's historical behavior. - (simple_backup_suffix): Default to ".orig". - * patch.c (main): Just use that default. - -Tue Jun 15 22:32:14 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (HAVE_ALLOCA_H): This #undef was missing. - * Makefile.in (info, check, installcheck): New rules. - -Sun Jun 13 14:31:29 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (index, rindex): Remove unused macro - definitions; they get in the way when porting to AIX. - * config.h.in, configure.in (HAVE_STRING_H): Remove unused defn. - -Thu Jun 10 21:13:47 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCH_VERSION 2.1. - (The name `patch-2.0.12g12' is too long for traditional Unix.) - - * patchlevel.h (PATCH_VERSION): Renamed from PATCHLEVEL. - Now contains the entire patch version number. - * version.c (version): Use it. - -Wed Jun 9 21:43:23 1993 Paul Eggert (eggert@twinsun.com) - - * common.h: Remove declarations of index and rindex. - * backupfile.c: Likewise. - (addext, basename, dirname): Avoid rindex. - -Tue Jun 8 15:24:14 1993 Paul Eggert (eggert@twinsun.com) - - * inp.c (plan_a): Check that RCS and working files are not the - same. This check is needed on hosts that do not report file - name length limits and have short limits. - -Sat Jun 5 22:56:07 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in (.c.o): Put $(CFLAGS) after other options. - (dist): Switch from .z to .gz. - -Wed Jun 2 10:37:15 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Initialize copy of - file name properly. - -Mon May 31 21:55:21 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g11. - - * pch.c (p_Char): Renamed from p_char, which is a system type - in Tex XD88's . - - * backupfile.c: Include "config.h" first, so that `const' is - treated consistently in system headers. - -Mon May 31 16:06:23 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g10. - - * configure.in: Add AC_CONST. - * config.h.in: Add `const'. - * Makefile.in (.c.o): Add -DHAVE_CONFIG_H. - (getopt.o getopt1.o): Depend on config.h. - - * util.c (xmalloc): New function; alloca.c needs this. - -Mon May 31 00:49:40 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCHLEVEL 12g9. - - * backupfile.c, backupfile.h (addext): New function. - It uses pathconf(), if available, to determine maximum file - name length. - * patch.c (main): Use it for reject file name. - * common.h (ORIGEXT): Moved to patch.c. - * config.h.in (HAVE_PATHCONF): New macro. - * configure.in: Define it. - - * Makefile.in (dist): Use gzip, not compress. - -Sat May 29 09:42:18 1993 Paul Eggert (eggert@twinsun.com) - - * patch.c (main): Use pathconf to decide reject file name. - * common.h (REJEXT): Remove. - - * inp.c (plan_a): Don't lock the checked-out file if `patch -o' - redirected the output elsewhere. - * common.h (CHECKOUT_LOCKED, GET_LOCKED): New macros. GET and - CHECKOUT now just checkout unlocked copies. - -Fri May 28 08:44:50 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (basename): Define even if NODIR isn't defined. - * patch.c (main): Ask just once to apply a reversed patch. - -Tue Nov 24 08:09:04 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * config.h.in, common.h: Use HAVE_FCNTL_H and HAVE_STRING_H - instead of USG. - - * backupfile.c: Use SYSDIR and NDIR instead of USG. - Define direct as dirent, not vice-versa. - -Wed Sep 16 17:11:48 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (get_some_switches): optc should be int, not char. - -Tue Sep 15 00:36:46 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12g8. - -Mon Sep 14 22:01:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Makefile.in: Add uninstall target. - - * util.c (fatal, pfatal): Add some asterisks to make fatal - messages stand out more. - -Tue Aug 25 22:13:36 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main, get_some_switches), common.h, inp.c (plan_a, - plan_b), pch.c (there_is_another_patch): Add -t --batch - option, similar to -f --force. - -Mon Jul 27 11:27:07 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * common.h: Define SCCSDIFF and RCSDIFF. - * inp.c (plan_a): Use them to make sure it's safe to check out - the default RCS or SCCS version. - From Paul Eggert. - -Mon Jul 20 14:10:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.h: Declare basename. - * inp.c (plan_a), util.c (fetchname): Use it to isolate the - leading path when testing for RCS and SCCS files. - -Fri Jul 10 16:03:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (makedirs): Only make the directories that don't exist. - From chip@tct.com (Chip Salzenberg). - -Wed Jul 8 01:20:56 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main): Open ofp after checking for ed script. - Close ofp and rejfp before trying plan B. - From epang@sfu.ca (Eugene Pang). - - * util.c (fatal, pfatal): Print "patch: " before message. - * pch.c, inp.c, patch.c, util.c: Remove "patch: " from the - callers that had it. - - * common.h (myuid): New variable. - * patch.c (main): Initialize it. - * inp.c (myuid): Function removed. - (plan_a): Use the variable, not the function. - - * patch.c: Add back -E --remove-empty-files option. - -Tue Jul 7 23:19:28 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (myuid): New function. - (plan_a): Call it. Optimize stat calls. Be smarter about - detecting checked out RCS and SCCS files. - From Paul Eggert (eggert@twinsun.com). - - * inp.c, util.c, patch.c: Don't bother checking for stat() > 0. - -Mon Jul 6 13:01:52 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (move_file): Use rename instead of link and copying. - - * util.c (pfatal): New function. - * util.h: Declare it and pfatal[1-4] macros. - * various files: Use it instead of fatal where appropriate. - - * common.h, patch.c: Replace Arg[cv]_last with optind_last. - - * patch.c (main, get_some_switches): Use getopt_long. Update - usage message. - (nextarg): Function removed. - - * Rename FLEXFILENAMES to HAVE_LONG_FILE_NAMES, - VOIDSIG to RETSIGTYPE. - - * backupfile.c, common.h: Use STDC header files if available. - backupfile.h: Declare get_version. - - * COPYING, COPYING.LIB, INSTALL, Makefile.in, alloca.c, - config.h.in, configure, configure.in, getopt.[ch], getopt1.c, - rename.c: New files. - * Configure, MANIFEST, Makefile.SH, config.H, config.h.SH, - malloc.c: Files removed. - - * version.c (version): Don't print the RCS stuff, since we're - not updating it regularly. - - * patchlevel.h: PATCHLEVEL 12u7. - - * Makefile.SH (dist): New target. - Makedist: File removed. - - * inp.c (plan_a): Check whether the user can write to the - file, not whether anyone can write to the file. - -Sat Jul 4 00:06:58 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (plan_a): Try to check out read-only files from RCS or SCCS. - - * util.c (move_file): If backing up by linking fails, try copying. - From cek@sdc.boeing.com (Conrad Kimball). - - * patch.c (get_some_switches): Eliminate -E option; always - remove empty output files. - - * util.c (fetchname): Only undo slash removal for relative - paths if -p was not given. - - * Makefile.sh: Add mostlyclean target. - -Fri Jul 3 23:48:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (fetchname): Accept whitespace between `Index:' and filename. - Also plug a small memory leak for diffs against /dev/null. - From eggert@twinsun.com (Paul Eggert). - - * common.h: Don't define TRUE and FALSE if already defined. - From phk@data.fls.dk (Poul-Henning Kamp). - -Wed Apr 29 10:19:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - - * backupfile.c (get_version): Exit if given a bad backup type. - -Fri Mar 27 09:57:14 1992 Karl Berry (karl at hayley) - - * common.h (S_ISDIR, S_ISREG): define these. - * inp.c (plan_a): use S_ISREG, not S_IFREG. - * util.c (fetchname): use S_ISDIR, not S_IFDIR. - -Mon Mar 16 14:10:42 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u6. - -Sat Mar 14 13:13:29 1992 David J. MacKenzie (djm at frob.eng.umd.edu) - - * Configure, config.h.SH: Check for directory header and unistd.h. - - * patch.c (main): If -E was given and output file is empty after - patching, remove it. - (get_some_switches): Recognize -E option. - - * patch.c (copy_till): Make garbled output an error, not a warning - that doesn't change the exit status. - - * common.h: Protect against system declarations of malloc and realloc. - - * Makedist: Add backupfile.[ch]. - - * Configure: Look for C library where NeXT and SVR4 put it. - Look in /usr/ucb after /bin and /usr/bin for utilities, - and look in /usr/ccs/bin, to make SVR4 happier. - Recognize m68k predefine. - - * util.c (fetchname): Test of stat return value was backward. - From csss@scheme.cs.ubc.ca. - - * version.c (version): Exit with status 0, not 1. - - * Makefile.SH: Add backupfile.[cho]. - * patch.c (main): Initialize backup file generation. - (get_some_switches): Add -V option. - * common.h, util,c, patch.c: Replace origext with simple_backup_suffix. - * util.c (move_file): Use find_backup_file_name. - -Tue Dec 3 11:27:16 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u5. - - * Makefile.SH: Change clean, distclean, and realclean targets a - little so they agree with the GNU coding standards. - Add Makefile to addedbyconf, so distclean removes it. - - * Configure: Recognize Domain/OS C library in /lib/libc. - From mmuegel@mot.com (Michael S. Muegel). - - * pch.c: Fixes from Wayne Davison: - Patch now accepts no-context context diffs that are - specified with an assumed one line hunk (e.g. "*** 10 ****"). - Fixed a bug in both context and unified diff processing that would - put a zero-context hunk in the wrong place (one line too soon). - Fixed a minor problem with p_max in unified diffs where it would - set p_max to hunkmax unnecessarily (the only adverse effect was to - not supply empty lines at eof by assuming they were truncated). - -Tue Jul 2 03:25:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Configure: Check for signal declaration in - /usr/include/sys/signal.h as well as /usr/include/signal.h. - - * Configure, common.h, config.h.SH: Comment out the sprintf - declaration and tests to determine its return value type. It - conflicts with ANSI C systems' prototypes in stdio.h and the - return value of sprintf is never used anyway -- it's always cast - to void. - -Thu Jun 27 13:05:32 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u4. - -Thu Feb 21 15:18:14 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * pch.c (another_hunk): Fix off by 1 error. From - iverson@xstor.com (Tim Iverson). - -Sun Jan 20 20:18:58 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * Makefile.SH (all): Don't make a dummy `all' file. - - * patchlevel.h: PATCHLEVEL 12u3. - - * patch.c (nextarg): New function. - (get_some_switches): Use it, to prevent dereferencing a null - pointer if an option that takes an arg is not given one (is last - on the command line). From Paul Eggert. - - * pch.c (another_hunk): Fix from Wayne Davison to recognize - single-line hunks in unified diffs (with a single line number - instead of a range). - - * inp.c (rev_in_string): Don't use `s' before defining it. From - Wayne Davison. - -Mon Jan 7 06:25:11 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u2. - - * pch.c (intuit_diff_type): Recognize `+++' in diff headers, for - unified diff format. From unidiff patch 1. - -Mon Dec 3 00:14:25 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * patch.c (get_some_switches): Make the usage message more - informative. - -Sun Dec 2 23:20:18 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * Configure: When checking for C preprocessor, look for 'abc.*xyz' - instead of 'abc.xyz', so ANSI C preprocessors work. - - * Apply fix for -D from ksb@mentor.cc.purdue.edu (Kevin Braunsdorf). - -1990-05-01 Wayne Davison - * patch.c, pch.c: unidiff support added - -Wed Mar 7 23:47:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * pch.c: Call malformed instead of goto malformed - (just allows easier debugging). - -Tue Jan 23 21:27:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * common.h (TMP*NAME): Make these char *, not char []. - patch.c (main): Use TMPDIR (if present) to set TMP*NAME. - common.h: Declare getenv. - -Sun Dec 17 17:29:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) - - * patch.c (reverse_flag_specified): New variable. - (get_some_switches, reinitialize_almost_everything): Use it. - -1988-06-22 Larry Wall - patch12: - * common.h: sprintf was declared wrong - * patch.c: rindex() wasn't declared - * patch.man: now avoids Bell System Logo - -1988-06-03 Larry Wall - patch10: - * common.h: support for shorter extensions. - * inp.c: made a little smarter about sccs files - * patch.c: exit code improved. - better support for non-flexfilenames. - * patch.man: -B switch was contributed. - * pch.c: Can now find patches in shar scripts. - Hunks that swapped and then swapped back could core dump. - -1987-06-04 Larry Wall - * pch.c: pch_swap didn't swap p_bfake and p_efake. - -1987-02-16 Larry Wall - * patch.c: Short replacement caused spurious "Out of sync" message. - -1987-01-30 Larry Wall - * patch.c: Improved diagnostic on sync error. - Moved do_ed_script() to pch.c. - * pch.c: Improved responses to mangled patches. - * pch.h: Added do_ed_script(). - -1987-01-05 Larry Wall - * pch.c: New-style context diffs caused double call to free(). - -1986-11-21 Larry Wall - * patch.c: Fuzz factor caused offset of installed lines. - -1986-11-14 Larry Wall - * pch.c: Fixed problem where a long pattern wouldn't grow the hunk. - Also restored p_input_line when backtracking so error messages are - right. - -1986-11-03 Larry Wall - * pch.c: New-style delete triggers spurious assertion error. - -1986-10-29 Larry Wall - * patch.c: Backwards search could terminate prematurely. - * pch.c: Could falsely report new-style context diff. - -1986-09-17 Larry Wall - * common.h, inp.c, inp.h, patch.c, patch.man, pch.c, pch.h, - util.h, version.c, version.h: Baseline for netwide release. - -1986-08-01 Larry Wall - * patch.c: Fixes for machines that can't vararg. - Added fuzz factor. Generalized -p. General cleanup. - Changed some %d's to %ld's. Linted. - * patch.man: Documented -v, -p, -F. - Added notes to patch senders. - -1985-08-15 van%ucbmonet@berkeley - Changes for 4.3bsd diff -c. - -1985-03-26 Larry Wall - * patch.c: Frozen. - * patch.man: Frozen. - -1985-03-12 Larry Wall - * patch.c: Now checks for normalness of file to patch. - Check i_ptr and i_womp to make sure they aren't null before freeing. - Also allow ed output to be suppressed. - Changed pfp->_file to fileno(pfp). - Added -p option from jromine@uci-750a. - Added -D (#ifdef) option from joe@fluke. - * patch.man: Documented -p, -D. - -1984-12-06 Larry Wall - * patch.c: Made smarter about SCCS subdirectories. - -1984-12-05 Larry Wall - * patch.c: Added -l switch to do loose string comparison. - * patch.man: Added -l switch, and noted bistability bug. - -1984-12-04 Larry Wall - Branch for sdcrdcf changes. - * patch.c: Failed hunk count not reset on multiple patch file. - * patch.man: Baseline version. - -1984-11-29 Larry Wall - * patch.c: Linted. Identifiers uniquified. Fixed i_ptr malloc() bug. - Fixed multiple calls to mktemp(). Will now work on machines that can - only read 32767 chars. Added -R option for diffs with new and old - swapped. Various cosmetic changes. - -1984-11-09 Larry Wall - * patch.c: Initial revision - - -Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall. - -Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, -2002 Free Software Foundation, Inc. - -This file is part of GNU Patch. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that they will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. Index: vendor/misc-GNU/patch/2.5.9/partime.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/partime.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/partime.c (nonexistent) @@ -1,956 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright (C) 1993, 1994, 1995, 1997, 2002 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if HAVE_STDDEF_H -# include -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#ifndef offsetof -#define offsetof(aggregate, member) ((size_t) &((aggregate *) 0)->member) -#endif - -#include -#if STDC_HEADERS -# define CTYPE_DOMAIN(c) 1 -#else -# define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#define ISALNUM(c) (CTYPE_DOMAIN (c) && isalnum (c)) -#define ISALPHA(c) (CTYPE_DOMAIN (c) && isalpha (c)) -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c)) -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#include - -char const partime_id[] = - "$Id: partime.c,v 1.2 2002/02/18 07:42:58 eggert Exp $"; - - -/* Lookup tables for names of months, weekdays, time zones. */ - -#define NAME_LENGTH_MAXIMUM 4 - -struct name_val - { - char name[NAME_LENGTH_MAXIMUM]; - int val; - }; - - -static char const *parse_decimal P ((char const *, int, int, int, int, int *, int *)); -static char const *parse_fixed P ((char const *, int, int *)); -static char const *parse_pattern_letter P ((char const *, int, struct partime *)); -static char const *parse_prefix P ((char const *, char const **, struct partime *)); -static char const *parse_ranged P ((char const *, int, int, int, int *)); -static char const *parse_varying P ((char const *, int *)); -static int lookup P ((char const *, struct name_val const[])); -static int merge_partime P ((struct partime *, struct partime const *)); -static void undefine P ((struct partime *)); - - -static struct name_val const month_names[] = -{ - {"jan", 0}, - {"feb", 1}, - {"mar", 2}, - {"apr", 3}, - {"may", 4}, - {"jun", 5}, - {"jul", 6}, - {"aug", 7}, - {"sep", 8}, - {"oct", 9}, - {"nov", 10}, - {"dec", 11}, - {"", TM_UNDEFINED} -}; - -static struct name_val const weekday_names[] = -{ - {"sun", 0}, - {"mon", 1}, - {"tue", 2}, - {"wed", 3}, - {"thu", 4}, - {"fri", 5}, - {"sat", 6}, - {"", TM_UNDEFINED} -}; - -#define RELATIVE_CONS(member, multiplier) \ - (offsetof (struct tm, member) + (multiplier) * sizeof (struct tm)) -#define RELATIVE_OFFSET(c) ((c) % sizeof (struct tm)) -#define RELATIVE_MULTIPLIER(c) ((c) / sizeof (struct tm)) -static struct name_val const relative_units[] = -{ - {"year", RELATIVE_CONS (tm_year, 1) }, - {"mont", RELATIVE_CONS (tm_mon , 1) }, - {"fort", RELATIVE_CONS (tm_mday, 14) }, - {"week", RELATIVE_CONS (tm_mday, 7) }, - {"day" , RELATIVE_CONS (tm_mday, 1) }, - {"hour", RELATIVE_CONS (tm_hour, 1) }, - {"min" , RELATIVE_CONS (tm_min , 1) }, - {"sec" , RELATIVE_CONS (tm_sec , 1) }, - {"", TM_UNDEFINED} -}; - -static struct name_val const ago[] = -{ - {"ago", 0}, - {"", TM_UNDEFINED} -}; - -static struct name_val const dst_names[] = -{ - {"dst", 1}, - {"", 0} -}; - -#define hr60nonnegative(t) ((t)/100 * 60 + (t)%100) -#define hr60(t) ((t) < 0 ? - hr60nonnegative (-(t)) : hr60nonnegative (t)) -#define zs(t, s) {s, hr60 (t)} -#define zd(t, s, d) zs (t, s), zs ((t) + 100, d) - -static struct name_val const zone_names[] = -{ - zs (-1000, "hst"), /* Hawaii */ - zd (-1000, "hast", "hadt"), /* Hawaii-Aleutian */ - zd (- 900, "akst", "akdt"), /* Alaska */ - zd (- 800, "pst" , "pdt" ), /* Pacific */ - zd (- 700, "mst" , "mdt" ), /* Mountain */ - zd (- 600, "cst" , "cdt" ), /* Central */ - zd (- 500, "est" , "edt" ), /* Eastern */ - zd (- 400, "ast" , "adt" ), /* Atlantic */ - zd (- 330, "nst" , "ndt" ), /* Newfoundland */ - zs ( 000, "utc" ), /* Coordinated Universal */ - zs ( 000, "uct" ), /* " */ - zs ( 000, "cut" ), /* " */ - zs ( 000, "ut"), /* Universal */ - zs ( 000, "z"), /* Zulu (required by ISO 8601) */ - zd ( 000, "gmt" , "bst" ), /* Greenwich Mean, British Summer */ - zd ( 000, "wet" , "west"), /* Western European */ - zd ( 100, "cet" , "cest"), /* Central European */ - zd ( 100, "met" , "mest"), /* Middle European (bug in old tz versions) */ - zd ( 100, "mez" , "mesz"), /* Mittel-Europaeische Zeit */ - zd ( 200, "eet" , "eest"), /* Eastern European */ - zs ( 530, "ist" ), /* India */ - zd ( 900, "jst" , "jdt" ), /* Japan */ - zd ( 900, "kst" , "kdt" ), /* Korea */ - zd ( 1200, "nzst", "nzdt"), /* New Zealand */ - {"lt", 1}, -#if 0 - /* The following names are duplicates or are not well attested. - It's not worth keeping a complete list, since alphabetic time zone names - are deprecated and there are lots more where these came from. */ - zs (-1100, "sst" ), /* Samoan */ - zd (- 900, "yst" , "ydt" ), /* Yukon - name is no longer used */ - zd (- 500, "ast" , "adt" ), /* Acre */ - zd (- 400, "wst" , "wdt" ), /* Western Brazil */ - zd (- 400, "cst" , "cdt" ), /* Chile */ - zd (- 200, "fst" , "fdt" ), /* Fernando de Noronha */ - zs ( 000, "wat" ), /* West African */ - zs ( 100, "cat" ), /* Central African */ - zs ( 200, "sat" ), /* South African */ - zd ( 200, "ist" , "idt" ), /* Israel */ - zs ( 300, "eat" ), /* East African */ - zd ( 300, "msk" , "msd" ), /* Moscow */ - zd ( 330, "ist" , "idt" ), /* Iran */ - zs ( 800, "hkt" ), /* Hong Kong */ - zs ( 800, "sgt" ), /* Singapore */ - zd ( 800, "cst" , "cdt" ), /* China */ - zd ( 800, "wst" , "wst" ), /* Western Australia */ - zd ( 930, "cst" , "cst" ), /* Central Australia */ - zs ( 1000, "gst" ), /* Guam */ - zd ( 1000, "est" , "est" ), /* Eastern Australia */ -#endif - {"", -1} -}; - -/* Look for a prefix of S in TABLE, returning val for first matching entry. */ -static int -lookup (s, table) - char const *s; - struct name_val const table[]; -{ - int j; - char buf[NAME_LENGTH_MAXIMUM]; - - for (j = 0; j < NAME_LENGTH_MAXIMUM; j++) - { - unsigned char c = *s; - if (! ISALPHA (c)) - { - buf[j] = '\0'; - break; - } - buf[j] = ISUPPER (c) ? tolower (c) : c; - s++; - s += *s == '.'; - } - - for (;; table++) - for (j = 0; ; j++) - if (j == NAME_LENGTH_MAXIMUM || ! table[0].name[j]) - return table[0].val; - else if (buf[j] != table[0].name[j]) - break; -} - - -/* Set *T to ``undefined'' values. */ -static void -undefine (t) - struct partime *t; -{ - t->tm.tm_sec = t->tm.tm_min = t->tm.tm_hour = t->tm.tm_mday = t->tm.tm_mon - = t->tm.tm_year = t->tm.tm_wday = t->tm.tm_yday - = t->wday_ordinal = t->ymodulus = t->yweek - = TM_UNDEFINED; - t->tmr.tm_sec = t->tmr.tm_min = t->tmr.tm_hour = - t->tmr.tm_mday = t->tmr.tm_mon = t->tmr.tm_year = 0; - t->zone = TM_UNDEFINED_ZONE; -} - -/* Patterns to look for in a time string. - Order is important: we look for the first matching pattern - whose values do not contradict values that we already know about. - See `parse_pattern_letter' below for the meaning of the pattern codes. */ -static char const time_patterns[] = -{ - /* Traditional patterns come first, - to prevent an ISO 8601 format from misinterpreting their prefixes. */ - - /* RFC 822, extended */ - 'E', '_', 'N', '_', 'y', '$', 0, - 'x', 0, - - /* traditional */ - '4', '_', 'M', '_', 'D', '_', 'h', '_', 'm', '_', 's', '$', 0, - 'R', '_', 'M', '_', 'D', '_', 'h', '_', 'm', '_', 's', '$', 0, - 'E', '_', 'N', 0, - 'N', '_', 'E', '_', 'y', ';', 0, - 'N', '_', 'E', ';', 0, - 'N', 0, - 't', ':', 'm', ':', 's', '_', 'A', 0, - 't', ':', 'm', '_', 'A', 0, - 't', '_', 'A', 0, - - /* traditional get_date */ - 'i', '_', 'x', 0, - 'Y', '/', 'n', '/', 'E', ';', 0, - 'n', '/', 'E', '/', 'y', ';', 0, - 'n', '/', 'E', ';', 0, - 'u', 0, - - /* ISO 8601:1988 formats, generalized a bit. */ - 'y', '-', 'M', '-', 'D', '$', 0, - '4', 'M', 'D', '$', 0, - 'Y', '-', 'M', '$', 0, - 'R', 'M', 'D', '$', 0, - '-', 'R', '=', 'M', '$', 0, - '-', 'R', '$', 0, - '-', '-', 'M', '=', 'D', '$', 0, - 'M', '=', 'D', 'T', 0, - '-', '-', 'M', '$', 0, - '-', '-', '-', 'D', '$', 0, - 'D', 'T', 0, - 'Y', '-', 'd', '$', 0, - '4', 'd', '$', 0, - 'R', '=', 'd', '$', 0, - '-', 'd', '$', 0, - 'd', 'T', 0, - 'y', '-', 'W', '-', 'X', 0, - 'y', 'W', 'X', 0, - 'y', '=', 'W', 0, - '-', 'r', '-', 'W', '-', 'X', 0, - 'r', '-', 'W', '-', 'X', 'T', 0, - '-', 'r', 'W', 'X', 0, - 'r', 'W', 'X', 'T', 0, - '-', 'W', '=', 'X', 0, - 'W', '=', 'X', 'T', 0, - '-', 'W', 0, - '-', 'w', '-', 'X', 0, - 'w', '-', 'X', 'T', 0, - '-', '-', '-', 'X', '$', 0, - 'X', 'T', 0, - '4', '$', 0, - 'T', 0, - 'h', ':', 'm', ':', 's', '$', 0, - 'h', 'm', 's', '$', 0, - 'h', ':', 'L', '$', 0, - 'h', 'L', '$', 0, - 'H', '$', 0, - '-', 'm', ':', 's', '$', 0, - '-', 'm', 's', '$', 0, - '-', 'L', '$', 0, - '-', '-', 's', '$', 0, - 'Y', 0, - 'Z', 0, - - 0 -}; - -/* Parse an initial prefix of STR according to *PATTERNS, setting *T. - Return the first character after the prefix, or 0 if it couldn't be parsed. - *PATTERNS is a character array containing one pattern string after another; - it is terminated by an empty string. - If success, set *PATTERNS to the next pattern to try. - Set *PATTERNS to 0 if we know there are no more patterns to try; - if *PATTERNS is initially 0, give up immediately. */ -static char const * -parse_prefix (str, patterns, t) - char const *str; - char const **patterns; - struct partime *t; -{ - char const *pat = *patterns; - unsigned char c; - - if (! pat) - return 0; - - /* Remove initial noise. */ - while (! ISALNUM (c = *str) && c != '-' && c != '+') - { - if (! c) - { - undefine (t); - *patterns = 0; - return str; - } - - str++; - } - - /* Try a pattern until one succeeds. */ - while (*pat) - { - char const *s = str; - undefine (t); - - do - { - if (! (c = *pat++)) - { - *patterns = pat; - return s; - } - } - while ((s = parse_pattern_letter (s, c, t)) != 0); - - while (*pat++) - continue; - } - - return 0; -} - -/* Parse an initial prefix of S of length DIGITS; it must be a number. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_fixed (s, digits, res) - char const *s; - int digits, *res; -{ - int n = 0; - char const *lim = s + digits; - while (s < lim) - { - unsigned d = *s++ - '0'; - if (9 < d) - return 0; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse a possibly empty initial prefix of S. - Store the parsed number into *RES. - Return the first character after the prefix. */ -static char const * -parse_varying (s, res) - char const *s; - int *res; -{ - int n = 0; - for (;;) - { - unsigned d = *s - '0'; - if (9 < d) - break; - s++; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_ranged (s, digits, lo, hi, res) - char const *s; - int digits, lo, hi, *res; -{ - s = parse_fixed (s, digits, res); - return s && lo <= *res && *res <= hi ? s : 0; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI - and it may be followed by a fraction to be computed using RESOLUTION. - Store the parsed number into *RES; store the fraction times RESOLUTION, - rounded to the nearest integer, into *FRES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_decimal (s, digits, lo, hi, resolution, res, fres) - char const *s; - int digits, lo, hi, resolution, *res, *fres; -{ - s = parse_fixed (s, digits, res); - if (s && lo <= *res && *res <= hi) - { - int f = 0; - if ((s[0] == ',' || s[0] == '.') && ISDIGIT (s[1])) - { - char const *s1 = ++s; - int num10 = 0, denom10 = 10, product; - while (ISDIGIT (*++s)) - { - int d = denom10 * 10; - if (d / 10 != denom10) - return 0; /* overflow */ - denom10 = d; - } - s = parse_fixed (s1, (int) (s - s1), &num10); - product = num10 * resolution; - f = (product + (denom10 >> 1)) / denom10; - f -= f & (product % denom10 == denom10 >> 1); /* round to even */ - if (f < 0 || product/resolution != num10) - return 0; /* overflow */ - } - *fres = f; - return s; - } - return 0; -} - -/* Parse an initial prefix of S; it must denote a time zone. - Set *ZONE to the number of seconds east of GMT, - or to TM_LOCAL_ZONE if it is the local time zone. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -char * -parzone (s, zone) - char const *s; - long *zone; -{ - char const *s1; - char sign; - int hh, mm, ss; - int minutes_east_of_UTC; - int trailing_DST; - long offset, z; - - /* The formats are LT, n, n DST, nDST, no, o - where n is a time zone name - and o is a time zone offset of the form [-+]hh[:mm[:ss]]. */ - switch (*s) - { - case '-': - case '+': - z = 0; - break; - - default: - minutes_east_of_UTC = lookup (s, zone_names); - if (minutes_east_of_UTC == -1) - return 0; - - /* Don't bother to check rest of spelling, - but look for an embedded "DST". */ - trailing_DST = 0; - while (ISALPHA ((unsigned char) *s)) - { - if ((*s == 'D' || *s == 'd') && lookup (s, dst_names)) - trailing_DST = 1; - s++; - s += *s == '.'; - } - - /* Don't modify LT. */ - if (minutes_east_of_UTC == 1) - { - *zone = TM_LOCAL_ZONE; - return (char *) s; - } - - z = minutes_east_of_UTC * 60L; - s1 = s; - - /* Look for trailing "DST" or " DST". */ - while (ISSPACE ((unsigned char) *s)) - s++; - if (lookup (s, dst_names)) - { - while (ISALPHA ((unsigned char) *s)) - { - s++; - s += *s == '.'; - } - trailing_DST = 1; - } - - if (trailing_DST) - { - *zone = z + 60*60; - return (char *) s; - } - - s = s1; - - switch (*s) - { - case '-': - case '+': - break; - - default: - *zone = z; - return (char *) s; - } - - break; - } - - sign = *s++; - - if (! (s = parse_ranged (s, 2, 0, 23, &hh))) - return 0; - mm = ss = 0; - if (*s == ':') - s++; - if (ISDIGIT (*s)) - { - if (! (s = parse_ranged (s, 2, 0, 59, &mm))) - return 0; - if (*s == ':' && s[-3] == ':' && ISDIGIT (s[1]) - && ! (s = parse_ranged (s + 1, 2, 0, 59, &ss))) - return 0; - } - if (ISDIGIT (*s)) - return 0; - offset = (hh * 60 + mm) * 60L + ss; - *zone = z + (sign == '-' ? -offset : offset); - /* ?? Are fractions allowed here? If so, they're not implemented. */ - return (char *) s; -} - -/* Parse an initial prefix of S, matching the pattern whose code is C. - Set *T accordingly. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_pattern_letter (s, c, t) - char const *s; - int c; - struct partime *t; -{ - char const *s0 = s; - - switch (c) - { - case '$': /* The next character must be a non-digit. */ - if (ISDIGIT (*s)) - return 0; - break; - - case '-': - case '/': - case ':': - /* These characters stand for themselves. */ - if (*s++ != c) - return 0; - break; - - case '4': /* 4-digit year */ - s = parse_fixed (s, 4, &t->tm.tm_year); - break; - - case ';': /* The next character must be a non-digit, and cannot be ':'. */ - if (ISDIGIT (*s) || *s == ':') - return 0; - break; - - case '=': /* optional '-' */ - s += *s == '-'; - break; - - case 'A': /* AM or PM */ - /* This matches the regular expression [AaPp]\.?([Mm]\.?)?. - It must not be followed by a letter or digit; - otherwise it would match prefixes of strings like "PST". */ - switch (*s) - { - case 'A': - case 'a': - if (t->tm.tm_hour == 12) - t->tm.tm_hour = 0; - break; - - case 'P': - case 'p': - if (t->tm.tm_hour != 12) - t->tm.tm_hour += 12; - break; - - default: - return 0; - } - s++; - s += *s == '.'; - switch (*s) - { - case 'M': - case 'm': - s++; - s += *s == '.'; - break; - } - if (ISALNUM ((unsigned char) *s)) - return 0; - break; - - case 'D': /* day of month [01-31] */ - s = parse_ranged (s, 2, 1, 31, &t->tm.tm_mday); - break; - - case 'd': /* day of year [001-366] */ - s = parse_ranged (s, 3, 1, 366, &t->tm.tm_yday); - t->tm.tm_yday--; - break; - - case 'E': /* traditional day of month [1-9, 01-31] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 31, - &t->tm.tm_mday); - break; - - case 'h': /* hour [00-23] */ - s = parse_ranged (s, 2, 0, 23, &t->tm.tm_hour); - break; - - case 'H': /* hour [00-23 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 23, 60 * 60, &t->tm.tm_hour, &frac); - t->tm.tm_min = frac / 60; - t->tm.tm_sec = frac % 60; - } - break; - - case 'i': /* ordinal day number, e.g. "3rd" */ - s = parse_varying (s, &t->wday_ordinal); - if (s == s0) - return 0; - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'L': /* minute [00-59 followed by optional fraction] */ - s = parse_decimal (s, 2, 0, 59, 60, &t->tm.tm_min, &t->tm.tm_sec); - break; - - case 'm': /* minute [00-59] */ - s = parse_ranged (s, 2, 0, 59, &t->tm.tm_min); - break; - - case 'M': /* month [01-12] */ - s = parse_ranged (s, 2, 1, 12, &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'n': /* traditional month [1-9, 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'N': /* month name [e.g. "Jan"] */ - if (! TM_DEFINED (t->tm.tm_mon = lookup (s, month_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'r': /* year % 10 (remainder in origin-0 decade) [0-9] */ - s = parse_fixed (s, 1, &t->tm.tm_year); - t->ymodulus = 10; - break; - - case_R: - case 'R': /* year % 100 (remainder in origin-0 century) [00-99] */ - s = parse_fixed (s, 2, &t->tm.tm_year); - t->ymodulus = 100; - break; - - case 's': /* second [00-60 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 60, 1, &t->tm.tm_sec, &frac); - t->tm.tm_sec += frac; - } - break; - - case 'T': /* 'T' or 't' */ - switch (*s++) - { - case 'T': - case 't': - break; - default: - return 0; - } - break; - - case 't': /* traditional hour [1-9 or 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_hour); - break; - - case 'u': /* relative unit */ - { - int i; - int n; - int negative = 0; - switch (*s) - { - case '-': negative = 1; - /* Fall through. */ - case '+': s++; - } - if (ISDIGIT (*s)) - s = parse_varying (s, &n); - else if (s == s0) - n = 1; - else - return 0; - if (negative) - n = -n; - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - i = lookup (s, relative_units); - if (!TM_DEFINED (i)) - return 0; - * (int *) ((char *) &t->tmr + RELATIVE_OFFSET (i)) - += n * RELATIVE_MULTIPLIER (i); - while (ISALPHA ((unsigned char) *s)) - s++; - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - if (TM_DEFINED (lookup (s, ago))) - { - t->tmr.tm_sec = - t->tmr.tm_sec; - t->tmr.tm_min = - t->tmr.tm_min; - t->tmr.tm_hour = - t->tmr.tm_hour; - t->tmr.tm_mday = - t->tmr.tm_mday; - t->tmr.tm_mon = - t->tmr.tm_mon; - t->tmr.tm_year = - t->tmr.tm_year; - while (ISALPHA ((unsigned char) *s)) - s++; - } - break; - } - - case 'w': /* 'W' or 'w' only (stands for current week) */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - break; - - case 'W': /* 'W' or 'w', followed by a week of year [00-53] */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - s = parse_ranged (s, 2, 0, 53, &t->yweek); - break; - - case 'X': /* weekday (1=Mon ... 7=Sun) [1-7] */ - s = parse_ranged (s, 1, 1, 7, &t->tm.tm_wday); - t->tm.tm_wday--; - break; - - case 'x': /* weekday name [e.g. "Sun"] */ - if (! TM_DEFINED (t->tm.tm_wday = lookup (s, weekday_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'y': /* either R or Y */ - if (ISDIGIT (s[0]) && ISDIGIT (s[1]) && ! ISDIGIT (s[2])) - goto case_R; - /* fall into */ - case 'Y': /* year in full [4 or more digits] */ - s = parse_varying (s, &t->tm.tm_year); - if (s - s0 < 4) - return 0; - break; - - case 'Z': /* time zone */ - s = parzone (s, &t->zone); - break; - - case '_': /* possibly empty sequence of non-alphanumerics */ - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - break; - - default: /* bad pattern */ - return 0; - } - - return s; -} - -/* If there is no conflict, merge into *T the additional information in *U - and return 0. Otherwise do nothing and return -1. */ -static int -merge_partime (t, u) - struct partime *t; - struct partime const *u; -{ -# define conflict(a,b) ((a) != (b) && TM_DEFINED (a) && TM_DEFINED (b)) - if (conflict (t->tm.tm_sec, u->tm.tm_sec) - || conflict (t->tm.tm_min, u->tm.tm_min) - || conflict (t->tm.tm_hour, u->tm.tm_hour) - || conflict (t->tm.tm_mday, u->tm.tm_mday) - || conflict (t->tm.tm_mon, u->tm.tm_mon) - || conflict (t->tm.tm_year, u->tm.tm_year) - || conflict (t->tm.tm_wday, u->tm.tm_wday) - || conflict (t->tm.tm_yday, u->tm.tm_yday) - || conflict (t->ymodulus, u->ymodulus) - || conflict (t->yweek, u->yweek) - || (t->zone != u->zone - && t->zone != TM_UNDEFINED_ZONE - && u->zone != TM_UNDEFINED_ZONE)) - return -1; -# undef conflict -# define merge_(a,b) if (TM_DEFINED (b)) (a) = (b); - merge_ (t->tm.tm_sec, u->tm.tm_sec) - merge_ (t->tm.tm_min, u->tm.tm_min) - merge_ (t->tm.tm_hour, u->tm.tm_hour) - merge_ (t->tm.tm_mday, u->tm.tm_mday) - merge_ (t->tm.tm_mon, u->tm.tm_mon) - merge_ (t->tm.tm_year, u->tm.tm_year) - merge_ (t->tm.tm_wday, u->tm.tm_wday) - merge_ (t->tm.tm_yday, u->tm.tm_yday) - merge_ (t->ymodulus, u->ymodulus) - merge_ (t->yweek, u->yweek) -# undef merge_ - t->tmr.tm_sec += u->tmr.tm_sec; - t->tmr.tm_min += u->tmr.tm_min; - t->tmr.tm_hour += u->tmr.tm_hour; - t->tmr.tm_mday += u->tmr.tm_mday; - t->tmr.tm_mon += u->tmr.tm_mon; - t->tmr.tm_year += u->tmr.tm_year; - if (u->zone != TM_UNDEFINED_ZONE) - t->zone = u->zone; - return 0; -} - -/* Parse a date/time prefix of S, putting the parsed result into *T. - Return the first character after the prefix. - The prefix may contain no useful information; - in that case, *T will contain only undefined values. */ -char * -partime (s, t) - char const *s; - struct partime *t; -{ - struct partime p; - - undefine (t); - - while (*s) - { - char const *patterns = time_patterns; - char const *s1; - - do - { - if (! (s1 = parse_prefix (s, &patterns, &p))) - return (char *) s; - } - while (merge_partime (t, &p) != 0); - - s = s1; - } - - return (char *) s; -} Property changes on: vendor/misc-GNU/patch/2.5.9/partime.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/rmdir.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/rmdir.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/rmdir.c (nonexistent) @@ -1,87 +0,0 @@ -/* BSD compatible remove directory function for System V - Copyright (C) 1988, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#ifndef errno -extern int errno; -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -/* rmdir adapted from GNU tar. */ - -/* Remove directory DPATH. - Return 0 if successful, -1 if not. */ - -int -rmdir (dpath) - char *dpath; -{ - pid_t cpid; - int status; - struct stat statbuf; - - if (stat (dpath, &statbuf) != 0) - return -1; /* errno already set */ - - if (!S_ISDIR (statbuf.st_mode)) - { - errno = ENOTDIR; - return -1; - } - - cpid = fork (); - switch (cpid) - { - case -1: /* cannot fork */ - return -1; /* errno already set */ - - case 0: /* child process */ - execl ("/bin/rmdir", "rmdir", dpath, (char *) 0); - _exit (1); - - default: /* parent process */ - - /* Wait for kid to finish. */ - - while (wait (&status) != cpid) - /* Do nothing. */ ; - - if (status) - { - - /* /bin/rmdir failed. */ - - errno = EIO; - return -1; - } - return 0; - } -} Property changes on: vendor/misc-GNU/patch/2.5.9/rmdir.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/gettext.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/gettext.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/gettext.h (nonexistent) @@ -1,69 +0,0 @@ -/* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _LIBGETTEXT_H -#define _LIBGETTEXT_H 1 - -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS - -/* Get declarations of GNU message catalog functions. */ -# include - -#else - -/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which - chokes if dcgettext is defined as a macro. So include it now, to make - later inclusions of a NOP. We don't include - as well because people using "gettext.h" will not include , - and also including would fail on SunOS 4, whereas - is OK. */ -#if defined(__sun) -# include -#endif - -/* Disabled NLS. - The casts to 'const char *' serve the purpose of producing warnings - for invalid uses of the value returned from these functions. - On pre-ANSI systems without 'const', the config.h file is supposed to - contain "#define const". */ -# define gettext(Msgid) ((const char *) (Msgid)) -# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define textdomain(Domainname) ((const char *) (Domainname)) -# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) -# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) - -#endif - -/* A pseudo function call that serves as a marker for the automated - extraction of messages, but does not call gettext(). The run-time - translation is done at a different place in the code. - The argument, String, should be a literal string. Concatenated strings - and other string expressions won't work. - The macro's expansion is not parenthesized, so that it is suitable as - initializer for static 'char[]' or 'const char[]' variables. */ -#define gettext_noop(String) String - -#endif /* _LIBGETTEXT_H */ Property changes on: vendor/misc-GNU/patch/2.5.9/gettext.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/getopt.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/getopt.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/getopt.h (nonexistent) @@ -1,180 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if (defined __STDC__ && __STDC__) || defined __cplusplus - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if (defined __STDC__ && __STDC__) || defined __cplusplus -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ Property changes on: vendor/misc-GNU/patch/2.5.9/getopt.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/getopt.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/getopt.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/getopt.c (nonexistent) @@ -1,1273 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#ifdef VMS -# include -# if HAVE_STRING_H - 0 -# include -# endif -#endif - -#ifdef _LIBC -# include -#else -/* This is for other GNU distributions with internationalized messages. */ -# include "gettext.h" -#endif -#define _(msgid) gettext (msgid) - -#if defined _LIBC && defined USE_IN_LIBIO -# include -#endif - -#ifndef attribute_hidden -# define attribute_hidden -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized attribute_hidden; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -# if HAVE_STRING_H -# include -# else -# include -# endif - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Stored original parameters. - XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ -extern int __libc_argc; -extern char **__libc_argv; - -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -# ifdef USE_NONOPTION_FLAGS -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; -# endif - -# ifdef USE_NONOPTION_FLAGS -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -# else -# define SWAP_FLAGS(ch1, ch2) -# endif -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#if defined _LIBC && defined USE_NONOPTION_FLAGS - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#if defined _LIBC && defined USE_NONOPTION_FLAGS - if (posixly_correct == NULL - && argc == __libc_argc && argv == __libc_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int print_errors = opterr; - if (optstring[0] == ':') - print_errors = 0; - - if (argc < 1) - return -1; - - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#if defined _LIBC && defined USE_NONOPTION_FLAGS -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else if (long_only - || pfound->has_arg != p->has_arg - || pfound->flag != p->flag - || pfound->val != p->val) - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) - { - - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); -#endif - } - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (argv[optind - 1][1] == '-') - { - /* --option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("\ -%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); -#else - fprintf (stderr, _("\ -%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); -#endif - } - else - { - /* +option or -option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("\ -%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], - pfound->name); -#else - fprintf (stderr, _("\ -%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); -#endif - } - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (argv[optind][1] == '-') - { - /* --option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); -#else - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); -#endif - } - else - { - /* +option or -option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); -#else - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (posixly_correct) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: illegal option -- %c\n"), - argv[0], c); -#else - fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); -#endif - } - else - { -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: invalid option -- %c\n"), - argv[0], c); -#else - fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, - _("%s: option requires an argument -- %c\n"), - argv[0], c) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); -#endif - } - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); -#endif - } - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); -#endif - } - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option requires an argument -- %c\n"), - argv[0], c) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.5.9/getopt.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/inp.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/inp.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/inp.h (nonexistent) @@ -1,29 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.h,v 1.7 2003/05/20 14:05:22 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - Copyright (C) 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -XTERN LINENUM input_lines; /* how long is input file in lines */ - -char const *ifetch (LINENUM, bool, size_t *); -void get_input_file (char const *, char const *); -void re_input (void); -void scan_input (char *); Property changes on: vendor/misc-GNU/patch/2.5.9/inp.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/COPYING =================================================================== --- vendor/misc-GNU/patch/2.5.9/COPYING (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/COPYING (nonexistent) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Property changes on: vendor/misc-GNU/patch/2.5.9/COPYING ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/malloc.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/malloc.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/malloc.c (nonexistent) @@ -1,38 +0,0 @@ -/* Work around bug on some systems where malloc (0) fails. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#if HAVE_CONFIG_H -# include -#endif -#undef malloc - -#include - -char *malloc (); - -/* Allocate an N-byte block of memory from the heap. - If N is zero, allocate a 1-byte block. */ - -char * -rpl_malloc (size_t n) -{ - if (n == 0) - n = 1; - return malloc (n); -} Property changes on: vendor/misc-GNU/patch/2.5.9/malloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/getopt1.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/getopt1.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/getopt1.c (nonexistent) @@ -1,195 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _LIBC -# include -#else -# include "getopt.h" -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - -# ifdef _LIBC -libc_hidden_def (getopt_long) -libc_hidden_def (getopt_long_only) -# endif - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/2.5.9/getopt1.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/partime.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/partime.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/partime.h (nonexistent) @@ -1,77 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#define TM_UNDEFINED (-1) -#define TM_DEFINED(x) (0 <= (x)) - -/* #include if you want to use these symbols. */ -#define TM_LOCAL_ZONE LONG_MIN -#define TM_UNDEFINED_ZONE (LONG_MIN + 1) - -struct partime - { - /* This structure describes the parsed time. - Only the following tm_* members are used: - sec, min, hour, mday, mon, year, wday, yday. - If ! TM_DEFINED (value), the parser never found the value. - The tm_year field is the actual year, not the year - 1900; - but see ymodulus below. */ - struct tm tm; - - /* Like tm, but values are relative to the value in tm, - and values are initialized to 0 rather than to TM_UNDEFINED. - Only the following tm_* members are used: - sec, min, hour, mday, mon, year. */ - struct tm tmr; - - /* If TM_DEFINED (wday_ordinal), - then day number (e.g. 3 in "3rd Sunday"). */ - int wday_ordinal; - - /* If TM_DEFINED (ymodulus), - then tm.tm_year is actually modulo ymodulus. */ - int ymodulus; - - /* Week of year, ISO 8601 style. - If ! TM_DEFINED (yweek), the parser never found yweek. - Weeks start on Mondays. - Week 1 includes Jan 4. */ - int yweek; - - /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */ - long zone; - }; - -#if defined __STDC__ || has_prototypes -# define __PARTIME_P(x) x -#else -# define __PARTIME_P(x) () -#endif - -char *partime __PARTIME_P ((char const *, struct partime *)); -char *parzone __PARTIME_P ((char const *, long *)); Property changes on: vendor/misc-GNU/patch/2.5.9/partime.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/aclocal.m4 =================================================================== --- vendor/misc-GNU/patch/2.5.9/aclocal.m4 (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/aclocal.m4 (nonexistent) @@ -1,667 +0,0 @@ -# backupfile.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_BACKUPFILE], -[ - dnl Prerequisites of lib/backupfile.c. - AC_REQUIRE([AC_HEADER_DIRENT]) - AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h) - AC_CHECK_DECLS_ONCE(getenv malloc) - jm_CHECK_TYPE_STRUCT_DIRENT_D_INO - - dnl Prerequisites of lib/addext.c. - AC_REQUIRE([jm_AC_DOS]) - AC_SYS_LONG_FILE_NAMES - AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h) - AC_CHECK_FUNCS(pathconf) -]) -#serial 5 - -dnl From Jim Meyering. -dnl -dnl Check whether struct dirent has a member named d_ino. -dnl - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO], - [AC_REQUIRE([AC_HEADER_DIRENT])dnl - AC_CACHE_CHECK([for d_ino member in directory struct], - jm_cv_struct_dirent_d_ino, - [AC_TRY_LINK(dnl - [ -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - ], - [struct dirent dp; dp.d_ino = 0;], - - jm_cv_struct_dirent_d_ino=yes, - jm_cv_struct_dirent_d_ino=no) - ] - ) - if test $jm_cv_struct_dirent_d_ino = yes; then - AC_DEFINE(D_INO_IN_DIRENT, 1, - [Define if there is a member named d_ino in the struct describing - directory headers.]) - fi - ] -) -# dirname.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_DIRNAME], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([jm_AC_DOS]) - - dnl Prerequisites of lib/dirname.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/basename.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/stripslash.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) -#serial 5 - -# Define some macros required for proper operation of code in lib/*.c -# on MSDOS/Windows systems. - -# From Jim Meyering. - -AC_DEFUN([jm_AC_DOS], - [ - AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], - [ - AC_TRY_COMPILE([], - [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif], - [ac_cv_win_or_dos=yes], - [ac_cv_win_or_dos=no]) - ]) - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - AH_VERBATIM(FILESYSTEM_PREFIX_LEN, - [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], - $ac_fs_accepts_drive_letter_prefix, - [Define on systems for which file names may have a so-called - `drive letter' prefix, define this to compute the length of that - prefix, including the colon.]) - - AH_VERBATIM(ISSLASH, - [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], - $ac_fs_backslash_is_file_name_separator, - [Define if the backslash character may also serve as a file name - component separator.]) - ]) -#serial 7 - -AC_DEFUN([gl_ERROR], -[ - AC_FUNC_ERROR_AT_LINE - dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). - jm_PREREQ_ERROR -]) - -# Prerequisites of lib/error.c. -AC_DEFUN([jm_PREREQ_ERROR], -[ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_VPRINTF]) - AC_CHECK_FUNCS(strerror) - AC_CHECK_DECLS([strerror]) - AC_FUNC_STRERROR_R -]) -# getopt.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_GETOPT], -[ - dnl Prerequisites of lib/getopt.c. - AC_CHECK_HEADERS_ONCE(string.h) -]) -# malloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether malloc accepts 0 as its argument. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_MALLOC], -[ - AC_REQUIRE([AC_FUNC_MALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - gl_PREREQ_MALLOC - fi -]) - -# Prerequisites of lib/malloc.c. -AC_DEFUN([gl_PREREQ_MALLOC], [ - : -]) -# mbrtowc.m4 serial 5 -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert - -dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with -dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. - -AC_DEFUN([jm_FUNC_MBRTOWC], -[ - AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], - jm_cv_func_mbrtowc, - [AC_TRY_LINK( - [#include ], - [mbstate_t state; return ! (sizeof state && mbrtowc);], - jm_cv_func_mbrtowc=yes, - jm_cv_func_mbrtowc=no)]) - if test $jm_cv_func_mbrtowc = yes; then - AC_DEFINE(HAVE_MBRTOWC, 1, - [Define to 1 if mbrtowc and mbstate_t are properly declared.]) - fi -]) -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# From Paul Eggert. - -# BeOS 5 has but does not define mbstate_t, -# so you can't declare an object of that type. -# Check for this incompatibility with Standard C. - -# AC_TYPE_MBSTATE_T -# ----------------- -AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include ], - [mbstate_t x; return sizeof x;])], - [ac_cv_type_mbstate_t=yes], - [ac_cv_type_mbstate_t=no])]) - if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T], 1, - [Define to 1 if declares mbstate_t.]) - else - AC_DEFINE([mbstate_t], int, - [Define to a type if does not define.]) - fi]) -# memchr.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_MEMCHR], -[ - AC_REPLACE_FUNCS(memchr) - if test $ac_cv_func_memchr = no; then - jm_PREREQ_MEMCHR - fi -]) - -# Prerequisites of lib/memchr.c. -AC_DEFUN([jm_PREREQ_MEMCHR], [ - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) - AC_CHECK_HEADERS(bp-sym.h) -]) -#serial 1 - -dnl From Mumit Khan and Paul Eggert -dnl Determine whether mkdir accepts only one argument instead of the usual two. - -AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG], - [AC_CHECK_FUNCS(mkdir) - AC_CACHE_CHECK([whether mkdir takes only one argument], - patch_cv_mkdir_takes_one_arg, - [patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".", 0);], - , - [AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".");], - patch_cv_mkdir_takes_one_arg=yes - )] - ) - fi - ] - ) - if test $patch_cv_mkdir_takes_one_arg = yes; then - AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, - [Define if mkdir takes only one argument.]) - fi - ] -) -# onceonly.m4 serial 3 -dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl This file defines some "once only" variants of standard autoconf macros. -dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS -dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS -dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS -dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC -dnl The advantage is that the check for each of the headers/functions/decls -dnl will be put only once into the 'configure' file. It keeps the size of -dnl the 'configure' file down, and avoids redundant output when 'configure' -dnl is run. -dnl The drawback is that the checks cannot be conditionalized. If you write -dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi -dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to -dnl empty, and the check will be inserted before the body of the AC_DEFUNed -dnl function. - -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) - -# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of -# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). -AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ - : - AC_FOREACH([gl_HEADER_NAME], [$1], [ - AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), - [-./], [___])), [ - AC_CHECK_HEADERS(gl_HEADER_NAME) - ]) - AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, - [-./], [___]))) - ]) -]) - -# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of -# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). -AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ - : - AC_FOREACH([gl_FUNC_NAME], [$1], [ - AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ - AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) - ]) - AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) - ]) -]) - -# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of -# AC_CHECK_DECLS(DECL1, DECL2, ...). -AC_DEFUN([AC_CHECK_DECLS_ONCE], [ - : - AC_FOREACH([gl_DECL_NAME], [$1], [ - AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ - AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) - ]) - AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) - ]) -]) -# quote.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTE], -[ - dnl Prerequisites of lib/quote.c. - AC_CHECK_HEADERS_ONCE(stddef.h) -]) -# quotearg.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTEARG], -[ - dnl Prerequisites of lib/quotearg.c. - AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) - AC_CHECK_FUNCS_ONCE(iswprint mbsinit) - AC_TYPE_MBSTATE_T - jm_FUNC_MBRTOWC -]) -# realloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether realloc works when both arguments are 0. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_REALLOC], -[ - AC_REQUIRE([AC_FUNC_REALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - gl_PREREQ_REALLOC - fi -]) - -# Prerequisites of lib/realloc.c. -AC_DEFUN([gl_PREREQ_REALLOC], [ - : -]) -# rmdir.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_RMDIR], -[ - AC_REPLACE_FUNCS(rmdir) - if test $ac_cv_func_rmdir = no; then - gl_PREREQ_RMDIR - fi -]) - -# Prerequisites of lib/rmdir.c. -AC_DEFUN([gl_PREREQ_RMDIR], [ - AC_REQUIRE([AC_HEADER_STAT]) - : -]) - -# Check for setmode, DOS style. - -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AC_FUNC_SETMODE_DOS], - [AC_CHECK_HEADERS(fcntl.h unistd.h) - AC_CACHE_CHECK([for DOS-style setmode], - [ac_cv_func_setmode_dos], - [AC_TRY_LINK( - [#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif], - [int ret = setmode && setmode (1, O_BINARY);], - [ac_cv_func_setmode_dos=yes], - [ac_cv_func_setmode_dos=no])]) - if test $ac_cv_func_setmode_dos = yes; then - AC_DEFINE(HAVE_SETMODE_DOS, 1, - [Define to 1 if you have the DOS-style `setmode' function.]) - fi]) -# Check for stdbool.h that conforms to C99. - -# Copyright (C) 2002-2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Prepare for substituting if it is not supported. - -AC_DEFUN([AM_STDBOOL_H], -[ - AC_REQUIRE([AC_HEADER_STDBOOL]) - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - AC_SUBST([STDBOOL_H]) - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - AC_SUBST([HAVE__BOOL]) -]) - -# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf -# have this macro built-in. - -AC_DEFUN([AC_HEADER_STDBOOL], - [AC_CACHE_CHECK([for stdbool.h that conforms to C99], - [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - ], - [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], - [ac_cv_header_stdbool_h=yes], - [ac_cv_header_stdbool_h=no])]) - AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) - fi]) -#serial 7 -*- autoconf -*- - -dnl From Jim Meyering. -dnl -dnl See if the glibc *_unlocked I/O macros or functions are available. -dnl Use only those *_unlocked macros or functions that are declared -dnl (because some of them were declared in Solaris 2.5.1 but were removed -dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run -dnl on Solaris 2.6). - -AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], -[ - dnl Persuade glibc to declare fgets_unlocked(), fputs_unlocked() - dnl etc. - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS_ONCE( - [clearerr_unlocked feof_unlocked ferror_unlocked - fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked - fread_unlocked fwrite_unlocked getc_unlocked - getchar_unlocked putc_unlocked putchar_unlocked]) -]) -#serial 5 - -dnl From Jim Meyering - -dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- -dnl usually in . -dnl Some systems have utime.h but don't declare the struct anywhere. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], -[ - AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) - AC_REQUIRE([AC_HEADER_TIME]) - AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf, - [AC_TRY_COMPILE( - [ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - ], - [static struct utimbuf x; x.actime = x.modtime;], - fu_cv_sys_struct_utimbuf=yes, - fu_cv_sys_struct_utimbuf=no) - ]) - - if test $fu_cv_sys_struct_utimbuf = yes; then - AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, - [Define if struct utimbuf is declared -- usually in . - Some systems have utime.h but don't declare the struct anywhere. ]) - fi -]) -# xalloc.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_XALLOC], -[ - gl_PREREQ_XMALLOC - gl_PREREQ_XSTRDUP -]) - -# Prerequisites of lib/xmalloc.c. -AC_DEFUN([gl_PREREQ_XMALLOC], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([jm_FUNC_MALLOC]) - AC_REQUIRE([jm_FUNC_REALLOC]) -]) - -# Prerequisites of lib/xstrdup.c. -AC_DEFUN([gl_PREREQ_XSTRDUP], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/2.5.9/install-sh =================================================================== --- vendor/misc-GNU/patch/2.5.9/install-sh (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/install-sh (nonexistent) @@ -1,294 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" - -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift - - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi - - pathcomp=$pathcomp/ -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi - -# Make a couple of temp file names in the proper directory. - - dsttmp=$dstdir/#inst.$$# - rmtmp=$dstdir/#rm.$$# - -# Trap to clean up temp files at exit. - - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 - -# Move or copy the file name to the temp name - - $doit $instcmd "$src" "$dsttmp" && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && - -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. - -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && - -# Now rename the file to the real destination. - - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - -fi && - -# The final little trick to "correctly" pass the exit status to the exit trap. - -{ - (exit 0); exit -} Property changes on: vendor/misc-GNU/patch/2.5.9/install-sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/xalloc.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/xalloc.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/xalloc.h (nonexistent) @@ -1,87 +0,0 @@ -/* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef XALLOC_H_ -# define XALLOC_H_ - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -# ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ -# define __attribute__(x) -# endif -# endif - -# ifndef ATTRIBUTE_NORETURN -# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) -# endif - -/* Exit value when the requested amount of memory is not available. - It is initialized to EXIT_FAILURE, but the caller may set it to - some other value. */ -extern int xalloc_exit_failure; - -/* If this pointer is non-zero, run the specified function upon each - allocation failure. It is initialized to zero. */ -extern void (*xalloc_fail_func) PARAMS ((void)); - -/* If XALLOC_FAIL_FUNC is undefined or a function that returns, this - message is output. It is translated via gettext. - Its value is "memory exhausted". */ -extern char const xalloc_msg_memory_exhausted[]; - -/* This function is always triggered when memory is exhausted. It is - in charge of honoring the three previous items. This is the - function to call when one wants the program to die because of a - memory allocation failure. */ -extern void xalloc_die PARAMS ((void)) ATTRIBUTE_NORETURN; - -void *xmalloc PARAMS ((size_t n)); -void *xcalloc PARAMS ((size_t n, size_t s)); -void *xrealloc PARAMS ((void *p, size_t n)); -char *xstrdup PARAMS ((const char *str)); - -# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) -# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) -# define XREALLOC(Ptr, Type, N_items) \ - ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) - -/* Declare and alloc memory for VAR of type TYPE. */ -# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) - -/* Free VAR only if non NULL. */ -# define XFREE(Var) \ - do { \ - if (Var) \ - free (Var); \ - } while (0) - -/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ -# define CCLONE(Src, Num) \ - (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) - -/* Return a malloc'ed copy of SRC. */ -# define CLONE(Src) CCLONE (Src, 1) - - -#endif /* !XALLOC_H_ */ Property changes on: vendor/misc-GNU/patch/2.5.9/xalloc.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/patch.man =================================================================== --- vendor/misc-GNU/patch/2.5.9/patch.man (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/patch.man (nonexistent) @@ -1,1160 +0,0 @@ -.\" patch man page -.de Id -.ds Dt \\$4 -.. -.Id $Id: patch.man,v 1.31 2002/05/25 10:36:44 eggert Exp $ -.ds = \-\^\- -.de Sp -.if t .sp .3 -.if n .sp -.. -.TH PATCH 1 \*(Dt GNU -.ta 3n -.SH NAME -patch \- apply a diff file to an original -.SH SYNOPSIS -.B patch -.RI [ options ] -.RI [ originalfile -.RI [ patchfile ]] -.Sp -but usually just -.Sp -.BI "patch \-p" "num" -.BI < patchfile -.SH DESCRIPTION -.B patch -takes a patch file -.I patchfile -containing a difference listing produced by the -.B diff -program and applies those differences to one or more original files, -producing patched versions. -Normally the patched versions are put in place of the originals. -Backups can be made; see the -.B \-b -or -.B \*=backup -option. -The names of the files to be patched are usually taken from the patch file, -but if there's just one file to be patched it can specified on the -command line as -.IR originalfile . -.PP -Upon startup, patch attempts to determine the type of the diff listing, -unless overruled by a -\fB\-c\fP (\fB\*=context\fP), -\fB\-e\fP (\fB\*=ed\fP), -\fB\-n\fP (\fB\*=normal\fP), -or -\fB\-u\fP (\fB\*=unified\fP) -option. -Context diffs (old-style, new-style, and unified) and -normal diffs are applied by the -.B patch -program itself, while -.B ed -diffs are simply fed to the -.BR ed (1) -editor via a pipe. -.PP -.B patch -tries to skip any leading garbage, apply the diff, -and then skip any trailing garbage. -Thus you could feed an article or message containing a -diff listing to -.BR patch , -and it should work. -If the entire diff is indented by a consistent amount, -or if a context diff contains lines ending in \s-1CRLF\s0 -or is encapsulated one or more times by prepending -"\fB\- \fP" to lines starting with "\fB\-\fP" as specified by Internet RFC 934, -this is taken into account. -After removing indenting or encapsulation, -lines beginning with -.B # -are ignored, as they are considered to be comments. -.PP -With context diffs, and to a lesser extent with normal diffs, -.B patch -can detect when the line numbers mentioned in the patch are incorrect, -and attempts to find the correct place to apply each hunk of the patch. -As a first guess, it takes the line number mentioned for the hunk, plus or -minus any offset used in applying the previous hunk. -If that is not the correct place, -.B patch -scans both forwards and backwards for a set of lines matching the context -given in the hunk. -First -.B patch -looks for a place where all lines of the context match. -If no such place is found, and it's a context diff, and the maximum fuzz factor -is set to 1 or more, then another scan takes place ignoring the first and last -line of context. -If that fails, and the maximum fuzz factor is set to 2 or more, -the first two and last two lines of context are ignored, -and another scan is made. -(The default maximum fuzz factor is 2.) -If -.B patch -cannot find a place to install that hunk of the patch, it puts the -hunk out to a reject file, which normally is the name of the output file -plus a -.B \&.rej -suffix, or -.B # -if -.B \&.rej -would generate a file name that is too long -(if even appending the single character -.B # -makes the file name too long, then -.B # -replaces the file name's last character). -(The rejected hunk comes out in ordinary context diff form regardless of -the input patch's form. -If the input was a normal diff, many of the contexts are simply null.) -The line numbers on the hunks in the reject file may be different than -in the patch file: they reflect the approximate location patch thinks the -failed hunks belong in the new file rather than the old one. -.PP -As each hunk is completed, you are told if the hunk -failed, and if so which line (in the new file) -.B patch -thought the hunk should go on. -If the hunk is installed at a different line -from the line number specified in the diff you -are told the offset. -A single large offset -.I may -indicate that a hunk was installed in the -wrong place. -You are also told if a fuzz factor was used to make the match, in which -case you should also be slightly suspicious. -If the -.B \*=verbose -option is given, you are also told about hunks that match exactly. -.PP -If no original file -.I origfile -is specified on the command line, -.B patch -tries to figure out from the leading garbage what the name of the file -to edit is, using the following rules. -.LP -First, -.B patch -takes an ordered list of candidate file names as follows: -.TP 3 -.B " \(bu" -If the header is that of a context diff, -.B patch -takes the old and new file names in the header. -A name is ignored if it does not have enough slashes to satisfy the -.BI \-p num -or -.BI \*=strip= num -option. -The name -.B /dev/null -is also ignored. -.TP -.B " \(bu" -If there is an -.B Index:\& -line in the leading garbage -and if either the old and new names are both absent or if -.B patch -is conforming to \s-1POSIX\s0, -.B patch -takes the name in the -.B Index:\& -line. -.TP -.B " \(bu" -For the purpose of the following rules, -the candidate file names are considered to be in the order (old, new, index), -regardless of the order that they appear in the header. -.LP -Then -.B patch -selects a file name from the candidate list as follows: -.TP 3 -.B " \(bu" -If some of the named files exist, -.B patch -selects the first name if conforming to \s-1POSIX\s0, -and the best name otherwise. -.TP -.B " \(bu" -If -.B patch -is not ignoring \s-1RCS\s0, ClearCase, Perforce, and \s-1SCCS\s0 (see the -.BI "\-g\ " num -or -.BI \*=get= num -option), and no named files exist -but an \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master is found, -.B patch -selects the first named file -with an \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master. -.TP -.B " \(bu" -If no named files exist, -no \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master was found, -some names are given, -.B patch -is not conforming to \s-1POSIX\s0, -and the patch appears to create a file, -.B patch -selects the best name requiring the creation of the fewest directories. -.TP -.B " \(bu" -If no file name results from the above heuristics, you are asked -for the name of the file to patch, and -.B patch -selects that name. -.LP -To determine the -.I best -of a nonempty list of file names, -.B patch -first takes all the names with the fewest path name components; -of those, it then takes all the names with the shortest basename; -of those, it then takes all the shortest names; -finally, it takes the first remaining name. -.PP -Additionally, if the leading garbage contains a -.B Prereq:\& -line, -.B patch -takes the first word from the prerequisites line (normally a version -number) and checks the original file to see if that word can be found. -If not, -.B patch -asks for confirmation before proceeding. -.PP -The upshot of all this is that you should be able to say, while in a news -interface, something like the following: -.Sp - \fB| patch \-d /usr/src/local/blurfl\fP -.Sp -and patch a file in the -.B blurfl -directory directly from the article containing -the patch. -.PP -If the patch file contains more than one patch, -.B patch -tries to apply each of them as if they came from separate patch files. -This means, among other things, that it is assumed that the name of the file -to patch must be determined for each diff listing, -and that the garbage before each diff listing -contains interesting things such as file names and revision level, as -mentioned previously. -.SH OPTIONS -.TP 3 -\fB\-b\fP or \fB\*=backup\fP -Make backup files. -That is, when patching a file, -rename or copy the original instead of removing it. -When backing up a file that does not exist, -an empty, unreadable backup file is created -as a placeholder to represent the nonexistent file. -See the -.B \-V -or -.B \*=version\-control -option for details about how backup file names are determined. -.TP -.B \*=backup\-if\-mismatch -Back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default unless -.B patch -is conforming to \s-1POSIX\s0. -.TP -.B \*=no\-backup\-if\-mismatch -Do not back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default if -.B patch -is conforming to \s-1POSIX\s0. -.TP -\fB\-B\fP \fIpref\fP or \fB\*=prefix=\fP\fIpref\fP -Prefix -.I pref -to a file name when generating its simple backup file name. -For example, with -.B "\-B\ /junk/" -the simple backup file name for -.B src/patch/util.c -is -.BR /junk/src/patch/util.c . -.TP -\fB\*=binary\fP -Read and write all files in binary mode, -except for standard output and -.BR /dev/tty . -This option has no effect on \s-1POSIX\s0-conforming systems. -On systems like \s-1DOS\s0 where this option makes a difference, -the patch should be generated by -.BR "diff\ \-a\ \*=binary" . -.TP -\fB\-c\fP or \fB\*=context\fP -Interpret the patch file as a ordinary context diff. -.TP -\fB\-d\fP \fIdir\fP or \fB\*=directory=\fP\fIdir\fP -Change to the directory -.I dir -immediately, before doing -anything else. -.TP -\fB\-D\fP \fIdefine\fP or \fB\*=ifdef=\fP\fIdefine\fP -Use the -.BR #ifdef " .\|.\|. " #endif -construct to mark changes, with -.I define -as the differentiating symbol. -.TP -.B "\*=dry\-run" -Print the results of applying the patches without actually changing any files. -.TP -\fB\-e\fP or \fB\*=ed\fP -Interpret the patch file as an -.B ed -script. -.TP -\fB\-E\fP or \fB\*=remove\-empty\-files\fP -Remove output files that are empty after the patches have been applied. -Normally this option is unnecessary, since -.B patch -can examine the time stamps on the header to determine whether a file -should exist after patching. -However, if the input is not a context diff or if -.B patch -is conforming to \s-1POSIX\s0, -.B patch -does not remove empty patched files unless this option is given. -When -.B patch -removes a file, it also attempts to remove any empty ancestor directories. -.TP -\fB\-f\fP or \fB\*=force\fP -Assume that the user knows exactly what he or she is doing, and do not -ask any questions. Skip patches whose headers -do not say which file is to be patched; patch files even though they have the -wrong version for the -.B Prereq:\& -line in the patch; and assume that -patches are not reversed even if they look like they are. -This option does not suppress commentary; use -.B \-s -for that. -.TP -\fB\-F\fP \fInum\fP or \fB\*=fuzz=\fP\fInum\fP -Set the maximum fuzz factor. -This option only applies to diffs that have context, and causes -.B patch -to ignore up to that many lines in looking for places to install a hunk. -Note that a larger fuzz factor increases the odds of a faulty patch. -The default fuzz factor is 2, and it may not be set to more than -the number of lines of context in the context diff, ordinarily 3. -.TP -\fB\-g\fP \fInum\fP or \fB\*=get=\fP\fInum\fP -This option controls -.BR patch 's -actions when a file is under \s-1RCS\s0 or \s-1SCCS\s0 control, -and does not exist or is read-only and matches the default version, -or when a file is under ClearCase or Perforce control and does not exist. -If -.I num -is positive, -.B patch -gets (or checks out) the file from the revision control system; if zero, -.B patch -ignores \s-1RCS\s0, ClearCase, Perforce, and \s-1SCCS\s0 -and does not get the file; and if negative, -.B patch -asks the user whether to get the file. -The default value of this option is given by the value of the -.B PATCH_GET -environment variable if it is set; if not, the default value is zero if -.B patch -is conforming to \s-1POSIX\s0, negative otherwise. -.TP -.B "\*=help" -Print a summary of options and exit. -.TP -\fB\-i\fP \fIpatchfile\fP or \fB\*=input=\fP\fIpatchfile\fP -Read the patch from -.IR patchfile . -If -.I patchfile -is -.BR \- , -read from standard input, the default. -.TP -\fB\-l\fP or \fB\*=ignore\-whitespace\fP -Match patterns loosely, in case tabs or spaces -have been munged in your files. -Any sequence of one or more blanks in the patch file matches any sequence -in the original file, and sequences of blanks at the ends of lines are ignored. -Normal characters must still match exactly. -Each line of the context must still match a line in the original file. -.TP -\fB\-n\fP or \fB\*=normal\fP -Interpret the patch file as a normal diff. -.TP -\fB\-N\fP or \fB\*=forward\fP -Ignore patches that seem to be reversed or already applied. -See also -.BR \-R . -.TP -\fB\-o\fP \fIoutfile\fP or \fB\*=output=\fP\fIoutfile\fP -Send output to -.I outfile -instead of patching files in place. -Do not use this option if -.I outfile -is one of the files to be patched. -.TP -\fB\-p\fP\fInum\fP or \fB\*=strip\fP\fB=\fP\fInum\fP -Strip the smallest prefix containing -.I num -leading slashes from each file name found in the patch file. -A sequence of one or more adjacent slashes is counted as a single slash. -This controls how file names found in the patch file are treated, in case -you keep your files in a different directory than the person who sent -out the patch. -For example, supposing the file name in the patch file was -.Sp - \fB/u/howard/src/blurfl/blurfl.c\fP -.Sp -setting -.B \-p0 -gives the entire file name unmodified, -.B \-p1 -gives -.Sp - \fBu/howard/src/blurfl/blurfl.c\fP -.Sp -without the leading slash, -.B \-p4 -gives -.Sp - \fBblurfl/blurfl.c\fP -.Sp -and not specifying -.B \-p -at all just gives you \fBblurfl.c\fP. -Whatever you end up with is looked for either in the current directory, -or the directory specified by the -.B \-d -option. -.TP -.B \*=posix -Conform more strictly to the \s-1POSIX\s0 standard, as follows. -.RS -.TP 3 -.B " \(bu" -Take the first existing file from the list (old, new, index) -when intuiting file names from diff headers. -.TP -.B " \(bu" -Do not remove files that are empty after patching. -.TP -.B " \(bu" -Do not ask whether to get files from \s-1RCS\s0, ClearCase, Perforce, -or \s-1SCCS\s0. -.TP -.B " \(bu" -Require that all options precede the files in the command line. -.TP -.B " \(bu" -Do not backup files when there is a mismatch. -.RE -.TP -.BI \*=quoting\-style= word -Use style -.I word -to quote output names. -The -.I word -should be one of the following: -.RS -.TP -.B literal -Output names as-is. -.TP -.B shell -Quote names for the shell if they contain shell metacharacters or would -cause ambiguous output. -.TP -.B shell-always -Quote names for the shell, even if they would normally not require quoting. -.TP -.B c -Quote names as for a C language string. -.TP -.B escape -Quote as with -.B c -except omit the surrounding double-quote characters. -.LP -You can specify the default value of the -.B \*=quoting\-style -option with the environment variable -.BR QUOTING_STYLE . -If that environment variable is not set, the default value is -.BR shell . -.RE -.TP -\fB\-r\fP \fIrejectfile\fP or \fB\*=reject\-file=\fP\fIrejectfile\fP -Put rejects into -.I rejectfile -instead of the default -.B \&.rej -file. -.TP -\fB\-R\fP or \fB\*=reverse\fP -Assume that this patch was created with the old and new files swapped. -(Yes, I'm afraid that does happen occasionally, human nature being what it -is.) -.B patch -attempts to swap each hunk around before applying it. -Rejects come out in the swapped format. -The -.B \-R -option does not work with -.B ed -diff scripts because there is too little -information to reconstruct the reverse operation. -.Sp -If the first hunk of a patch fails, -.B patch -reverses the hunk to see if it can be applied that way. -If it can, you are asked if you want to have the -.B \-R -option set. -If it can't, the patch continues to be applied normally. -(Note: this method cannot detect a reversed patch if it is a normal diff -and if the first command is an append (i.e. it should have been a delete) -since appends always succeed, due to the fact that a null context matches -anywhere. -Luckily, most patches add or change lines rather than delete them, so most -reversed normal diffs begin with a delete, which fails, triggering -the heuristic.) -.TP -\fB\-s\fP or \fB\*=silent\fP or \fB\*=quiet\fP -Work silently, unless an error occurs. -.TP -\fB\-t\fP or \fB\*=batch\fP -Suppress questions like -.BR \-f , -but make some different assumptions: -skip patches whose headers do not contain file names (the same as \fB\-f\fP); -skip patches for which the file has the wrong version for the -.B Prereq:\& -line -in the patch; and assume that patches are reversed if they look like -they are. -.TP -\fB\-T\fP or \fB\*=set\-time\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use local time. This option is not recommended, because patches using -local time cannot easily be used by people in other time zones, and -because local time stamps are ambiguous when local clocks move backwards -during daylight-saving time adjustments. Instead of using this option, -generate patches with \s-1UTC\s0 and use the -.B \-Z -or -.B \*=set\-utc -option instead. -.TP -\fB\-u\fP or \fB\*=unified\fP -Interpret the patch file as a unified context diff. -.TP -\fB\-v\fP or \fB\*=version\fP -Print out -.BR patch 's -revision header and patch level, and exit. -.TP -\fB\-V\fP \fImethod\fP or \fB\*=version\-control=\fP\fImethod\fP -Use -.I method -to determine -backup file names. The method can also be given by the -.B PATCH_VERSION_CONTROL -(or, if that's not set, the -.BR VERSION_CONTROL ) -environment variable, which is overridden by this option. -The method does not affect whether backup files are made; -it affects only the names of any backup files that are made. -.Sp -The value of -.I method -is like the \s-1GNU\s0 -Emacs `version-control' variable; -.B patch -also recognizes synonyms that -are more descriptive. The valid values for -.I method -are (unique abbreviations are -accepted): -.RS -.TP 3 -\fBexisting\fP or \fBnil\fP -Make numbered backups of files that already have them, -otherwise simple backups. -This is the default. -.TP -\fBnumbered\fP or \fBt\fP -Make numbered backups. The numbered backup file name for -.I F -is -.IB F .~ N ~ -where -.I N -is the version number. -.TP -\fBsimple\fP or \fBnever\fP -Make simple backups. -The -.B \-B -or -.BR \*=prefix , -.B \-Y -or -.BR \*=basename\-prefix , -and -.B \-z -or -.BR \*=suffix -options specify the simple backup file name. -If none of these options are given, then a simple backup suffix is used; -it is the value of the -.B SIMPLE_BACKUP_SUFFIX -environment variable if set, and is -.B \&.orig -otherwise. -.PP -With numbered or simple backups, -if the backup file name is too long, the backup suffix -.B ~ -is used instead; if even appending -.B ~ -would make the name too long, then -.B ~ -replaces the last character of the file name. -.RE -.TP -\fB\*=verbose\fP -Output extra information about the work being done. -.TP -\fB\-x\fP \fInum\fP or \fB\*=debug=\fP\fInum\fP -Set internal debugging flags of interest only to -.B patch -patchers. -.TP -\fB\-Y\fP \fIpref\fP or \fB\*=basename\-prefix=\fP\fIpref\fP -Prefix -.I pref -to the basename of a file name when generating its simple backup file name. -For example, with -.B "\-Y\ .del/" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/.del/util.c . -.TP -\fB\-z\fP \fIsuffix\fP or \fB\*=suffix=\fP\fIsuffix\fP -Use -.I suffix -as the simple backup suffix. -For example, with -.B "\-z\ -" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/util.c- . -The backup suffix may also be specified by the -.B SIMPLE_BACKUP_SUFFIX -environment variable, which is overridden by this option. -.TP -\fB\-Z\fP or \fB\*=set\-utc\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use Coordinated Universal Time (\s-1UTC\s0, often known as \s-1GMT\s0). -Also see the -.B \-T -or -.B \*=set\-time -option. -.Sp -The -.B \-Z -or -.B \*=set\-utc -and -.B \-T -or -.B \*=set\-time -options normally refrain from setting a file's time if the file's original time -does not match the time given in the patch header, or if its -contents do not match the patch exactly. However, if the -.B \-f -or -.B \*=force -option is given, the file time is set regardless. -.Sp -Due to the limitations of -.B diff -output format, these options cannot update the times of files whose -contents have not changed. Also, if you use these options, you should remove -(e.g. with -.BR "make\ clean" ) -all files that depend on the patched files, so that later invocations of -.B make -do not get confused by the patched files' times. -.SH ENVIRONMENT -.TP 3 -.B PATCH_GET -This specifies whether -.B patch -gets missing or read-only files from \s-1RCS\s0, ClearCase, Perforce, -or \s-1SCCS\s0 -by default; see the -.B \-g -or -.B \*=get -option. -.TP -.B POSIXLY_CORRECT -If set, -.B patch -conforms more strictly to the \s-1POSIX\s0 standard by default: -see the -.B \*=posix -option. -.TP -.B QUOTING_STYLE -Default value of the -.B \*=quoting\-style -option. -.TP -.B SIMPLE_BACKUP_SUFFIX -Extension to use for simple backup file names instead of -.BR \&.orig . -.TP -\fBTMPDIR\fP, \fBTMP\fP, \fBTEMP\fP -Directory to put temporary files in; -.B patch -uses the first environment variable in this list that is set. -If none are set, the default is system-dependent; -it is normally -.B /tmp -on Unix hosts. -.TP -\fBVERSION_CONTROL\fP or \fBPATCH_VERSION_CONTROL\fP -Selects version control style; see the -.B \-v -or -.B \*=version\-control -option. -.SH FILES -.TP 3 -.IB $TMPDIR "/p\(**" -temporary files -.TP -.B /dev/tty -controlling terminal; used to get answers to questions asked of the user -.SH "SEE ALSO" -.BR diff (1), -.BR ed (1) -.Sp -Marshall T. Rose and Einar A. Stefferud, -Proposed Standard for Message Encapsulation, -Internet RFC 934 (1985-01). -.SH "NOTES FOR PATCH SENDERS" -There are several things you should bear in mind if you are going to -be sending out patches. -.PP -Create your patch systematically. -A good method is the command -.BI "diff\ \-Naur\ " "old\ new" -where -.I old -and -.I new -identify the old and new directories. -The names -.I old -and -.I new -should not contain any slashes. -The -.B diff -command's headers should have dates -and times in Universal Time using traditional Unix format, -so that patch recipients can use the -.B \-Z -or -.B \*=set\-utc -option. -Here is an example command, using Bourne shell syntax: -.Sp - \fBLC_ALL=C TZ=UTC0 diff \-Naur gcc\-2.7 gcc\-2.8\fP -.PP -Tell your recipients how to apply the patch -by telling them which directory to -.B cd -to, and which -.B patch -options to use. The option string -.B "\-Np1" -is recommended. -Test your procedure by pretending to be a recipient and applying -your patch to a copy of the original files. -.PP -You can save people a lot of grief by keeping a -.B patchlevel.h -file which is patched to increment the patch level -as the first diff in the patch file you send out. -If you put a -.B Prereq:\& -line in with the patch, it won't let them apply -patches out of order without some warning. -.PP -You can create a file by sending out a diff that compares -.B /dev/null -or an empty file dated the Epoch (1970-01-01 00:00:00 \s-1UTC\s0) -to the file you want to create. -This only works if the file you want to create doesn't exist already in -the target directory. -Conversely, you can remove a file by sending out a context diff that compares -the file to be deleted with an empty file dated the Epoch. -The file will be removed unless -.B patch -is conforming to \s-1POSIX\s0 and the -.B \-E -or -.B \*=remove\-empty\-files -option is not given. -An easy way to generate patches that create and remove files -is to use \s-1GNU\s0 -.BR diff 's -.B \-N -or -.B \*=new\-file -option. -.PP -If the recipient is supposed to use the -.BI \-p N -option, do not send output that looks like this: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -because the two file names have different numbers of slashes, -and different versions of -.B patch -interpret the file names differently. -To avoid confusion, send output that looks like this instead: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README v2.0.30/prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ v2.0.30/prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -.PP -Avoid sending patches that compare backup file names like -.BR README.orig , -since this might confuse -.B patch -into patching a backup file instead of the real file. -Instead, send patches that compare the same base file names -in different directories, e.g.\& -.B old/README -and -.BR new/README . -.PP -Take care not to send out reversed patches, since it makes people wonder -whether they already applied the patch. -.PP -Try not to have your patch modify derived files -(e.g. the file -.B configure -where there is a line -.B "configure: configure.in" -in your makefile), since the recipient should be -able to regenerate the derived files anyway. -If you must send diffs of derived files, -generate the diffs using \s-1UTC\s0, -have the recipients apply the patch with the -.B \-Z -or -.B \*=set\-utc -option, and have them remove any unpatched files that depend on patched files -(e.g. with -.BR "make\ clean" ). -.PP -While you may be able to get away with putting 582 diff listings into -one file, it may be wiser to group related patches into separate files in -case something goes haywire. -.SH DIAGNOSTICS -Diagnostics generally indicate that -.B patch -couldn't parse your patch file. -.PP -If the -.B \*=verbose -option is given, the message -.B Hmm.\|.\|.\& -indicates that there is unprocessed text in -the patch file and that -.B patch -is attempting to intuit whether there is a patch in that text and, if so, -what kind of patch it is. -.PP -.BR patch 's -exit status is -0 if all hunks are applied successfully, -1 if some hunks cannot be applied, -and 2 if there is more serious trouble. -When applying a set of patches in a loop it behooves you to check this -exit status so you don't apply a later patch to a partially patched file. -.SH CAVEATS -Context diffs cannot reliably represent the creation or deletion of -empty files, empty directories, or special files such as symbolic links. -Nor can they represent changes to file metadata like ownership, permissions, -or whether one file is a hard link to another. -If changes like these are also required, separate instructions -(e.g. a shell script) to accomplish them should accompany the patch. -.PP -.B patch -cannot tell if the line numbers are off in an -.B ed -script, and can detect -bad line numbers in a normal diff only when it finds a change or deletion. -A context diff using fuzz factor 3 may have the same problem. -Until a suitable interactive interface is added, you should probably do -a context diff in these cases to see if the changes made sense. -Of course, compiling without errors is a pretty good indication that the patch -worked, but not always. -.PP -.B patch -usually produces the correct results, even when it has to do a lot of -guessing. -However, the results are guaranteed to be correct only when the patch is -applied to exactly the same version of the file that the patch was -generated from. -.SH "COMPATIBILITY ISSUES" -The \s-1POSIX\s0 standard specifies behavior that differs from -.BR patch 's -traditional behavior. -You should be aware of these differences if you must interoperate with -.B patch -versions 2.1 and earlier, which do not conform to \s-1POSIX\s0. -.TP 3 -.B " \(bu" -In traditional -.BR patch , -the -.B \-p -option's operand was optional, and a bare -.B \-p -was equivalent to -.BR \-p0. -The -.B \-p -option now requires an operand, and -.B "\-p\ 0" -is now equivalent to -.BR \-p0 . -For maximum compatibility, use options like -.B \-p0 -and -.BR \-p1 . -.Sp -Also, -traditional -.B patch -simply counted slashes when stripping path prefixes; -.B patch -now counts pathname components. -That is, a sequence of one or more adjacent slashes -now counts as a single slash. -For maximum portability, avoid sending patches containing -.B // -in file names. -.TP -.B " \(bu" -In traditional -.BR patch , -backups were enabled by default. -This behavior is now enabled with the -.B \-b -or -.B \*=backup -option. -.Sp -Conversely, in \s-1POSIX\s0 -.BR patch , -backups are never made, even when there is a mismatch. -In \s-1GNU\s0 -.BR patch , -this behavior is enabled with the -.B \*=no\-backup\-if\-mismatch -option, or by conforming to \s-1POSIX\s0 with the -.B \*=posix -option or by setting the -.B POSIXLY_CORRECT -environment variable. -.Sp -The -.BI \-b "\ suffix" -option -of traditional -.B patch -is equivalent to the -.BI "\-b\ \-z" "\ suffix" -options of \s-1GNU\s0 -.BR patch . -.TP -.B " \(bu" -Traditional -.B patch -used a complicated (and incompletely documented) method -to intuit the name of the file to be patched from the patch header. -This method did not conform to \s-1POSIX\s0, and had a few gotchas. -Now -.B patch -uses a different, equally complicated (but better documented) method -that is optionally \s-1POSIX\s0-conforming; we hope it has -fewer gotchas. The two methods are compatible if the -file names in the context diff header and the -.B Index:\& -line are all identical after prefix-stripping. -Your patch is normally compatible if each header's file names -all contain the same number of slashes. -.TP -.B " \(bu" -When traditional -.B patch -asked the user a question, it sent the question to standard error -and looked for an answer from -the first file in the following list that was a terminal: -standard error, standard output, -.BR /dev/tty , -and standard input. -Now -.B patch -sends questions to standard output and gets answers from -.BR /dev/tty . -Defaults for some answers have been changed so that -.B patch -never goes into an infinite loop when using default answers. -.TP -.B " \(bu" -Traditional -.B patch -exited with a status value that counted the number of bad hunks, -or with status 1 if there was real trouble. -Now -.B patch -exits with status 1 if some hunks failed, -or with 2 if there was real trouble. -.TP -.B " \(bu" -Limit yourself to the following options when sending instructions -meant to be executed by anyone running \s-1GNU\s0 -.BR patch , -traditional -.BR patch , -or a -.B patch -that conforms to \s-1POSIX\s0. -Spaces are significant in the following list, and operands are required. -.Sp -.nf -.in +3 -.ne 11 -.B \-c -.BI \-d " dir" -.BI \-D " define" -.B \-e -.B \-l -.B \-n -.B \-N -.BI \-o " outfile" -.BI \-p num -.B \-R -.BI \-r " rejectfile" -.in -.fi -.SH BUGS -Please report bugs via email to -.BR . -.PP -.B patch -could be smarter about partial matches, excessively deviant offsets and -swapped code, but that would take an extra pass. -.PP -If code has been duplicated (for instance with -\fB#ifdef OLDCODE\fP .\|.\|. \fB#else .\|.\|. #endif\fP), -.B patch -is incapable of patching both versions, and, if it works at all, will likely -patch the wrong one, and tell you that it succeeded to boot. -.PP -If you apply a patch you've already applied, -.B patch -thinks it is a reversed patch, and offers to un-apply the patch. -This could be construed as a feature. -.SH COPYING -Copyright -.ie t \(co -.el (C) -1984, 1985, 1986, 1988 Larry Wall. -.br -Copyright -.ie t \(co -.el (C) -1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the copyright holders instead of in -the original English. -.SH AUTHORS -Larry Wall wrote the original version of -.BR patch . -Paul Eggert removed -.BR patch 's -arbitrary limits; added support for binary files, -setting file times, and deleting files; -and made it conform better to \s-1POSIX\s0. -Other contributors include Wayne Davison, who added unidiff support, -and David MacKenzie, who added configuration and backup support. Index: vendor/misc-GNU/patch/2.5.9/argmatch.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/argmatch.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/argmatch.c (nonexistent) @@ -1,280 +0,0 @@ -/* argmatch.c -- find a match for a string in an array - - Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie - Modified by Akim Demaille */ - -#if HAVE_CONFIG_H -# include -#endif - -/* Specification. */ -#include "argmatch.h" - -#include -#include -#include - -#include "gettext.h" -#define _(msgid) gettext (msgid) - -#include "error.h" -#include "quotearg.h" -#include "quote.h" -#include "unlocked-io.h" - -/* When reporting an invalid argument, show nonprinting characters - by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use - literal_quoting_style. */ -#ifndef ARGMATCH_QUOTING_STYLE -# define ARGMATCH_QUOTING_STYLE locale_quoting_style -#endif - -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -/* Non failing version of argmatch call this function after failing. */ -#ifndef ARGMATCH_DIE -# define ARGMATCH_DIE exit (EXIT_FAILURE) -#endif - -#ifdef ARGMATCH_DIE_DECL -ARGMATCH_DIE_DECL; -#endif - -static void -__argmatch_die (void) -{ - ARGMATCH_DIE; -} - -/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h. - Default to __argmatch_die, but allow caller to change this at run-time. */ -argmatch_exit_fn argmatch_die = __argmatch_die; - - -/* If ARG is an unambiguous match for an element of the - null-terminated array ARGLIST, return the index in ARGLIST - of the matched element, else -1 if it does not match any element - or -2 if it is ambiguous (is a prefix of more than one element). - - If VALLIST is none null, use it to resolve ambiguities limited to - synonyms, i.e., for - "yes", "yop" -> 0 - "no", "nope" -> 1 - "y" is a valid argument, for `0', and "n" for `1'. */ - -int -argmatch (const char *arg, const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; /* Temporary index in ARGLIST. */ - size_t arglen; /* Length of ARG. */ - int matchind = -1; /* Index of first nonexact match. */ - int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ - - arglen = strlen (arg); - - /* Test all elements for either exact match or abbreviated matches. */ - for (i = 0; arglist[i]; i++) - { - if (!strncmp (arglist[i], arg, arglen)) - { - if (strlen (arglist[i]) == arglen) - /* Exact match found. */ - return i; - else if (matchind == -1) - /* First nonexact match found. */ - matchind = i; - else - { - /* Second nonexact match found. */ - if (vallist == NULL - || memcmp (vallist + valsize * matchind, - vallist + valsize * i, valsize)) - { - /* There is a real ambiguity, or we could not - disambiguate. */ - ambiguous = 1; - } - } - } - } - if (ambiguous) - return -2; - else - return matchind; -} - -/* Error reporting for argmatch. - CONTEXT is a description of the type of entity that was being matched. - VALUE is the invalid value that was given. - PROBLEM is the return value from argmatch. */ - -void -argmatch_invalid (const char *context, const char *value, int problem) -{ - char const *format = (problem == -1 - ? _("invalid argument %s for %s") - : _("ambiguous argument %s for %s")); - - error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value), - quote_n (1, context)); -} - -/* List the valid arguments for argmatch. - ARGLIST is the same as in argmatch. - VALLIST is a pointer to an array of values. - VALSIZE is the size of the elements of VALLIST */ -void -argmatch_valid (const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; - const char *last_val = NULL; - - /* We try to put synonyms on the same line. The assumption is that - synonyms follow each other */ - fprintf (stderr, _("Valid arguments are:")); - for (i = 0; arglist[i]; i++) - if ((i == 0) - || memcmp (last_val, vallist + valsize * i, valsize)) - { - fprintf (stderr, "\n - `%s'", arglist[i]); - last_val = vallist + valsize * i; - } - else - { - fprintf (stderr, ", `%s'", arglist[i]); - } - putc ('\n', stderr); -} - -/* Never failing versions of the previous functions. - - CONTEXT is the context for which argmatch is called (e.g., - "--version-control", or "$VERSION_CONTROL" etc.). Upon failure, - calls the (supposed never to return) function EXIT_FN. */ - -int -__xargmatch_internal (const char *context, - const char *arg, const char *const *arglist, - const char *vallist, size_t valsize, - argmatch_exit_fn exit_fn) -{ - int res = argmatch (arg, arglist, vallist, valsize); - if (res >= 0) - /* Success. */ - return res; - - /* We failed. Explain why. */ - argmatch_invalid (context, arg, res); - argmatch_valid (arglist, vallist, valsize); - (*exit_fn) (); - - return -1; /* To please the compilers. */ -} - -/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and - return the first corresponding argument in ARGLIST */ -const char * -argmatch_to_argument (const char *value, - const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; - - for (i = 0; arglist[i]; i++) - if (!memcmp (value, vallist + valsize * i, valsize)) - return arglist[i]; - return NULL; -} - -#ifdef TEST -/* - * Based on "getversion.c" by David MacKenzie - */ -char *program_name; -extern const char *getenv (); - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -/* Two tables describing arguments (keys) and their corresponding - values */ -static const char *const backup_args[] = -{ - "no", "none", "off", - "simple", "never", - "existing", "nil", - "numbered", "t", - 0 -}; - -static const enum backup_type backup_vals[] = -{ - none, none, none, - simple, simple, - numbered_existing, numbered_existing, - numbered, numbered -}; - -int -main (int argc, const char *const *argv) -{ - const char *cp; - enum backup_type backup_type = none; - - program_name = (char *) argv[0]; - - if (argc > 2) - { - fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name); - exit (1); - } - - if ((cp = getenv ("VERSION_CONTROL"))) - backup_type = XARGMATCH ("$VERSION_CONTROL", cp, - backup_args, backup_vals); - - if (argc == 2) - backup_type = XARGMATCH (program_name, argv[1], - backup_args, backup_vals); - - printf ("The version control is `%s'\n", - ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals)); - - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/2.5.9/argmatch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/NEWS =================================================================== --- vendor/misc-GNU/patch/2.5.9/NEWS (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/NEWS (nonexistent) @@ -1,237 +0,0 @@ -Changes in versions 2.5.8 and 2.5.9: bug fixes only. - -Changes in version 2.5.7: - -* patch -D now outputs preprocessor lines without comments, as required - by POSIX 1003.1-2001. - -Changes in version 2.5.6: - -* File names in context patches may now contain spaces, so long - as the context patch headers use a tab to separate the file name - from the time stamp. -* Perforce is now supported. -* Patch lines beginning with "#" are comments and are ignored. - -Changes in version 2.5.5: - -* The bug reporting address is now . - -Changes in version 2.5.4: - -* A security hole has been closed. - It involved race conditions with temporary files. - -* The default quoting style is 'shell', which causes `patch' to quote - file names with funny characters like `$'. This prevents their - misinterpretation if you cut them from its output and paste them into - the shell. - -* `patch' now works correctly with large files on Large File Summit - hosts like Solaris 2.6. - -* `patch' now ignores trailing carriage returns in lines of context diffs - if the context diff headers end in carriage return. - -* `patch' now ignores context diff header file names that have fewer slashes - than the count specified by the -p or --strip option. - -* New options: - --posix - --quoting-style=WORD - -* New environment variables: - QUOTING_STYLE - -* `patch' now supports ClearCase version management. - -Changes in version 2.5: - -* Version control is now independent of whether backups are made. - The -V or --version-control option and the VERSION_CONTROL and - PATCH_VERSION_CONTROL environment variables no longer affect whether - backups are made; they affect only the names of the backup files. - -* When asking the user whether to reverse a patch, - the default answer is now `no' instead of `yes'. - -* `patch' can now recognize context diffs that have been encapsulated - by prepending "- " to lines beginning with "-" (as per Internet RFC 934). - -* `patch' now reports an error if the input contains garbage and no patches. - -Changes in version 2.4: - -* New options: - -Z or --set-utc sets times of patched files, assuming diff uses UTC (GMT). - -T or --set-time is similar, assuming local time (not recommended). - --backup-if-mismatch makes a backup if the patch does not match exactly - --no-backup-if-mismatch makes a backup only if otherwise requested - -* The default is now --backup-if-mismatch unless POSIXLY_CORRECT is set. - -* The -B or --prefix, -Y or --basename-prefix, and -z or --suffix options - no longer affect whether backups are made (as they did in patch 2.2 and 2.3); - they now merely specify the file names used when simple backups are made. - -* When patching a nonexistent file and making backups, an empty backup file - is now made (just as with traditional patch); but the backup file is - unreadable, as a way of indicating that it represents a nonexistent file. - -* `patch' now matches against empty and nonexistent files more generously. - A patch against an empty file applies to a nonexistent file, and vice versa. - -* -g or --get and PATCH_GET now have a numeric value that specifies - whether `patch' is getting files. - If the value is positive, working files are gotten from RCS or SCCS files; - if zero, `patch' ignores RCS and SCCS and working files are not gotten; - and if negative, `patch' asks the user whether to get each file. - The default is normally negative, but it is zero if POSIXLY_CORRECT is set. - -* The -G or --no-get option introduced in GNU patch 2.3 has been removed; - use -g0 instead. - -* The method used to intuit names of files to be patched is changed again: - `Index:' lines are normally ignored for context diffs, - and RCS and SCCS files are normally looked for when files do not exist. - The complete new method is described in the man page. - -* By default, `patch' is now more verbose when patches do not match exactly. - -* The manual page has a new COMPATIBILITY ISSUES section. - -Changes in version 2.3: - -* Unless the POSIXLY_CORRECT environment variable is set: - - - `patch' now distinguishes more accurately between empty and - nonexistent files if the input is a context diff. - A file is assumed to not exist if its context diff header - suggests that it is empty, and if the header timestamp - looks like it might be equivalent to 1970-01-01 00:00:00 UTC. - - Files that ``become nonexistent'' after patching are now removed. - When a file is removed, any empty ancestor directories are also removed. - -* Files are now automatically gotten from RCS and SCCS - if the -g or --get option is specified. - (The -G or --no-get option, also introduced in 2.3, was withdrawn in 2.4.) - -* If the PATCH_VERSION_CONTROL environment variable is set, - it overrides the VERSION_CONTROL environment variable. - -* The method used to intuit names of files to be patched is changed. - (It was further revised in 2.4; see above.) - -* The new --binary option makes `patch' read and write files in binary mode. - This option has no effect on POSIX-compliant hosts; - it is useful only in on operating systems like DOS - that distinguish between text and binary I/O. - -* The environment variables TMP and TEMP are consulted for the name of - the temporary directory if TMPDIR is not set. - -* A port to MS-DOS and MS-Windows is available; see the `pc' directory. - -* Backup file names are no longer ever computed by uppercasing characters, - since this isn't portable to systems with case-insensitive file names. - -Changes in version 2.2: - -* Arbitrary limits removed (e.g. line length, file name length). - -* On POSIX.1-compliant hosts, you can now patch binary files using the output - of GNU `diff -a'. - -* New options: - --dry-run - --help - --verbose - -i FILE or --input=FILE - -Y PREF or --basename-prefix=PREF - -* patch is now quieter by default; use --verbose for the old chatty behavior. - -* Patch now complies better with POSIX.2 if your host complies with POSIX.1. - - Therefore: - - By default, no backups are made. - (But this was changed again in patch 2.4; see above.) - - The simple backup file name for F defaults to F.orig - regardless of whether the file system supports long file names, - and F~ is used only if F.orig is too long for that particular file. - - Similarly for the reject file names F.rej and F#. - - Also: - - The pseudo-option `+' has been withdrawn. - - -b is equivalent to --version-control=simple; - `-z SUFF' has the meaning that `-b SUFF' used to. - - Names of files to be patched are taken first from *** line and then from - --- line of context diffs; then from Index: line; /dev/tty is - consulted if none of the above files exist. However, if the patch - appears to create a file, the file does not have to exist: instead, - the first name with the longest existing directory prefix is taken. - (These rules were changed again in patch 2.3 and 2.4; see above.) - - Exit status 0 means success, 1 means hunks were rejected, 2 means trouble. - - `-l' ignores changes only in spaces and tabs, not in other white space. - - If no `-p' option is given, `-pINFINITY' is assumed, instead of trying - to guess the proper value. - - `-p' now requires an operand; use `-p 0' to get the effect of the old plain - `-p' option. - - `-p' treats two or more adjacent slashes as if it were one slash. - - The TERM signal is caught. - - New option `-i F' reads patch from F instead of stdin. - -* The `patch' options and build procedure conform to current GNU standards. - For example, the `--version' option now outputs copyright information. - -* When the patch is creating a file, but a nonempty file of that name already - exists, `patch' now asks for confirmation before patching. - -* RCS is used only if the version control method is `existing' - and there is already an RCS file. Similarly for SCCS. - (But this was changed again in patch 2.3 and 2.4; see above.) - -* Copyright notices have been clarified. Every file in this version of `patch' - can be distributed under the GNU General Public License. See README for - details. - -Changes in version 2.1: - -* A few more portability bugs have been fixed. The version number has - been changed from 2.0.12g11 to 2.1, because the name - `patch-2.0.12g10' was too long for traditional Unix file systems. - -Versions 2.0.12g9 through 2.0.12g11 fix various portability bugs. - -Changes in version 2.0.12g8: - -* Start of the 12g series, with a GNU-style configure script and - long-named options. -* Added the -t --batch option, similar to -f. -* Improved detection of files that are locked under RCS or SCCS. -* Reinstate the -E option to remove output files that are empty after - being patched. -* Print the system error message when system calls fail. -* Fixed various bugs and portability problems. - - - -Copyright (C) 1992, 1993, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -Free Software Foundation, Inc. - -This file is part of GNU Patch. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that they will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/2.5.9/NEWS ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/util.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/util.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/util.c (nonexistent) @@ -1,1013 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.c,v 1.36 2003/05/20 14:04:53 eggert Exp $ */ - -/* Copyright (C) 1986 Larry Wall - - Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include -#include - -#include -#include - -#include -#if !defined SIGCHLD && defined SIGCLD -#define SIGCHLD SIGCLD -#endif -#if ! HAVE_RAISE && ! defined raise -# define raise(sig) kill (getpid (), sig) -#endif - -#include - -static void makedirs (char *); - -/* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM - needs removal when cleaning up at the end of execution) - to TO, renaming it if possible and copying it if necessary. - If we must create TO, use MODE to create it. - If FROM is null, remove TO (ignoring FROMSTAT). - FROM_NEEDS_REMOVAL must be nonnull if FROM is nonnull. - Back up TO if BACKUP is true. */ - -void -move_file (char const *from, int volatile *from_needs_removal, - char *to, mode_t mode, bool backup) -{ - struct stat to_st; - int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno; - - if (backup) - { - int try_makedirs_errno = 0; - char *bakname; - - if (origprae || origbase) - { - char const *p = origprae ? origprae : ""; - char const *b = origbase ? origbase : ""; - char const *o = base_name (to); - size_t plen = strlen (p); - size_t tlen = o - to; - size_t blen = strlen (b); - size_t osize = strlen (o) + 1; - bakname = xmalloc (plen + tlen + blen + osize); - memcpy (bakname, p, plen); - memcpy (bakname + plen, to, tlen); - memcpy (bakname + plen + tlen, b, blen); - memcpy (bakname + plen + tlen + blen, o, osize); - for (p += FILESYSTEM_PREFIX_LEN (p); *p; p++) - if (ISSLASH (*p)) - { - try_makedirs_errno = ENOENT; - break; - } - } - else - { - bakname = find_backup_file_name (to, backup_type); - if (!bakname) - memory_fatal (); - } - - if (to_errno) - { - int fd; - - if (debug & 4) - say ("Creating empty unreadable file %s\n", quotearg (bakname)); - - try_makedirs_errno = ENOENT; - unlink (bakname); - while ((fd = creat (bakname, 0)) < 0) - { - if (errno != try_makedirs_errno) - pfatal ("Can't create file %s", quotearg (bakname)); - makedirs (bakname); - try_makedirs_errno = 0; - } - if (close (fd) != 0) - pfatal ("Can't close file %s", quotearg (bakname)); - } - else - { - if (debug & 4) - say ("Renaming file %s to %s\n", - quotearg_n (0, to), quotearg_n (1, bakname)); - while (rename (to, bakname) != 0) - { - if (errno != try_makedirs_errno) - pfatal ("Can't rename file %s to %s", - quotearg_n (0, to), quotearg_n (1, bakname)); - makedirs (bakname); - try_makedirs_errno = 0; - } - } - - free (bakname); - } - - if (from) - { - if (debug & 4) - say ("Renaming file %s to %s\n", - quotearg_n (0, from), quotearg_n (1, to)); - - if (rename (from, to) != 0) - { - bool to_dir_known_to_exist = false; - - if (errno == ENOENT - && (to_errno == -1 || to_errno == ENOENT)) - { - makedirs (to); - to_dir_known_to_exist = 1; - if (rename (from, to) == 0) - goto rename_succeeded; - } - - if (errno == EXDEV) - { - if (! backup) - { - if (unlink (to) == 0) - to_dir_known_to_exist = true; - else if (errno != ENOENT) - pfatal ("Can't remove file %s", quotearg (to)); - } - if (! to_dir_known_to_exist) - makedirs (to); - copy_file (from, to, 0, mode); - return; - } - - pfatal ("Can't rename file %s to %s", - quotearg_n (0, from), quotearg_n (1, to)); - } - - rename_succeeded: - /* Do not clear *FROM_NEEDS_REMOVAL if it's possible that the - rename returned zero because FROM and TO are hard links to - the same file. */ - if (0 < to_errno - || (to_errno == 0 && to_st.st_nlink <= 1)) - *from_needs_removal = 0; - } - else if (! backup) - { - if (debug & 4) - say ("Removing file %s\n", quotearg (to)); - if (unlink (to) != 0) - pfatal ("Can't remove file %s", quotearg (to)); - } -} - -/* Create FILE with OPEN_FLAGS, and with MODE adjusted so that - we can read and write the file and that the file is not executable. - Return the file descriptor. */ -int -create_file (char const *file, int open_flags, mode_t mode) -{ - int fd; - mode |= S_IRUSR | S_IWUSR; - mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); - if (! (O_CREAT && O_TRUNC)) - close (creat (file, mode)); - fd = open (file, O_CREAT | O_TRUNC | open_flags, mode); - if (fd < 0) - pfatal ("Can't create file %s", quotearg (file)); - return fd; -} - -/* Copy a file. */ - -void -copy_file (char const *from, char const *to, int to_flags, mode_t mode) -{ - int tofd; - int fromfd; - size_t i; - - if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) - pfatal ("Can't reopen file %s", quotearg (from)); - tofd = create_file (to, O_WRONLY | O_BINARY | to_flags, mode); - while ((i = read (fromfd, buf, bufsize)) != 0) - { - if (i == (size_t) -1) - read_fatal (); - if (write (tofd, buf, i) != i) - write_fatal (); - } - if (close (fromfd) != 0) - read_fatal (); - if (close (tofd) != 0) - write_fatal (); -} - -static char const DEV_NULL[] = NULL_DEVICE; - -static char const RCSSUFFIX[] = ",v"; -static char const CHECKOUT[] = "co %s"; -static char const CHECKOUT_LOCKED[] = "co -l %s"; -static char const RCSDIFF1[] = "rcsdiff %s"; - -static char const SCCSPREFIX[] = "s."; -static char const GET[] = "get "; -static char const GET_LOCKED[] = "get -e "; -static char const SCCSDIFF1[] = "get -p "; -static char const SCCSDIFF2[] = "|diff - %s"; - -static char const CLEARTOOL_CO[] = "cleartool co -unr -nc "; - -static char const PERFORCE_CO[] = "p4 edit "; - -/* Return "RCS" if FILENAME is controlled by RCS, - "SCCS" if it is controlled by SCCS, - "ClearCase" if it is controlled by Clearcase, - "Perforce" if it is controlled by Perforce, - and 0 otherwise. - READONLY is true if we desire only readonly access to FILENAME. - FILESTAT describes FILENAME's status or is 0 if FILENAME does not exist. - If successful and if GETBUF is nonzero, set *GETBUF to a command - that gets the file; similarly for DIFFBUF and a command to diff the file - (but set *DIFFBUF to 0 if the diff operation is meaningless). - *GETBUF and *DIFFBUF must be freed by the caller. */ -char const * -version_controller (char const *filename, bool readonly, - struct stat const *filestat, char **getbuf, char **diffbuf) -{ - struct stat cstat; - char const *filebase = base_name (filename); - char const *dotslash = *filename == '-' ? "./" : ""; - size_t dirlen = filebase - filename; - size_t filenamelen = strlen (filename); - size_t maxfixlen = sizeof "SCCS/" - 1 + sizeof SCCSPREFIX - 1; - size_t maxtrysize = filenamelen + maxfixlen + 1; - size_t quotelen = quote_system_arg (0, filename); - size_t maxgetsize = sizeof CLEARTOOL_CO + quotelen + maxfixlen; - size_t maxdiffsize = - (sizeof SCCSDIFF1 + sizeof SCCSDIFF2 + sizeof DEV_NULL - 1 - + 2 * quotelen + maxfixlen); - char *trybuf = xmalloc (maxtrysize); - char const *r = 0; - - strcpy (trybuf, filename); - -#define try1(f,a1) (sprintf (trybuf + dirlen, f, a1), stat (trybuf, &cstat) == 0) -#define try2(f,a1,a2) (sprintf (trybuf + dirlen, f, a1,a2), stat (trybuf, &cstat) == 0) - - /* Check that RCS file is not working file. - Some hosts don't report file name length errors. */ - - if ((try2 ("RCS/%s%s", filebase, RCSSUFFIX) - || try1 ("RCS/%s", filebase) - || try2 ("%s%s", filebase, RCSSUFFIX)) - && ! (filestat - && filestat->st_dev == cstat.st_dev - && filestat->st_ino == cstat.st_ino)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? CHECKOUT : CHECKOUT_LOCKED, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - sprintf (p, RCSDIFF1, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "RCS"; - } - else if (try2 ("SCCS/%s%s", SCCSPREFIX, filebase) - || try2 ("%s%s", SCCSPREFIX, filebase)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? GET : GET_LOCKED); - p += strlen (p); - p += quote_system_arg (p, trybuf); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - strcpy (p, SCCSDIFF1); - p += sizeof SCCSDIFF1 - 1; - p += quote_system_arg (p, trybuf); - sprintf (p, SCCSDIFF2, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "SCCS"; - } - else if (!readonly && filestat - && try1 ("%s@@", filebase) && S_ISDIR (cstat.st_mode)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - strcpy (p, CLEARTOOL_CO); - p += sizeof CLEARTOOL_CO - 1; - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - *diffbuf = 0; - - r = "ClearCase"; - } - else if (!readonly && filestat && - (getenv("P4PORT") || getenv("P4USER") || getenv("P4CONFIG"))) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - strcpy (p, PERFORCE_CO); - p += sizeof PERFORCE_CO - 1; - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - *diffbuf = 0; - - r = "Perforce"; - } - - free (trybuf); - return r; -} - -/* Get FILENAME from version control system CS. The file already exists if - EXISTS. Only readonly access is needed if READONLY. - Use the command GETBUF to actually get the named file. - Store the resulting file status into *FILESTAT. - Return true if successful. */ -bool -version_get (char const *filename, char const *cs, bool exists, bool readonly, - char const *getbuf, struct stat *filestat) -{ - if (patch_get < 0) - { - ask ("Get file %s from %s%s? [y] ", - quotearg (filename), cs, readonly ? "" : " with lock"); - if (*buf == 'n') - return 0; - } - - if (dry_run) - { - if (! exists) - fatal ("can't do dry run on nonexistent version-controlled file %s; invoke `%s' and try again", - quotearg (filename), getbuf); - } - else - { - if (verbosity == VERBOSE) - say ("Getting file %s from %s%s...\n", quotearg (filename), - cs, readonly ? "" : " with lock"); - if (systemic (getbuf) != 0) - fatal ("Can't get file %s from %s", quotearg (filename), cs); - if (stat (filename, filestat) != 0) - pfatal ("%s", quotearg (filename)); - } - - return 1; -} - -/* Allocate a unique area for a string. */ - -char * -savebuf (register char const *s, register size_t size) -{ - register char *rv; - - assert (s && size); - rv = malloc (size); - - if (! rv) - { - if (! using_plan_a) - memory_fatal (); - } - else - memcpy (rv, s, size); - - return rv; -} - -char * -savestr (char const *s) -{ - return savebuf (s, strlen (s) + 1); -} - -void -remove_prefix (char *p, size_t prefixlen) -{ - char const *s = p + prefixlen; - while ((*p++ = *s++)) - continue; -} - -char * -format_linenum (char numbuf[LINENUM_LENGTH_BOUND + 1], LINENUM n) -{ - char *p = numbuf + LINENUM_LENGTH_BOUND; - *p = '\0'; - - if (n < 0) - { - do - *--p = '0' - (int) (n % 10); - while ((n /= 10) != 0); - - *--p = '-'; - } - else - { - do - *--p = '0' + (int) (n % 10); - while ((n /= 10) != 0); - } - - return p; -} - -#if !HAVE_VPRINTF -#define vfprintf my_vfprintf -static int -vfprintf (FILE *stream, char const *format, va_list args) -{ -#if !HAVE_DOPRNT && HAVE__DOPRINTF -# define _doprnt _doprintf -#endif -#if HAVE_DOPRNT || HAVE__DOPRINTF - _doprnt (format, args, stream); - return ferror (stream) ? -1 : 0; -#else - int *a = (int *) args; - return fprintf (stream, format, - a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); -#endif -} -#endif /* !HAVE_VPRINTF */ - -/* Terminal output, pun intended. */ - -void -fatal (char const *format, ...) -{ - va_list args; - fprintf (stderr, "%s: **** ", program_name); - va_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - putc ('\n', stderr); - fflush (stderr); - fatal_exit (0); -} - -void -memory_fatal (void) -{ - fatal ("out of memory"); -} - -void -read_fatal (void) -{ - pfatal ("read error"); -} - -void -write_fatal (void) -{ - pfatal ("write error"); -} - -/* Say something from patch, something from the system, then silence . . . */ - -void -pfatal (char const *format, ...) -{ - int errnum = errno; - va_list args; - fprintf (stderr, "%s: **** ", program_name); - va_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - fflush (stderr); /* perror bypasses stdio on some hosts. */ - errno = errnum; - perror (" "); - fflush (stderr); - fatal_exit (0); -} - -/* Tell the user something. */ - -void -say (char const *format, ...) -{ - va_list args; - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); -} - -/* Get a response from the user, somehow or other. */ - -void -ask (char const *format, ...) -{ - static int ttyfd = -2; - int r; - va_list args; - - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); - - if (ttyfd == -2) - { - /* If standard output is not a tty, don't bother opening /dev/tty, - since it's unlikely that stdout will be seen by the tty user. - The isatty test also works around a bug in GNU Emacs 19.34 under Linux - which makes a call-process `patch' hang when it reads from /dev/tty. - POSIX.1-2001 XCU line 26599 requires that we read /dev/tty, - though. */ - ttyfd = (posixly_correct || isatty (STDOUT_FILENO) - ? open (TTY_DEVICE, O_RDONLY) - : -1); - } - - if (ttyfd < 0) - { - /* No terminal at all -- default it. */ - printf ("\n"); - buf[0] = '\n'; - buf[1] = '\0'; - } - else - { - size_t s = 0; - while ((r = read (ttyfd, buf + s, bufsize - 1 - s)) == bufsize - 1 - s - && buf[bufsize - 2] != '\n') - { - s = bufsize - 1; - bufsize *= 2; - buf = realloc (buf, bufsize); - if (!buf) - memory_fatal (); - } - if (r == 0) - printf ("EOF\n"); - else if (r < 0) - { - perror ("tty read"); - fflush (stderr); - close (ttyfd); - ttyfd = -1; - r = 0; - } - buf[s + r] = '\0'; - } -} - -/* Return nonzero if it OK to reverse a patch. */ - -bool -ok_to_reverse (char const *format, ...) -{ - bool r = false; - - if (noreverse || ! (force && verbosity == SILENT)) - { - va_list args; - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - } - - if (noreverse) - { - printf (" Skipping patch.\n"); - skip_rest_of_patch = true; - } - else if (force) - { - if (verbosity != SILENT) - printf (" Applying it anyway.\n"); - } - else if (batch) - { - say (reverse ? " Ignoring -R.\n" : " Assuming -R.\n"); - r = true; - } - else - { - ask (reverse ? " Ignore -R? [n] " : " Assume -R? [n] "); - r = *buf == 'y'; - if (! r) - { - ask ("Apply anyway? [n] "); - if (*buf != 'y') - { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - } - } - } - - return r; -} - -/* How to handle certain events when not in a critical region. */ - -#define NUM_SIGS (sizeof (sigs) / sizeof (*sigs)) -static int const sigs[] = { -#ifdef SIGHUP - SIGHUP, -#endif -#ifdef SIGPIPE - SIGPIPE, -#endif -#ifdef SIGTERM - SIGTERM, -#endif -#ifdef SIGXCPU - SIGXCPU, -#endif -#ifdef SIGXFSZ - SIGXFSZ, -#endif - SIGINT -}; - -#if !HAVE_SIGPROCMASK -#define sigset_t int -#define sigemptyset(s) (*(s) = 0) -#ifndef sigmask -#define sigmask(sig) (1 << ((sig) - 1)) -#endif -#define sigaddset(s, sig) (*(s) |= sigmask (sig)) -#define sigismember(s, sig) ((*(s) & sigmask (sig)) != 0) -#ifndef SIG_BLOCK -#define SIG_BLOCK 0 -#endif -#ifndef SIG_UNBLOCK -#define SIG_UNBLOCK (SIG_BLOCK + 1) -#endif -#ifndef SIG_SETMASK -#define SIG_SETMASK (SIG_BLOCK + 2) -#endif -#define sigprocmask(how, n, o) \ - ((how) == SIG_BLOCK \ - ? ((o) ? *(o) = sigblock (*(n)) : sigblock (*(n))) \ - : (how) == SIG_UNBLOCK \ - ? sigsetmask (((o) ? *(o) = sigblock (0) : sigblock (0)) & ~*(n)) \ - : (o ? *(o) = sigsetmask (*(n)) : sigsetmask (*(n)))) -#if !HAVE_SIGSETMASK -#define sigblock(mask) 0 -#define sigsetmask(mask) 0 -#endif -#endif - -static sigset_t initial_signal_mask; -static sigset_t signals_to_block; - -#if ! HAVE_SIGACTION -static RETSIGTYPE fatal_exit_handler (int) __attribute__ ((noreturn)); -static RETSIGTYPE -fatal_exit_handler (int sig) -{ - signal (sig, SIG_IGN); - fatal_exit (sig); -} -#endif - -void -set_signals (bool reset) -{ - int i; -#if HAVE_SIGACTION - struct sigaction initial_act, fatal_act; - fatal_act.sa_handler = fatal_exit; - sigemptyset (&fatal_act.sa_mask); - fatal_act.sa_flags = 0; -#define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) -#else -#define setup_handler(sig) signal (sig, fatal_exit_handler) -#endif - - if (!reset) - { -#ifdef SIGCHLD - /* System V fork+wait does not work if SIGCHLD is ignored. */ - signal (SIGCHLD, SIG_DFL); -#endif - sigemptyset (&signals_to_block); - for (i = 0; i < NUM_SIGS; i++) - { - bool ignoring_signal; -#if HAVE_SIGACTION - if (sigaction (sigs[i], (struct sigaction *) 0, &initial_act) != 0) - continue; - ignoring_signal = initial_act.sa_handler == SIG_IGN; -#else - ignoring_signal = signal (sigs[i], SIG_IGN) == SIG_IGN; -#endif - if (! ignoring_signal) - { - sigaddset (&signals_to_block, sigs[i]); - setup_handler (sigs[i]); - } - } - } - else - { - /* Undo the effect of ignore_signals. */ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_SETMASK, &initial_signal_mask, (sigset_t *) 0); -#else - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - setup_handler (sigs[i]); -#endif - } -} - -/* How to handle certain events when in a critical region. */ - -void -ignore_signals (void) -{ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); -#else - int i; - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - signal (sigs[i], SIG_IGN); -#endif -} - -void -exit_with_signal (int sig) -{ - sigset_t s; - signal (sig, SIG_DFL); - sigemptyset (&s); - sigaddset (&s, sig); - sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); - raise (sig); - exit (2); -} - -int -systemic (char const *command) -{ - if (debug & 8) - say ("+ %s\n", command); - fflush (stdout); - return system (command); -} - -/* Replace '/' with '\0' in FILENAME if it marks a place that - needs testing for the existence of directory. Return the address - of the last location replaced, or 0 if none were replaced. */ -static char * -replace_slashes (char *filename) -{ - char *f; - char *last_location_replaced = 0; - char const *component_start; - - for (f = filename + FILESYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) - continue; - - component_start = f; - - for (; *f; f++) - if (ISSLASH (*f)) - { - char *slash = f; - - /* Treat multiple slashes as if they were one slash. */ - while (ISSLASH (f[1])) - f++; - - /* Ignore slashes at the end of the path. */ - if (! f[1]) - break; - - /* "." and ".." need not be tested. */ - if (! (slash - component_start <= 2 - && component_start[0] == '.' && slash[-1] == '.')) - { - *slash = '\0'; - last_location_replaced = slash; - } - - component_start = f + 1; - } - - return last_location_replaced; -} - -/* Make sure we'll have the directories to create a file. - Ignore the last element of `filename'. */ - -static void -makedirs (register char *filename) -{ - register char *f; - register char *flim = replace_slashes (filename); - - if (flim) - { - /* Create any missing directories, replacing NULs by '/'s. - Ignore errors. We may have to keep going even after an EEXIST, - since the path may contain ".."s; and when there is an EEXIST - failure the system may return some other error number. - Any problems will eventually be reported when we create the file. */ - for (f = filename; f <= flim; f++) - if (!*f) - { - mkdir (filename, - S_IRUSR|S_IWUSR|S_IXUSR - |S_IRGRP|S_IWGRP|S_IXGRP - |S_IROTH|S_IWOTH|S_IXOTH); - *f = '/'; - } - } -} - -/* Remove empty ancestor directories of FILENAME. - Ignore errors, since the path may contain ".."s, and when there - is an EEXIST failure the system may return some other error number. */ -void -removedirs (char *filename) -{ - size_t i; - - for (i = strlen (filename); i != 0; i--) - if (ISSLASH (filename[i]) - && ! (ISSLASH (filename[i - 1]) - || (filename[i - 1] == '.' - && (i == 1 - || ISSLASH (filename[i - 2]) - || (filename[i - 2] == '.' - && (i == 2 - || ISSLASH (filename[i - 3]))))))) - { - filename[i] = '\0'; - if (rmdir (filename) == 0 && verbosity == VERBOSE) - say ("Removed empty directory %s\n", quotearg (filename)); - filename[i] = '/'; - } -} - -static time_t initial_time; - -void -init_time (void) -{ - time (&initial_time); -} - -/* Make filenames more reasonable. */ - -char * -fetchname (char *at, int strip_leading, time_t *pstamp) -{ - char *name; - register char *t; - int sleading = strip_leading; - time_t stamp = (time_t) -1; - - while (ISSPACE ((unsigned char) *at)) - at++; - if (debug & 128) - say ("fetchname %s %d\n", at, strip_leading); - - name = at; - /* Strip up to `strip_leading' leading slashes and null terminate. - If `strip_leading' is negative, strip all leading slashes. */ - for (t = at; *t; t++) - { - if (ISSLASH (*t)) - { - while (ISSLASH (t[1])) - t++; - if (strip_leading < 0 || --sleading >= 0) - name = t+1; - } - else if (ISSPACE ((unsigned char) *t)) - { - /* Allow file names with internal spaces, - but only if a tab separates the file name from the date. */ - char const *u = t; - while (*u != '\t' && ISSPACE ((unsigned char) u[1])) - u++; - if (*u != '\t' && strchr (u + 1, '\t')) - continue; - - if (set_time | set_utc) - stamp = str2time (&u, initial_time, - set_utc ? 0L : TM_LOCAL_ZONE); - else - { - /* The head says the file is nonexistent if the timestamp - is the epoch; but the listed time is local time, not UTC, - and POSIX.1 allows local time offset anywhere in the range - -25:00 < offset < +26:00. Match any time in that - range by assuming local time is -25:00 and then matching - any ``local'' time T in the range 0 < T < 25+26 hours. */ - stamp = str2time (&u, initial_time, -25L * 60 * 60); - if (0 < stamp && stamp < (25 + 26) * 60L * 60) - stamp = 0; - } - - if (*u && ! ISSPACE ((unsigned char) *u)) - stamp = (time_t) -1; - - *t = '\0'; - break; - } - } - - if (!*name) - return 0; - - /* If the name is "/dev/null", ignore the name and mark the file - as being nonexistent. The name "/dev/null" appears in patches - regardless of how NULL_DEVICE is spelled. */ - if (strcmp (at, "/dev/null") == 0) - { - if (pstamp) - *pstamp = 0; - return 0; - } - - /* Ignore the name if it doesn't have enough slashes to strip off. */ - if (0 < sleading) - return 0; - - if (pstamp) - *pstamp = stamp; - - return savestr (name); -} - -void -Fseek (FILE *stream, file_offset offset, int ptrname) -{ - if (file_seek (stream, offset, ptrname) != 0) - pfatal ("fseek"); -} Property changes on: vendor/misc-GNU/patch/2.5.9/util.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/argmatch.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/argmatch.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/argmatch.h (nonexistent) @@ -1,109 +0,0 @@ -/* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie - Modified by Akim Demaille */ - -#ifndef ARGMATCH_H_ -# define ARGMATCH_H_ 1 - -# include - -# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) - -# define ARGMATCH_CONSTRAINT(Arglist, Vallist) \ - (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) - -/* Assert there are as many real arguments as there are values - (argument list ends with a NULL guard). ARGMATCH_VERIFY is - preferred, since it is guaranteed to be checked at compile-time. - ARGMATCH_ASSERT is for backward compatibility only. */ - -# define ARGMATCH_VERIFY(Arglist, Vallist) \ - struct argmatch_verify \ - { \ - char argmatch_verify[ARGMATCH_CONSTRAINT(Arglist, Vallist) ? 1 : -1]; \ - } - -# define ARGMATCH_ASSERT(Arglist, Vallist) \ - assert (ARGMATCH_CONSTRAINT (Arglist, Vallist)) - -/* Return the index of the element of ARGLIST (NULL terminated) that - matches with ARG. If VALLIST is not NULL, then use it to resolve - false ambiguities (i.e., different matches of ARG but corresponding - to the same values in VALLIST). */ - -int argmatch (char const *arg, char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH(Arg, Arglist, Vallist) \ - argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) - -/* xargmatch calls this function when it fails. This function should not - return. By default, this is a function that calls ARGMATCH_DIE which - in turn defaults to `exit (EXIT_FAILURE)'. */ -typedef void (*argmatch_exit_fn) (void); -extern argmatch_exit_fn argmatch_die; - -/* Report on stderr why argmatch failed. Report correct values. */ - -void argmatch_invalid (char const *context, char const *value, int problem); - -/* Left for compatibility with the old name invalid_arg */ - -# define invalid_arg(Context, Value, Problem) \ - argmatch_invalid (Context, Value, Problem) - - - -/* Report on stderr the list of possible arguments. */ - -void argmatch_valid (char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH_VALID(Arglist, Vallist) \ - argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist)) - - - -/* Same as argmatch, but upon failure, reports a explanation on the - failure, and exits using the function EXIT_FN. */ - -int __xargmatch_internal (char const *context, - char const *arg, char const *const *arglist, - char const *vallist, size_t valsize, - argmatch_exit_fn exit_fn); - -/* Programmer friendly interface to __xargmatch_internal. */ - -# define XARGMATCH(Context, Arg, Arglist, Vallist) \ - ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ - (char const *) (Vallist), \ - sizeof *(Vallist), \ - argmatch_die)]) - -/* Convert a value into a corresponding argument. */ - -char const *argmatch_to_argument (char const *value, - char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ - argmatch_to_argument (Value, Arglist, \ - (char const *) (Vallist), sizeof *(Vallist)) - -#endif /* ARGMATCH_H_ */ Property changes on: vendor/misc-GNU/patch/2.5.9/argmatch.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/backupfile.c =================================================================== --- vendor/misc-GNU/patch/2.5.9/backupfile.c (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/backupfile.c (nonexistent) @@ -1,277 +0,0 @@ -/* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990,91,92,93,94,95,96,97,98,99,2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . - Some algorithms adapted from GNU Emacs. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_DIRENT_H -# include -# define NLENGTH(direct) strlen ((direct)->d_name) -#else -# define dirent direct -# define NLENGTH(direct) ((size_t) (direct)->d_namlen) -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - -#if CLOSEDIR_VOID -/* Fake a return value. */ -# define CLOSEDIR(d) (closedir (d), 0) -#else -# define CLOSEDIR(d) closedir (d) -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#ifndef HAVE_DECL_GETENV -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_GETENV -char *getenv (); -#endif - -#ifndef HAVE_DECL_MALLOC -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_MALLOC -char *malloc (); -#endif - -#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H -# define HAVE_DIR 1 -#else -# define HAVE_DIR 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif -/* Upper bound on the string length of an integer converted to string. - 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; - add 1 for integer division truncation; add 1 more for a minus sign. */ -#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2) - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - - It's typically faster. - POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to - ISDIGIT_LOCALE unless it's important to use the locale's definition - of `digit' even when the host does not conform to POSIX. */ -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#if D_INO_IN_DIRENT -# define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) -#else -# define REAL_DIR_ENTRY(dp) 1 -#endif - -#include "argmatch.h" -#include "backupfile.h" -#include "dirname.h" - -/* The extension added to file names to produce a simple (as opposed - to numbered) backup file name. */ -const char *simple_backup_suffix = "~"; - -static int max_backup_version PARAMS ((const char *, const char *)); -static int version_number PARAMS ((const char *, const char *, size_t)); - -/* Return the name of the new backup file for file FILE, - allocated with malloc. Return 0 if out of memory. - FILE must not end with a '/' unless it is the root directory. - Do not call this function if backup_type == none. */ - -char * -find_backup_file_name (const char *file, enum backup_type backup_type) -{ - size_t backup_suffix_size_max; - size_t file_len = strlen (file); - size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4; - char *s; - const char *suffix = simple_backup_suffix; - - /* Allow room for simple or `.~N~' backups. */ - backup_suffix_size_max = strlen (simple_backup_suffix) + 1; - if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max) - backup_suffix_size_max = numbered_suffix_size_max; - - s = malloc (file_len + 1 - + backup_suffix_size_max + numbered_suffix_size_max); - if (s) - { -#if HAVE_DIR - if (backup_type != simple) - { - int highest_backup; - size_t dirlen = dir_len (file); - - memcpy (s, file, dirlen); - if (dirlen == FILESYSTEM_PREFIX_LEN (file)) - s[dirlen++] = '.'; - s[dirlen] = '\0'; - highest_backup = max_backup_version (base_name (file), s); - if (! (backup_type == numbered_existing && highest_backup == 0)) - { - char *numbered_suffix = s + (file_len + backup_suffix_size_max); - sprintf (numbered_suffix, ".~%d~", highest_backup + 1); - suffix = numbered_suffix; - } - } -#endif /* HAVE_DIR */ - - strcpy (s, file); - addext (s, suffix, '~'); - } - return s; -} - -#if HAVE_DIR - -/* Return the number of the highest-numbered backup file for file - FILE in directory DIR. If there are no numbered backups - of FILE in DIR, or an error occurs reading DIR, return 0. - */ - -static int -max_backup_version (const char *file, const char *dir) -{ - DIR *dirp; - struct dirent *dp; - int highest_version; - int this_version; - size_t file_name_length; - - dirp = opendir (dir); - if (!dirp) - return 0; - - highest_version = 0; - file_name_length = base_len (file); - - while ((dp = readdir (dirp)) != 0) - { - if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) < file_name_length + 4) - continue; - - this_version = version_number (file, dp->d_name, file_name_length); - if (this_version > highest_version) - highest_version = this_version; - } - if (CLOSEDIR (dirp)) - return 0; - return highest_version; -} - -/* If BACKUP is a numbered backup of BASE, return its version number; - otherwise return 0. BASE_LENGTH is the length of BASE. - */ - -static int -version_number (const char *base, const char *backup, size_t base_length) -{ - int version; - const char *p; - - version = 0; - if (strncmp (base, backup, base_length) == 0 - && backup[base_length] == '.' - && backup[base_length + 1] == '~') - { - for (p = &backup[base_length + 2]; ISDIGIT (*p); ++p) - version = version * 10 + *p - '0'; - if (p[0] != '~' || p[1]) - version = 0; - } - return version; -} -#endif /* HAVE_DIR */ - -static const char * const backup_args[] = -{ - /* In a series of synonyms, present the most meaning full first, so - that argmatch_valid be more readable. */ - "none", "off", - "simple", "never", - "existing", "nil", - "numbered", "t", - 0 -}; - -static const enum backup_type backup_types[] = -{ - none, none, - simple, simple, - numbered_existing, numbered_existing, - numbered, numbered -}; - -/* Return the type of backup specified by VERSION. - If VERSION is NULL or the empty string, return numbered_existing. - If VERSION is invalid or ambiguous, fail with a diagnostic appropriate - for the specified CONTEXT. Unambiguous abbreviations are accepted. */ - -enum backup_type -get_version (const char *context, const char *version) -{ - if (version == 0 || *version == 0) - return numbered_existing; - else - return XARGMATCH (context, version, backup_args, backup_types); -} - - -/* Return the type of backup specified by VERSION. - If VERSION is NULL, use the value of the envvar VERSION_CONTROL. - If the specified string is invalid or ambiguous, fail with a diagnostic - appropriate for the specified CONTEXT. - Unambiguous abbreviations are accepted. */ - -enum backup_type -xget_version (const char *context, const char *version) -{ - if (version && *version) - return get_version (context, version); - else - return get_version ("$VERSION_CONTROL", getenv ("VERSION_CONTROL")); -} Property changes on: vendor/misc-GNU/patch/2.5.9/backupfile.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/backupfile.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/backupfile.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/backupfile.h (nonexistent) @@ -1,60 +0,0 @@ -/* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990-1992, 1997-1999 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef BACKUPFILE_H_ -# define BACKUPFILE_H_ - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -# define VALID_BACKUP_TYPE(Type) \ - ((Type) == none \ - || (Type) == simple \ - || (Type) == numbered_existing \ - || (Type) == numbered) - -extern char const *simple_backup_suffix; - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -char *find_backup_file_name PARAMS ((char const *, enum backup_type)); -enum backup_type get_version PARAMS ((char const *context, char const *arg)); -enum backup_type xget_version PARAMS ((char const *context, char const *arg)); -void addext PARAMS ((char *, char const *, int)); - -#endif /* ! BACKUPFILE_H_ */ Property changes on: vendor/misc-GNU/patch/2.5.9/backupfile.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/2.5.9/AUTHORS =================================================================== --- vendor/misc-GNU/patch/2.5.9/AUTHORS (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/AUTHORS (nonexistent) @@ -1,9 +0,0 @@ -Larry Wall wrote the original version of `patch'. - -Paul Eggert removed arbitrary limits; added support for binary -files, setting file times, and deleting files; and made it conform -better to POSIX. - -Wayne Davison added unidiff support. - -David MacKenzie added configuration and backup support. Index: vendor/misc-GNU/patch/2.5.9/util.h =================================================================== --- vendor/misc-GNU/patch/2.5.9/util.h (revision 358868) +++ vendor/misc-GNU/patch/2.5.9/util.h (nonexistent) @@ -1,59 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.h,v 1.20 2003/05/20 13:56:48 eggert Exp $ */ - -/* Copyright (C) 1986 Larry Wall - - Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* An upper bound on the print length of a signed decimal line number. - Add one for the sign. */ -#define LINENUM_LENGTH_BOUND (sizeof (LINENUM) * CHAR_BIT / 3 + 1) - -XTERN enum backup_type backup_type; - -bool ok_to_reverse (char const *, ...) __attribute__ ((format (printf, 1, 2))); -void ask (char const *, ...) __attribute__ ((format (printf, 1, 2))); -void say (char const *, ...) __attribute__ ((format (printf, 1, 2))); - -void fatal (char const *, ...) - __attribute__ ((noreturn, format (printf, 1, 2))); -void pfatal (char const *, ...) - __attribute__ ((noreturn, format (printf, 1, 2))); - -char *fetchname (char *, int, time_t *); -char *savebuf (char const *, size_t); -char *savestr (char const *); -char const *version_controller (char const *, bool, struct stat const *, char **, char **); -bool version_get (char const *, char const *, bool, bool, char const *, struct stat *); -int create_file (char const *, int, mode_t); -int systemic (char const *); -char *format_linenum (char[LINENUM_LENGTH_BOUND + 1], LINENUM); -void Fseek (FILE *, file_offset, int); -void copy_file (char const *, char const *, int, mode_t); -void exit_with_signal (int) __attribute__ ((noreturn)); -void ignore_signals (void); -void init_time (void); -void memory_fatal (void) __attribute__ ((noreturn)); -void move_file (char const *, int volatile *, char *, mode_t, bool); -void read_fatal (void) __attribute__ ((noreturn)); -void remove_prefix (char *, size_t); -void removedirs (char *); -void set_signals (bool); -void write_fatal (void) __attribute__ ((noreturn)); Property changes on: vendor/misc-GNU/patch/2.5.9/util.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/m4/realloc.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/realloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/realloc.m4 (nonexistent) @@ -1,25 +0,0 @@ -# realloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether realloc works when both arguments are 0. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_REALLOC], -[ - AC_REQUIRE([AC_FUNC_REALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - gl_PREREQ_REALLOC - fi -]) - -# Prerequisites of lib/realloc.c. -AC_DEFUN([gl_PREREQ_REALLOC], [ - : -]) Index: vendor/misc-GNU/patch/dist/m4/mbstate_t.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/mbstate_t.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/mbstate_t.m4 (nonexistent) @@ -1,32 +0,0 @@ -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# From Paul Eggert. - -# BeOS 5 has but does not define mbstate_t, -# so you can't declare an object of that type. -# Check for this incompatibility with Standard C. - -# AC_TYPE_MBSTATE_T -# ----------------- -AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include ], - [mbstate_t x; return sizeof x;])], - [ac_cv_type_mbstate_t=yes], - [ac_cv_type_mbstate_t=no])]) - if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T], 1, - [Define to 1 if declares mbstate_t.]) - else - AC_DEFINE([mbstate_t], int, - [Define to a type if does not define.]) - fi]) Index: vendor/misc-GNU/patch/dist/m4/quote.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/quote.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/quote.m4 (nonexistent) @@ -1,13 +0,0 @@ -# quote.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTE], -[ - dnl Prerequisites of lib/quote.c. - AC_CHECK_HEADERS_ONCE(stddef.h) -]) Index: vendor/misc-GNU/patch/dist/m4/unlocked-io.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/unlocked-io.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/unlocked-io.m4 (nonexistent) @@ -1,22 +0,0 @@ -#serial 7 -*- autoconf -*- - -dnl From Jim Meyering. -dnl -dnl See if the glibc *_unlocked I/O macros or functions are available. -dnl Use only those *_unlocked macros or functions that are declared -dnl (because some of them were declared in Solaris 2.5.1 but were removed -dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run -dnl on Solaris 2.6). - -AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], -[ - dnl Persuade glibc to declare fgets_unlocked(), fputs_unlocked() - dnl etc. - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS_ONCE( - [clearerr_unlocked feof_unlocked ferror_unlocked - fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked - fread_unlocked fwrite_unlocked getc_unlocked - getchar_unlocked putc_unlocked putchar_unlocked]) -]) Index: vendor/misc-GNU/patch/dist/m4/error.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/error.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/error.m4 (nonexistent) @@ -1,18 +0,0 @@ -#serial 7 - -AC_DEFUN([gl_ERROR], -[ - AC_FUNC_ERROR_AT_LINE - dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). - jm_PREREQ_ERROR -]) - -# Prerequisites of lib/error.c. -AC_DEFUN([jm_PREREQ_ERROR], -[ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_VPRINTF]) - AC_CHECK_FUNCS(strerror) - AC_CHECK_DECLS([strerror]) - AC_FUNC_STRERROR_R -]) Index: vendor/misc-GNU/patch/dist/m4/mbrtowc.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/mbrtowc.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/mbrtowc.m4 (nonexistent) @@ -1,27 +0,0 @@ -# mbrtowc.m4 serial 5 -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert - -dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with -dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. - -AC_DEFUN([jm_FUNC_MBRTOWC], -[ - AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], - jm_cv_func_mbrtowc, - [AC_TRY_LINK( - [#include ], - [mbstate_t state; return ! (sizeof state && mbrtowc);], - jm_cv_func_mbrtowc=yes, - jm_cv_func_mbrtowc=no)]) - if test $jm_cv_func_mbrtowc = yes; then - AC_DEFINE(HAVE_MBRTOWC, 1, - [Define to 1 if mbrtowc and mbstate_t are properly declared.]) - fi -]) Index: vendor/misc-GNU/patch/dist/m4/mkdir.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/mkdir.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/mkdir.m4 (nonexistent) @@ -1,34 +0,0 @@ -#serial 1 - -dnl From Mumit Khan and Paul Eggert -dnl Determine whether mkdir accepts only one argument instead of the usual two. - -AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG], - [AC_CHECK_FUNCS(mkdir) - AC_CACHE_CHECK([whether mkdir takes only one argument], - patch_cv_mkdir_takes_one_arg, - [patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".", 0);], - , - [AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".");], - patch_cv_mkdir_takes_one_arg=yes - )] - ) - fi - ] - ) - if test $patch_cv_mkdir_takes_one_arg = yes; then - AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, - [Define if mkdir takes only one argument.]) - fi - ] -) Index: vendor/misc-GNU/patch/dist/m4/xalloc.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/xalloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/xalloc.m4 (nonexistent) @@ -1,26 +0,0 @@ -# xalloc.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_XALLOC], -[ - gl_PREREQ_XMALLOC - gl_PREREQ_XSTRDUP -]) - -# Prerequisites of lib/xmalloc.c. -AC_DEFUN([gl_PREREQ_XMALLOC], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([jm_FUNC_MALLOC]) - AC_REQUIRE([jm_FUNC_REALLOC]) -]) - -# Prerequisites of lib/xstrdup.c. -AC_DEFUN([gl_PREREQ_XSTRDUP], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/dist/m4/stdbool.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/stdbool.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/stdbool.m4 (nonexistent) @@ -1,89 +0,0 @@ -# Check for stdbool.h that conforms to C99. - -# Copyright (C) 2002-2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Prepare for substituting if it is not supported. - -AC_DEFUN([AM_STDBOOL_H], -[ - AC_REQUIRE([AC_HEADER_STDBOOL]) - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - AC_SUBST([STDBOOL_H]) - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - AC_SUBST([HAVE__BOOL]) -]) - -# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf -# have this macro built-in. - -AC_DEFUN([AC_HEADER_STDBOOL], - [AC_CACHE_CHECK([for stdbool.h that conforms to C99], - [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - ], - [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], - [ac_cv_header_stdbool_h=yes], - [ac_cv_header_stdbool_h=no])]) - AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) - fi]) Index: vendor/misc-GNU/patch/dist/m4/rmdir.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/rmdir.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/rmdir.m4 (nonexistent) @@ -1,22 +0,0 @@ -# rmdir.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_RMDIR], -[ - AC_REPLACE_FUNCS(rmdir) - if test $ac_cv_func_rmdir = no; then - gl_PREREQ_RMDIR - fi -]) - -# Prerequisites of lib/rmdir.c. -AC_DEFUN([gl_PREREQ_RMDIR], [ - AC_REQUIRE([AC_HEADER_STAT]) - : -]) - Index: vendor/misc-GNU/patch/dist/m4/setmode.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/setmode.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/setmode.m4 (nonexistent) @@ -1,38 +0,0 @@ -# Check for setmode, DOS style. - -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AC_FUNC_SETMODE_DOS], - [AC_CHECK_HEADERS(fcntl.h unistd.h) - AC_CACHE_CHECK([for DOS-style setmode], - [ac_cv_func_setmode_dos], - [AC_TRY_LINK( - [#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif], - [int ret = setmode && setmode (1, O_BINARY);], - [ac_cv_func_setmode_dos=yes], - [ac_cv_func_setmode_dos=no])]) - if test $ac_cv_func_setmode_dos = yes; then - AC_DEFINE(HAVE_SETMODE_DOS, 1, - [Define to 1 if you have the DOS-style `setmode' function.]) - fi]) Index: vendor/misc-GNU/patch/dist/m4/dirname.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/dirname.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/dirname.m4 (nonexistent) @@ -1,25 +0,0 @@ -# dirname.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_DIRNAME], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([jm_AC_DOS]) - - dnl Prerequisites of lib/dirname.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/basename.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/stripslash.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/dist/m4/backupfile.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/backupfile.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/backupfile.m4 (nonexistent) @@ -1,23 +0,0 @@ -# backupfile.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_BACKUPFILE], -[ - dnl Prerequisites of lib/backupfile.c. - AC_REQUIRE([AC_HEADER_DIRENT]) - AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h) - AC_CHECK_DECLS_ONCE(getenv malloc) - jm_CHECK_TYPE_STRUCT_DIRENT_D_INO - - dnl Prerequisites of lib/addext.c. - AC_REQUIRE([jm_AC_DOS]) - AC_SYS_LONG_FILE_NAMES - AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h) - AC_CHECK_FUNCS(pathconf) -]) Index: vendor/misc-GNU/patch/dist/m4/onceonly.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/onceonly.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/onceonly.m4 (nonexistent) @@ -1,63 +0,0 @@ -# onceonly.m4 serial 3 -dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl This file defines some "once only" variants of standard autoconf macros. -dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS -dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS -dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS -dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC -dnl The advantage is that the check for each of the headers/functions/decls -dnl will be put only once into the 'configure' file. It keeps the size of -dnl the 'configure' file down, and avoids redundant output when 'configure' -dnl is run. -dnl The drawback is that the checks cannot be conditionalized. If you write -dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi -dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to -dnl empty, and the check will be inserted before the body of the AC_DEFUNed -dnl function. - -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) - -# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of -# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). -AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ - : - AC_FOREACH([gl_HEADER_NAME], [$1], [ - AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), - [-./], [___])), [ - AC_CHECK_HEADERS(gl_HEADER_NAME) - ]) - AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, - [-./], [___]))) - ]) -]) - -# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of -# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). -AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ - : - AC_FOREACH([gl_FUNC_NAME], [$1], [ - AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ - AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) - ]) - AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) - ]) -]) - -# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of -# AC_CHECK_DECLS(DECL1, DECL2, ...). -AC_DEFUN([AC_CHECK_DECLS_ONCE], [ - : - AC_FOREACH([gl_DECL_NAME], [$1], [ - AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ - AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) - ]) - AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) - ]) -]) Index: vendor/misc-GNU/patch/dist/m4/quotearg.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/quotearg.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/quotearg.m4 (nonexistent) @@ -1,16 +0,0 @@ -# quotearg.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTEARG], -[ - dnl Prerequisites of lib/quotearg.c. - AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) - AC_CHECK_FUNCS_ONCE(iswprint mbsinit) - AC_TYPE_MBSTATE_T - jm_FUNC_MBRTOWC -]) Index: vendor/misc-GNU/patch/dist/m4/memchr.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/memchr.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/memchr.m4 (nonexistent) @@ -1,21 +0,0 @@ -# memchr.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_MEMCHR], -[ - AC_REPLACE_FUNCS(memchr) - if test $ac_cv_func_memchr = no; then - jm_PREREQ_MEMCHR - fi -]) - -# Prerequisites of lib/memchr.c. -AC_DEFUN([jm_PREREQ_MEMCHR], [ - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) - AC_CHECK_HEADERS(bp-sym.h) -]) Index: vendor/misc-GNU/patch/dist/m4/getopt.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/getopt.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/getopt.m4 (nonexistent) @@ -1,13 +0,0 @@ -# getopt.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_GETOPT], -[ - dnl Prerequisites of lib/getopt.c. - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/dist/m4/malloc.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/malloc.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/malloc.m4 (nonexistent) @@ -1,25 +0,0 @@ -# malloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether malloc accepts 0 as its argument. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_MALLOC], -[ - AC_REQUIRE([AC_FUNC_MALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - gl_PREREQ_MALLOC - fi -]) - -# Prerequisites of lib/malloc.c. -AC_DEFUN([gl_PREREQ_MALLOC], [ - : -]) Index: vendor/misc-GNU/patch/dist/m4/d-ino.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/d-ino.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/d-ino.m4 (nonexistent) @@ -1,42 +0,0 @@ -#serial 5 - -dnl From Jim Meyering. -dnl -dnl Check whether struct dirent has a member named d_ino. -dnl - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO], - [AC_REQUIRE([AC_HEADER_DIRENT])dnl - AC_CACHE_CHECK([for d_ino member in directory struct], - jm_cv_struct_dirent_d_ino, - [AC_TRY_LINK(dnl - [ -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - ], - [struct dirent dp; dp.d_ino = 0;], - - jm_cv_struct_dirent_d_ino=yes, - jm_cv_struct_dirent_d_ino=no) - ] - ) - if test $jm_cv_struct_dirent_d_ino = yes; then - AC_DEFINE(D_INO_IN_DIRENT, 1, - [Define if there is a member named d_ino in the struct describing - directory headers.]) - fi - ] -) Index: vendor/misc-GNU/patch/dist/m4/dos.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/dos.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/dos.m4 (nonexistent) @@ -1,53 +0,0 @@ -#serial 5 - -# Define some macros required for proper operation of code in lib/*.c -# on MSDOS/Windows systems. - -# From Jim Meyering. - -AC_DEFUN([jm_AC_DOS], - [ - AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], - [ - AC_TRY_COMPILE([], - [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif], - [ac_cv_win_or_dos=yes], - [ac_cv_win_or_dos=no]) - ]) - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - AH_VERBATIM(FILESYSTEM_PREFIX_LEN, - [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], - $ac_fs_accepts_drive_letter_prefix, - [Define on systems for which file names may have a so-called - `drive letter' prefix, define this to compute the length of that - prefix, including the colon.]) - - AH_VERBATIM(ISSLASH, - [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], - $ac_fs_backslash_is_file_name_separator, - [Define if the backslash character may also serve as a file name - component separator.]) - ]) Index: vendor/misc-GNU/patch/dist/m4/utimbuf.m4 =================================================================== --- vendor/misc-GNU/patch/dist/m4/utimbuf.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/m4/utimbuf.m4 (nonexistent) @@ -1,40 +0,0 @@ -#serial 5 - -dnl From Jim Meyering - -dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- -dnl usually in . -dnl Some systems have utime.h but don't declare the struct anywhere. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], -[ - AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) - AC_REQUIRE([AC_HEADER_TIME]) - AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf, - [AC_TRY_COMPILE( - [ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - ], - [static struct utimbuf x; x.actime = x.modtime;], - fu_cv_sys_struct_utimbuf=yes, - fu_cv_sys_struct_utimbuf=no) - ]) - - if test $fu_cv_sys_struct_utimbuf = yes; then - AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, - [Define if struct utimbuf is declared -- usually in . - Some systems have utime.h but don't declare the struct anywhere. ]) - fi -]) Index: vendor/misc-GNU/patch/dist/configure =================================================================== --- vendor/misc-GNU/patch/dist/configure (revision 358868) +++ vendor/misc-GNU/patch/dist/configure (nonexistent) @@ -1,11893 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for patch 2.5.9. -# -# Report bugs to . -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='patch' -PACKAGE_TARNAME='patch' -PACKAGE_VERSION='2.5.9' -PACKAGE_STRING='patch 2.5.9' -PACKAGE_BUGREPORT='bug-patch@gnu.org' - -ac_unique_file="patch.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE ed_PROGRAM EGREP STDBOOL_H HAVE__BOOL LIBOBJS LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures patch 2.5.9 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of patch 2.5.9:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-largefile omit support for large files - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -patch configure 2.5.9 -generated by GNU Autoconf 2.57 - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by patch $as_me 2.5.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ac_config_headers="$ac_config_headers config.h:config.hin" - -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -# Extract the first word of "ed", so it can be a program name with args. -set dummy ed; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ed_PROGRAM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ed_PROGRAM in - [\\/]* | ?:[\\/]*) - ac_cv_path_ed_PROGRAM="$ed_PROGRAM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ed_PROGRAM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_ed_PROGRAM" && ac_cv_path_ed_PROGRAM="ed" - ;; -esac -fi -ed_PROGRAM=$ac_cv_path_ed_PROGRAM - -if test -n "$ed_PROGRAM"; then - echo "$as_me:$LINENO: result: $ed_PROGRAM" >&5 -echo "${ECHO_T}$ed_PROGRAM" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - - -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - - -echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -rm -f conftest* - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 - -fi -if test $ac_cv_header_minix_config_h = yes; then - MINIX=yes -else - MINIX= -fi - - -if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - -fi - - -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" - -fi - -# Check whether --enable-largefile or --disable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" - -fi; -if test "$enable_largefile" != no; then - - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_file_offset_bits=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF - -fi -rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_large_files=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF - -fi -rm -f conftest* -fi - - - -echo "$as_me:$LINENO: checking for function prototypes" >&5 -echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 -if test "$ac_cv_prog_cc_stdc" != no; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -cat >>confdefs.h <<\_ACEOF -#define PROTOTYPES 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define __PROTOTYPES 1 -_ACEOF - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -fi - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - - - - - -for ac_header in fcntl.h limits.h string.h unistd.h utime.h varargs.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 -if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((mode_t *) 0) - return 0; -if (sizeof (mode_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_mode_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_mode_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6 -if test $ac_cv_type_mode_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_pid_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_signal=void -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_signal=int -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_size_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 -if test "${ac_cv_header_stdbool_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - -int -main () -{ - return !a + !b + !c + !d + !e + !f + !g + !h + !i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdbool_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdbool_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 - echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((_Bool *) 0) - return 0; -if (sizeof (_Bool)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type__Bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type__Bool=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6 -if test $ac_cv_type__Bool = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - - if test $ac_cv_header_stdbool_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STDBOOL_H 1 -_ACEOF - - fi - - - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - - - - -for ac_header in sys/time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in utime.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_time=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - - - - : - - - - - - - - - - echo "$as_me:$LINENO: checking for struct utimbuf" >&5 -echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6 -if test "${fu_cv_sys_struct_utimbuf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - -int -main () -{ -static struct utimbuf x; x.actime = x.modtime; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - fu_cv_sys_struct_utimbuf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fu_cv_sys_struct_utimbuf=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $fu_cv_sys_struct_utimbuf" >&5 -echo "${ECHO_T}$fu_cv_sys_struct_utimbuf" >&6 - - if test $fu_cv_sys_struct_utimbuf = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_UTIMBUF 1 -_ACEOF - - fi - - -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -exit (closedir (opendir (".")) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - - - -for ac_header in limits.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in string.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getenv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getenv - char *p = (char *) getenv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getenv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getenv=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 -if test $ac_cv_have_decl_getenv = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef malloc - char *p = (char *) malloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_malloc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_malloc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 -if test $ac_cv_have_decl_malloc = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 -echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 -if test "${ac_cv_win_or_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_win_or_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_win_or_dos=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 -echo "${ECHO_T}$ac_cv_win_or_dos" >&6 - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix -_ACEOF - - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator -_ACEOF - - - - -for ac_header in unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - : - - - - - - - - - - - - - : - - - - - - - - - echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 -echo $ECHO_N "checking for d_ino member in directory struct... $ECHO_C" >&6 -if test "${jm_cv_struct_dirent_d_ino+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - -int -main () -{ -struct dirent dp; dp.d_ino = 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_struct_dirent_d_ino=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -jm_cv_struct_dirent_d_ino=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - - -fi -echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_ino" >&5 -echo "${ECHO_T}$jm_cv_struct_dirent_d_ino" >&6 - if test $jm_cv_struct_dirent_d_ino = yes; then - -cat >>confdefs.h <<\_ACEOF -#define D_INO_IN_DIRENT 1 -_ACEOF - - fi - - - - - echo "$as_me:$LINENO: checking for long file names" >&5 -echo $ECHO_N "checking for long file names... $ECHO_C" >&6 -if test "${ac_cv_sys_long_file_names+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_long_file_names=yes -# Test for long file names in all the places we know might matter: -# . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: -# /tmp where it might want to write temporary files -# /var/tmp likewise -# /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs=$TMPDIR -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do - test -d $ac_dir || continue - test -w $ac_dir || continue # It is less confusing to not echo anything here. - ac_xdir=$ac_dir/cf$$ - (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue - ac_tf1=$ac_xdir/conftest9012345 - ac_tf2=$ac_xdir/conftest9012346 - (echo 1 >$ac_tf1) 2>/dev/null - (echo 2 >$ac_tf2) 2>/dev/null - ac_val=`cat $ac_tf1 2>/dev/null` - if test ! -f $ac_tf1 || test "$ac_val" != 1; then - ac_cv_sys_long_file_names=no - rm -rf $ac_xdir 2>/dev/null - break - fi - rm -rf $ac_xdir 2>/dev/null -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 -echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 -if test $ac_cv_sys_long_file_names = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_FILE_NAMES 1 -_ACEOF - -fi - - - : - - - - - - - - - - - - -for ac_func in pathconf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - - : - - - - - - - - - : - - - - - - - - - : - - - - - - - -for ac_func in vprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -echo "$as_me:$LINENO: checking for _doprnt" >&5 -echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 -if test "${ac_cv_func__doprnt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -char (*f) () = _doprnt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != _doprnt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__doprnt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func__doprnt=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 -echo "${ECHO_T}$ac_cv_func__doprnt" >&6 -if test $ac_cv_func__doprnt = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOPRNT 1 -_ACEOF - -fi - -fi -done - - - - echo "$as_me:$LINENO: checking for error_at_line" >&5 -echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6 -if test "${ac_cv_lib_error_at_line+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -error_at_line (0, 0, "", 0, ""); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_error_at_line=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_error_at_line=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 -echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6 -if test $ac_cv_lib_error_at_line = no; then - LIBOBJS="$LIBOBJS error.$ac_objext" -fi - - - - - -for ac_func in strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking whether strerror is declared" >&5 -echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror - char *p = (char *) strerror; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_strerror=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_strerror=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6 -if test $ac_cv_have_decl_strerror = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 0 -_ACEOF - - -fi - - - echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 -echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_strerror_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror_r - char *p = (char *) strerror_r; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_strerror_r=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_strerror_r=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 -if test $ac_cv_have_decl_strerror_r = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R 0 -_ACEOF - - -fi - - - -for ac_func in strerror_r -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 -echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 -if test "${ac_cv_func_strerror_r_char_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - exit (!isalpha (x)); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror_r_char_p=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - fi - -fi -echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 -echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 -if test $ac_cv_func_strerror_r_char_p = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_CHAR_P 1 -_ACEOF - -fi - - - - - -for ac_func in memchr -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - - if test $ac_cv_func_memchr = no; then - - - : - - - - - - - - - -for ac_header in bp-sym.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - fi - -echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 -if test "${ac_cv_header_stat_broken+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -#if defined(S_ISBLK) && defined(S_IFDIR) -# if S_ISBLK (S_IFDIR) -You lose. -# endif -#endif - -#if defined(S_ISBLK) && defined(S_IFCHR) -# if S_ISBLK (S_IFCHR) -You lose. -# endif -#endif - -#if defined(S_ISLNK) && defined(S_IFREG) -# if S_ISLNK (S_IFREG) -You lose. -# endif -#endif - -#if defined(S_ISSOCK) && defined(S_IFREG) -# if S_ISSOCK (S_IFREG) -You lose. -# endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "You lose" >/dev/null 2>&1; then - ac_cv_header_stat_broken=yes -else - ac_cv_header_stat_broken=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 -if test $ac_cv_header_stat_broken = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STAT_MACROS_BROKEN 1 -_ACEOF - -fi - - - -for ac_func in rmdir -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - - if test $ac_cv_func_rmdir = no; then - - - : - - fi - - - - : - - - - - - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -exit (malloc (0) ? 0 : 1); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF - - LIBOBJS="$LIBOBJS malloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF - -fi - - - - - - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - - : - - fi - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 -echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_realloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -exit (realloc (0, 0) ? 0 : 1); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_realloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_realloc_0_nonnull=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 -if test $ac_cv_func_realloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 0 -_ACEOF - - LIBOBJS="$LIBOBJS realloc.$ac_objext" - -cat >>confdefs.h <<\_ACEOF -#define realloc rpl_realloc -_ACEOF - -fi - - - - - - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - - : - - fi - - - - - - - - -for ac_header in stddef.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - : - - - - - - - - -for ac_header in wchar.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_header in wctype.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -for ac_func in iswprint -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_func in mbsinit -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - : - - - - - - - - - - : - - - - - - - - - echo "$as_me:$LINENO: checking for mbstate_t" >&5 -echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6 -if test "${ac_cv_type_mbstate_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -# include -int -main () -{ -mbstate_t x; return sizeof x; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_mbstate_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_mbstate_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 -echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6 - if test $ac_cv_type_mbstate_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBSTATE_T 1 -_ACEOF - - else - -cat >>confdefs.h <<\_ACEOF -#define mbstate_t int -_ACEOF - - fi - - echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 -echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6 -if test "${jm_cv_func_mbrtowc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -mbstate_t state; return ! (sizeof state && mbrtowc); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - jm_cv_func_mbrtowc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -jm_cv_func_mbrtowc=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5 -echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6 - if test $jm_cv_func_mbrtowc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MBRTOWC 1 -_ACEOF - - fi - - - - - - - -for ac_func in pathconf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_header in limits.h string.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -echo "$as_me:$LINENO: checking whether free is declared" >&5 -echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_free+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef free - char *p = (char *) free; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_free=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_free=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 -echo "${ECHO_T}$ac_cv_have_decl_free" >&6 -if test $ac_cv_have_decl_free = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREE 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getenv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getenv - char *p = (char *) getenv; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getenv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getenv=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 -if test $ac_cv_have_decl_getenv = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETENV 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef malloc - char *p = (char *) malloc; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_malloc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_malloc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 -if test $ac_cv_have_decl_malloc = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MALLOC 0 -_ACEOF - - -fi -echo "$as_me:$LINENO: checking whether mktemp is declared" >&5 -echo $ECHO_N "checking whether mktemp is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_mktemp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef mktemp - char *p = (char *) mktemp; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_mktemp=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_mktemp=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_mktemp" >&5 -echo "${ECHO_T}$ac_cv_have_decl_mktemp" >&6 -if test $ac_cv_have_decl_mktemp = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKTEMP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MKTEMP 0 -_ACEOF - - -fi - - - - - - - - - - - - - - -for ac_func in _doprintf geteuid getuid isascii memcmp mktemp \ - pathconf raise sigaction sigprocmask sigsetmask strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -for ac_func in mkdir strncasecmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" -fi -done - - -echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_largefile_source=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return !fseeko; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include -int -main () -{ -return !fseeko; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_largefile_source=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 -if test "$ac_cv_sys_largefile_source" != no; then - -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF - -fi -rm -f conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -echo "$as_me:$LINENO: checking for fseeko" >&5 -echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 -if test "${ac_cv_func_fseeko+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -return fseeko && fseeko (stdin, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_fseeko=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_fseeko=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5 -echo "${ECHO_T}$ac_cv_func_fseeko" >&6 -if test $ac_cv_func_fseeko = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF - -fi - - - echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef clearerr_unlocked - char *p = (char *) clearerr_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_clearerr_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_clearerr_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 -if test $ac_cv_have_decl_clearerr_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef feof_unlocked - char *p = (char *) feof_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_feof_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_feof_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 -if test $ac_cv_have_decl_feof_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef ferror_unlocked - char *p = (char *) ferror_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_ferror_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_ferror_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 -if test $ac_cv_have_decl_ferror_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fflush_unlocked - char *p = (char *) fflush_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fflush_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fflush_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 -if test $ac_cv_have_decl_fflush_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fgets_unlocked - char *p = (char *) fgets_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fgets_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fgets_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 -if test $ac_cv_have_decl_fgets_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputc_unlocked - char *p = (char *) fputc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fputc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fputc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 -if test $ac_cv_have_decl_fputc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fputs_unlocked - char *p = (char *) fputs_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fputs_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fputs_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 -if test $ac_cv_have_decl_fputs_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fread_unlocked - char *p = (char *) fread_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fread_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fread_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 -if test $ac_cv_have_decl_fread_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef fwrite_unlocked - char *p = (char *) fwrite_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_fwrite_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_fwrite_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 -if test $ac_cv_have_decl_fwrite_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getc_unlocked - char *p = (char *) getc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 -if test $ac_cv_have_decl_getc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef getchar_unlocked - char *p = (char *) getchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getchar_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getchar_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 -if test $ac_cv_have_decl_getchar_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putc_unlocked - char *p = (char *) putc_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_putc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_putc_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 -if test $ac_cv_have_decl_putc_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 -_ACEOF - - -fi - - - - - echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef putchar_unlocked - char *p = (char *) putchar_unlocked; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_putchar_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_putchar_unlocked=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 -if test $ac_cv_have_decl_putchar_unlocked = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED 0 -_ACEOF - - -fi - - - - - - - - : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - - : - - fi - - - - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - - : - - fi - -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -exit (closedir (opendir (".")) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - - - -for ac_header in fcntl.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - echo "$as_me:$LINENO: checking for DOS-style setmode" >&5 -echo $ECHO_N "checking for DOS-style setmode... $ECHO_C" >&6 -if test "${ac_cv_func_setmode_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif -int -main () -{ -int ret = setmode && setmode (1, O_BINARY); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setmode_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setmode_dos=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setmode_dos" >&5 -echo "${ECHO_T}$ac_cv_func_setmode_dos" >&6 - if test $ac_cv_func_setmode_dos = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SETMODE_DOS 1 -_ACEOF - - fi - -for ac_func in vprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -echo "$as_me:$LINENO: checking for _doprnt" >&5 -echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 -if test "${ac_cv_func__doprnt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -char (*f) () = _doprnt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != _doprnt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__doprnt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func__doprnt=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 -echo "${ECHO_T}$ac_cv_func__doprnt" >&6 -if test $ac_cv_func__doprnt = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOPRNT 1 -_ACEOF - -fi - -fi -done - - - -for ac_func in mkdir -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking whether mkdir takes only one argument" >&5 -echo $ECHO_N "checking whether mkdir takes only one argument... $ECHO_C" >&6 -if test "${patch_cv_mkdir_takes_one_arg+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -mkdir (".", 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -mkdir ("."); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - patch_cv_mkdir_takes_one_arg=yes - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - fi - - -fi -echo "$as_me:$LINENO: result: $patch_cv_mkdir_takes_one_arg" >&5 -echo "${ECHO_T}$patch_cv_mkdir_takes_one_arg" >&6 - if test $patch_cv_mkdir_takes_one_arg = yes; then - -cat >>confdefs.h <<\_ACEOF -#define MKDIR_TAKES_ONE_ARG 1 -_ACEOF - - fi - - - - - echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 -echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 -if test "${ac_cv_win_or_dos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_win_or_dos=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_win_or_dos=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 -echo "${ECHO_T}$ac_cv_win_or_dos" >&6 - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix -_ACEOF - - - - - - -cat >>confdefs.h <<_ACEOF -#define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator -_ACEOF - - -echo "$as_me:$LINENO: checking for long file names" >&5 -echo $ECHO_N "checking for long file names... $ECHO_C" >&6 -if test "${ac_cv_sys_long_file_names+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_long_file_names=yes -# Test for long file names in all the places we know might matter: -# . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: -# /tmp where it might want to write temporary files -# /var/tmp likewise -# /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs=$TMPDIR -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do - test -d $ac_dir || continue - test -w $ac_dir || continue # It is less confusing to not echo anything here. - ac_xdir=$ac_dir/cf$$ - (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue - ac_tf1=$ac_xdir/conftest9012345 - ac_tf2=$ac_xdir/conftest9012346 - (echo 1 >$ac_tf1) 2>/dev/null - (echo 2 >$ac_tf2) 2>/dev/null - ac_val=`cat $ac_tf1 2>/dev/null` - if test ! -f $ac_tf1 || test "$ac_val" != 1; then - ac_cv_sys_long_file_names=no - rm -rf $ac_xdir 2>/dev/null - break - fi - rm -rf $ac_xdir 2>/dev/null -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 -echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 -if test $ac_cv_sys_long_file_names = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_FILE_NAMES 1 -_ACEOF - -fi - - - ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by patch $as_me 2.5.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -patch config.status 2.5.9 -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@ed_PROGRAM@,$ed_PROGRAM,;t t -s,@EGREP@,$EGREP,;t t -s,@STDBOOL_H@,$STDBOOL_H,;t t -s,@HAVE__BOOL@,$HAVE__BOOL,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - Property changes on: vendor/misc-GNU/patch/dist/configure ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: vendor/misc-GNU/patch/dist/mkdir.c =================================================================== --- vendor/misc-GNU/patch/dist/mkdir.c (revision 358868) +++ vendor/misc-GNU/patch/dist/mkdir.c (nonexistent) @@ -1,76 +0,0 @@ -/* On some systems, mkdir ("foo/", 0700) fails because of the trailing - slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#include - -/* Disable the definition of mkdir to rpl_mkdir (from config.h) in this - file. Otherwise, we'd get conflicting prototypes for rpl_mkdir on - most systems. */ -#undef mkdir - -#include -#include -#include -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_STRING_H -# include -#else -# include -#endif - -#include "dirname.h" -#include "xalloc.h" - -#ifndef HAVE_DECL_FREE -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_FREE -void free (); -#endif - -/* This function is required at least for NetBSD 1.5.2. */ - -int -rpl_mkdir (char const *dir, mode_t mode) -{ - int ret_val; - char *tmp_dir; - size_t len = strlen (dir); - - if (len && dir[len - 1] == '/') - { - tmp_dir = xstrdup (dir); - strip_trailing_slashes (tmp_dir); - } - else - { - tmp_dir = (char *) dir; - } - - ret_val = mkdir (tmp_dir, mode); - - if (tmp_dir != dir) - free (tmp_dir); - - return ret_val; -} Property changes on: vendor/misc-GNU/patch/dist/mkdir.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/realloc.c =================================================================== --- vendor/misc-GNU/patch/dist/realloc.c (revision 358868) +++ vendor/misc-GNU/patch/dist/realloc.c (nonexistent) @@ -1,44 +0,0 @@ -/* Work around bug on some systems where realloc (NULL, 0) fails. - Copyright (C) 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#if HAVE_CONFIG_H -# include -#endif -#undef realloc - -#include - -char *malloc (); -char *realloc (); - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. If N is zero, change it to 1. If P is NULL, - use malloc. */ - -char * -rpl_realloc (p, n) - char *p; - size_t n; -{ - if (n == 0) - n = 1; - if (p == 0) - return malloc (n); - return realloc (p, n); -} Property changes on: vendor/misc-GNU/patch/dist/realloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/Makefile.in =================================================================== --- vendor/misc-GNU/patch/dist/Makefile.in (revision 358868) +++ vendor/misc-GNU/patch/dist/Makefile.in (nonexistent) @@ -1,221 +0,0 @@ -# Makefile for GNU patch. - -# Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. -# If not, write to the Free Software Foundation, -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#### Start of system configuration section. #### - -srcdir = @srcdir@ -VPATH = @srcdir@ - -@SET_MAKE@ - -CC = @CC@ -ed_PROGRAM = @ed_PROGRAM@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -transform = @program_transform_name@ - -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -DEFS = @DEFS@ -EXEEXT = @EXEEXT@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -OBJEXT = @OBJEXT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = $(exec_prefix)/bin - -# Where to put the manual pages. -mandir = @mandir@ -man1dir = $(mandir)/man1 -# Extension (including `.') for the manual page filenames. -man1ext = .1 - -# Hook for nonstandard builds. -CONFIG_STATUS = config.status - -#### End of system configuration section. #### - -SHELL = /bin/sh - -LIBSRCS = error.c malloc.c memchr.c mkdir.c \ - realloc.c rmdir.c strcasecmp.c strncasecmp.c -SRCS = $(LIBSRCS) \ - addext.c argmatch.c backupfile.c \ - basename.c dirname.c \ - getopt.c getopt1.c inp.c \ - maketime.c partime.c \ - patch.c pch.c \ - quote.c quotearg.c quotesys.c \ - util.c version.c xmalloc.c -OBJS = $(LIBOBJS) \ - addext.$(OBJEXT) argmatch.$(OBJEXT) backupfile.$(OBJEXT) \ - basename.$(OBJEXT) dirname.$(OBJEXT) \ - getopt.$(OBJEXT) getopt1.$(OBJEXT) inp.$(OBJEXT) \ - maketime.$(OBJEXT) partime.$(OBJEXT) \ - patch.$(OBJEXT) pch.$(OBJEXT) \ - quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \ - util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) -HDRS = argmatch.h backupfile.h common.h dirname.h \ - error.h getopt.h gettext.h \ - inp.h maketime.h partime.h pch.h \ - quote.h quotearg.h quotesys.h \ - unlocked-io.h util.h version.h xalloc.h -MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \ - aclocal.m4 \ - config.hin configure configure.ac \ - install-sh mkinstalldirs patch.man stdbool.h.in -DISTFILES = $(MISC) $(SRCS) $(HDRS) -DISTFILES_M4 = $(ACINCLUDE_INPUTS) -DISTFILES_PC = pc/chdirsaf.c -DISTFILES_PC_DJGPP = pc/djgpp/README pc/djgpp/config.sed \ - pc/djgpp/configure.bat pc/djgpp/configure.sed - -patch_name = `echo patch | sed '$(transform)'` - -all:: patch$(EXEEXT) - -info:: -check:: -installcheck:: - -COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -Ded_PROGRAM=\"$(ed_PROGRAM)\" \ - -I. -I$(srcdir) $(CFLAGS) - -.c.$(OBJEXT): - $(COMPILE) $< - -patch$(EXEEXT): $(OBJS) - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) - -install:: all installdirs - $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT) - -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext) - -installdirs:: - $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir) - -install-strip:: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install - -uninstall:: - rm -f $(bindir)/$(patch_name)$(EXEEXT) - rm -f $(man1dir)/$(patch_name)$(man1ext) - -Makefile: Makefile.in $(CONFIG_STATUS) - $(SHELL) $(CONFIG_STATUS) -config.status: configure - $(SHELL) $(CONFIG_STATUS) --recheck -configure: configure.ac $(srcdir)/aclocal.m4 - cd $(srcdir) && autoconf -config.hin: configure.ac $(srcdir)/aclocal.m4 - cd $(srcdir) && rm -f config.hin && autoheader -stdbool.h: stdbool.h.in - sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' \ - <$(srcdir)/stdbool.h.in >stdbool.h - -M4DIR = $(srcdir)/m4 -ACINCLUDE_INPUTS = \ - $(M4DIR)/backupfile.m4 \ - $(M4DIR)/d-ino.m4 \ - $(M4DIR)/dirname.m4 \ - $(M4DIR)/dos.m4 \ - $(M4DIR)/error.m4 \ - $(M4DIR)/getopt.m4 \ - $(M4DIR)/malloc.m4 \ - $(M4DIR)/mbrtowc.m4 \ - $(M4DIR)/mbstate_t.m4 \ - $(M4DIR)/memchr.m4 \ - $(M4DIR)/mkdir.m4 \ - $(M4DIR)/onceonly.m4 \ - $(M4DIR)/quote.m4 \ - $(M4DIR)/quotearg.m4 \ - $(M4DIR)/realloc.m4 \ - $(M4DIR)/rmdir.m4 \ - $(M4DIR)/setmode.m4 \ - $(M4DIR)/stdbool.m4 \ - $(M4DIR)/unlocked-io.m4 \ - $(M4DIR)/utimbuf.m4 \ - $(M4DIR)/xalloc.m4 - -$(srcdir)/aclocal.m4: $(ACINCLUDE_INPUTS) - cat $(ACINCLUDE_INPUTS) >$(srcdir)/aclocal.m4 - -TAGS: $(HDRS) $(SRCS) - etags $(HDRS) $(SRCS) - -mostlyclean:: - rm -f core* *core *.$(OBJEXT) *_.c stdbool.h - -clean:: mostlyclean - rm -f patch$(EXEEXT) - -distclean:: clean - rm -f Makefile config.cache config.log config.status config.h - -maintainer-clean:: - @echo "This command is intended for maintainers to use;" - @echo "rebuilding the deleted files requires special tools." - $(MAKE) distclean - rm -f TAGS - -PV = $(PACKAGE_NAME)-$(PACKAGE_VERSION) - -dist:: $(DISTFILES) $(DISTFILES_M4) $(DISTFILES_PC) $(DISTFILES_PC_DJGPP) - rm -rf $(PV) - mkdir $(PV) $(PV)/m4 $(PV)/pc $(PV)/pc/djgpp - cp -p $(DISTFILES) $(PV) - cp -p $(DISTFILES_M4) $(PV)/m4 - cp -p $(DISTFILES_PC) $(PV)/pc - cp -p $(DISTFILES_PC_DJGPP) $(PV)/pc/djgpp - tar -chf - $(PV) | gzip -9 >$(PV).tar.gz - rm -rf $(PV) - -$(OBJS): config.h -COMMON = common.h @STDBOOL_H@ -addext.$(OBJEXT): backupfile.h dirname.h -argmatch.$(OBJEXT): argmatch.h gettext.h error.h \ - quote.h quotearg.h unlocked-io.h -backupfile.$(OBJEXT): argmatch.h backupfile.h dirname.h -basename.$(OBJEXT): dirname.h -dirname.$(OBJEXT): dirname.h xalloc.h -error.$(OBJEXT): error.h gettext.h unlocked-io.h -getopt.$(OBJEXT) getopt1.$(OBJEXT): getopt.h -inp.$(OBJEXT): backupfile.h $(COMMON) inp.h pch.h quotearg.h util.h xalloc.h -maketime.$(OBJEXT): maketime.h partime.h -mkdir.$(OBJEXT): dirname.h xalloc.h -partime.$(OBJEXT): partime.h -patch.$(OBJEXT): argmatch.h backupfile.h $(COMMON) getopt.h inp.h \ - pch.h quotearg.h util.h version.h xalloc.h -pch.$(OBJEXT): backupfile.h $(COMMON) dirname.h inp.h pch.h quotearg.h util.h -quote.$(OBJECT): quote.h quotearg.h -quotearg.$(OBJEXT): gettext.h quotearg.h xalloc.h -quotesys.$(OBJEXT): quotesys.h -strncasecmp.$(OBJEXT): strcasecmp.c -util.$(OBJEXT): backupfile.h $(COMMON) dirname.h maketime.h \ - partime.h quotearg.h quotesys.h util.h version.h xalloc.h -version.$(OBJEXT): $(COMMON) version.h -xmalloc.$(OBJEXT): error.h gettext.h xalloc.h Index: vendor/misc-GNU/patch/dist/strcasecmp.c =================================================================== --- vendor/misc-GNU/patch/dist/strcasecmp.c (revision 358868) +++ vendor/misc-GNU/patch/dist/strcasecmp.c (nonexistent) @@ -1,66 +0,0 @@ -/* strcasecmp.c -- case insensitive string comparator - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifdef LENGTH_LIMIT -# define STRXCASECMP_FUNCTION strncasecmp -# define STRXCASECMP_DECLARE_N , size_t n -# define LENGTH_LIMIT_EXPR(Expr) Expr -#else -# define STRXCASECMP_FUNCTION strcasecmp -# define STRXCASECMP_DECLARE_N /* empty */ -# define LENGTH_LIMIT_EXPR(Expr) 0 -#endif - -#include -#include - -#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) - -/* Compare {{no more than N characters of }}strings S1 and S2, - ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less - than, equal to or greater than S2. */ - -int -STRXCASECMP_FUNCTION (const char *s1, const char *s2 STRXCASECMP_DECLARE_N) -{ - register const unsigned char *p1 = (const unsigned char *) s1; - register const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - - if (p1 == p2 || LENGTH_LIMIT_EXPR (n == 0)) - return 0; - - do - { - c1 = TOLOWER (*p1); - c2 = TOLOWER (*p2); - - if (LENGTH_LIMIT_EXPR (--n == 0) || c1 == '\0') - break; - - ++p1; - ++p2; - } - while (c1 == c2); - - return c1 - c2; -} Property changes on: vendor/misc-GNU/patch/dist/strcasecmp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/pch.c =================================================================== --- vendor/misc-GNU/patch/dist/pch.c (revision 358868) +++ vendor/misc-GNU/patch/dist/pch.c (nonexistent) @@ -1,2007 +0,0 @@ -/* reading patches */ - -/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */ - -/* Copyright (C) 1986, 1987, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -#define INITHUNKMAX 125 /* initial dynamic allocation size */ - -/* Patch (diff listing) abstract type. */ - -static FILE *pfp; /* patch file pointer */ -static int p_says_nonexistent[2]; /* [0] for old file, [1] for new: - 0 for existent and nonempty, - 1 for existent and probably (but not necessarily) empty, - 2 for nonexistent */ -static int p_rfc934_nesting; /* RFC 934 nesting level */ -static time_t p_timestamp[2]; /* timestamps in patch headers */ -static off_t p_filesize; /* size of the patch file */ -static LINENUM p_first; /* 1st line number */ -static LINENUM p_newfirst; /* 1st line number of replacement */ -static LINENUM p_ptrn_lines; /* # lines in pattern */ -static LINENUM p_repl_lines; /* # lines in replacement text */ -static LINENUM p_end = -1; /* last line in hunk */ -static LINENUM p_max; /* max allowed value of p_end */ -static LINENUM p_prefix_context; /* # of prefix context lines */ -static LINENUM p_suffix_context; /* # of suffix context lines */ -static LINENUM p_input_line; /* current line # from patch file */ -static char **p_line; /* the text of the hunk */ -static size_t *p_len; /* line length including \n if any */ -static char *p_Char; /* +, -, and ! */ -static LINENUM hunkmax = INITHUNKMAX; /* size of above arrays */ -static int p_indent; /* indent to patch */ -static bool p_strip_trailing_cr; /* true if stripping trailing \r */ -static bool p_pass_comments_through; /* true if not ignoring # lines */ -static file_offset p_base; /* where to intuit this time */ -static LINENUM p_bline; /* line # of p_base */ -static file_offset p_start; /* where intuit found a patch */ -static LINENUM p_sline; /* and the line number for it */ -static LINENUM p_hunk_beg; /* line number of current hunk */ -static LINENUM p_efake = -1; /* end of faked up lines--don't free */ -static LINENUM p_bfake = -1; /* beg of faked up lines */ - -enum nametype { OLD, NEW, INDEX, NONE }; - -static char *scan_linenum (char *, LINENUM *); -static enum diff intuit_diff_type (void); -static enum nametype best_name (char * const *, int const *); -static int prefix_components (char *, bool); -static size_t pget_line (int, int, bool, bool); -static size_t get_line (void); -static bool incomplete_line (void); -static bool grow_hunkmax (void); -static void malformed (void) __attribute__ ((noreturn)); -static void next_intuit_at (file_offset, LINENUM); -static void skip_to (file_offset, LINENUM); -static char get_ed_command_letter (char const *); - -/* Prepare to look for the next patch in the patch file. */ - -void -re_patch (void) -{ - p_first = 0; - p_newfirst = 0; - p_ptrn_lines = 0; - p_repl_lines = 0; - p_end = -1; - p_max = 0; - p_indent = 0; - p_strip_trailing_cr = false; -} - -/* Open the patch file at the beginning of time. */ - -void -open_patch_file (char const *filename) -{ - file_offset file_pos = 0; - struct stat st; - if (!filename || !*filename || strEQ (filename, "-")) - { - file_offset stdin_pos; -#if HAVE_SETMODE_DOS - if (binary_transput) - { - if (isatty (STDIN_FILENO)) - fatal ("cannot read binary data from tty on this platform"); - setmode (STDIN_FILENO, O_BINARY); - } -#endif - if (fstat (STDIN_FILENO, &st) != 0) - pfatal ("fstat"); - if (S_ISREG (st.st_mode) && (stdin_pos = file_tell (stdin)) != -1) - { - pfp = stdin; - file_pos = stdin_pos; - } - else - { - size_t charsread; - int exclusive = TMPPATNAME_needs_removal ? 0 : O_EXCL; - TMPPATNAME_needs_removal = 1; - pfp = fdopen (create_file (TMPPATNAME, - O_RDWR | O_BINARY | exclusive, - (mode_t) 0), - "w+b"); - if (!pfp) - pfatal ("Can't open stream for file %s", quotearg (TMPPATNAME)); - for (st.st_size = 0; - (charsread = fread (buf, 1, bufsize, stdin)) != 0; - st.st_size += charsread) - if (fwrite (buf, 1, charsread, pfp) != charsread) - write_fatal (); - if (ferror (stdin) || fclose (stdin) != 0) - read_fatal (); - if (fflush (pfp) != 0 - || file_seek (pfp, (file_offset) 0, SEEK_SET) != 0) - write_fatal (); - } - } - else - { - pfp = fopen (filename, binary_transput ? "rb" : "r"); - if (!pfp) - pfatal ("Can't open patch file %s", quotearg (filename)); - if (fstat (fileno (pfp), &st) != 0) - pfatal ("fstat"); - } - p_filesize = st.st_size; - if (p_filesize != (file_offset) p_filesize) - fatal ("patch file is too long"); - next_intuit_at (file_pos, (LINENUM) 1); - set_hunkmax(); -} - -/* Make sure our dynamically realloced tables are malloced to begin with. */ - -void -set_hunkmax (void) -{ - if (!p_line) - p_line = (char **) malloc (hunkmax * sizeof *p_line); - if (!p_len) - p_len = (size_t *) malloc (hunkmax * sizeof *p_len); - if (!p_Char) - p_Char = malloc (hunkmax * sizeof *p_Char); -} - -/* Enlarge the arrays containing the current hunk of patch. */ - -static bool -grow_hunkmax (void) -{ - hunkmax *= 2; - assert (p_line && p_len && p_Char); - if ((p_line = (char **) realloc (p_line, hunkmax * sizeof (*p_line))) - && (p_len = (size_t *) realloc (p_len, hunkmax * sizeof (*p_len))) - && (p_Char = realloc (p_Char, hunkmax * sizeof (*p_Char)))) - return true; - if (!using_plan_a) - memory_fatal (); - /* Don't free previous values of p_line etc., - since some broken implementations free them for us. - Whatever is null will be allocated again from within plan_a (), - of all places. */ - return false; -} - -/* True if the remainder of the patch file contains a diff of some sort. */ - -bool -there_is_another_patch (void) -{ - if (p_base != 0 && p_base >= p_filesize) { - if (verbosity == VERBOSE) - say ("done\n"); - return false; - } - if (verbosity == VERBOSE) - say ("Hmm..."); - diff_type = intuit_diff_type(); - if (diff_type == NO_DIFF) { - if (verbosity == VERBOSE) - say (p_base - ? " Ignoring the trailing garbage.\ndone\n" - : " I can't seem to find a patch in there anywhere.\n"); - if (! p_base && p_filesize) - fatal ("Only garbage was found in the patch input."); - return false; - } - if (skip_rest_of_patch) - { - Fseek (pfp, p_start, SEEK_SET); - p_input_line = p_sline - 1; - return true; - } - if (verbosity == VERBOSE) - say (" %sooks like %s to me...\n", - (p_base == 0 ? "L" : "The next patch l"), - diff_type == UNI_DIFF ? "a unified diff" : - diff_type == CONTEXT_DIFF ? "a context diff" : - diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : - diff_type == NORMAL_DIFF ? "a normal diff" : - "an ed script" ); - - if (verbosity != SILENT) - { - if (p_indent) - say ("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s"); - if (p_strip_trailing_cr) - say ("(Stripping trailing CRs from patch.)\n"); - if (! inname) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("can't find file to patch at input line %s\n", - format_linenum (numbuf, p_sline)); - if (diff_type != ED_DIFF) - say (strippath == -1 - ? "Perhaps you should have used the -p or --strip option?\n" - : "Perhaps you used the wrong -p or --strip option?\n"); - } - } - - skip_to(p_start,p_sline); - while (!inname) { - if (force | batch) { - say ("No file to patch. Skipping patch.\n"); - skip_rest_of_patch = true; - return true; - } - ask ("File to patch: "); - inname = fetchname (buf, 0, (time_t *) 0); - if (inname) - { - if (stat (inname, &instat) == 0) - { - inerrno = 0; - invc = -1; - } - else - { - perror (inname); - fflush (stderr); - free (inname); - inname = 0; - } - } - if (!inname) { - ask ("Skip this patch? [y] "); - if (*buf != 'n') { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - return true; - } - } - } - return true; -} - -/* Determine what kind of diff is in the remaining part of the patch file. */ - -static enum diff -intuit_diff_type (void) -{ - register file_offset this_line = 0; - register file_offset first_command_line = -1; - char first_ed_command_letter = 0; - LINENUM fcl_line = 0; /* Pacify `gcc -W'. */ - register bool this_is_a_command = false; - register bool stars_this_line = false; - enum nametype i; - char *name[3]; - struct stat st[3]; - int stat_errno[3]; - int version_controlled[3]; - register enum diff retval; - - name[OLD] = name[NEW] = name[INDEX] = 0; - version_controlled[OLD] = -1; - version_controlled[NEW] = -1; - version_controlled[INDEX] = -1; - p_rfc934_nesting = 0; - p_timestamp[OLD] = p_timestamp[NEW] = (time_t) -1; - p_says_nonexistent[OLD] = p_says_nonexistent[NEW] = 0; - Fseek (pfp, p_base, SEEK_SET); - p_input_line = p_bline - 1; - for (;;) { - register char *s; - register char *t; - register file_offset previous_line = this_line; - register bool last_line_was_command = this_is_a_command; - register bool stars_last_line = stars_this_line; - register int indent = 0; - char ed_command_letter; - bool strip_trailing_cr; - size_t chars_read; - - this_line = file_tell (pfp); - chars_read = pget_line (0, 0, false, false); - if (chars_read == (size_t) -1) - memory_fatal (); - if (! chars_read) { - if (first_ed_command_letter) { - /* nothing but deletes!? */ - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - else { - p_start = this_line; - p_sline = p_input_line; - return NO_DIFF; - } - } - strip_trailing_cr = 2 <= chars_read && buf[chars_read - 2] == '\r'; - for (s = buf; *s == ' ' || *s == '\t' || *s == 'X'; s++) { - if (*s == '\t') - indent = (indent + 8) & ~7; - else - indent++; - } - for (t = s; ISDIGIT (*t) || *t == ','; t++) - continue; - this_is_a_command = (ISDIGIT (*s) && - (*t == 'd' || *t == 'c' || *t == 'a') ); - if (first_command_line < 0 - && ((ed_command_letter = get_ed_command_letter (s)) - || this_is_a_command)) { - first_command_line = this_line; - first_ed_command_letter = ed_command_letter; - fcl_line = p_input_line; - p_indent = indent; /* assume this for now */ - p_strip_trailing_cr = strip_trailing_cr; - } - if (!stars_last_line && strnEQ(s, "*** ", 4)) - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "+++ ", 4)) - /* Swap with NEW below. */ - name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]); - else if (strnEQ(s, "Index:", 6)) - name[INDEX] = fetchname (s+6, strippath, (time_t *) 0); - else if (strnEQ(s, "Prereq:", 7)) { - for (t = s + 7; ISSPACE ((unsigned char) *t); t++) - continue; - revision = t; - for (t = revision; *t; t++) - if (ISSPACE ((unsigned char) *t)) - { - char const *u; - for (u = t + 1; ISSPACE ((unsigned char) *u); u++) - continue; - if (*u) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("Prereq: with multiple words at line %s of patch\n", - format_linenum (numbuf, this_line)); - } - break; - } - if (t == revision) - revision = 0; - else { - char oldc = *t; - *t = '\0'; - revision = savestr (revision); - *t = oldc; - } - } else - { - for (t = s; t[0] == '-' && t[1] == ' '; t += 2) - continue; - if (strnEQ(t, "--- ", 4)) - { - time_t timestamp = (time_t) -1; - name[NEW] = fetchname (t+4, strippath, ×tamp); - if (timestamp != (time_t) -1) - { - p_timestamp[NEW] = timestamp; - p_rfc934_nesting = (t - s) >> 1; - } - } - } - if ((diff_type == NO_DIFF || diff_type == ED_DIFF) && - first_command_line >= 0 && - strEQ(s, ".\n") ) { - p_start = first_command_line; - p_sline = fcl_line; - retval = ED_DIFF; - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == UNI_DIFF) - && strnEQ(s, "@@ -", 4)) { - - /* `name' and `p_timestamp' are backwards; swap them. */ - time_t ti = p_timestamp[OLD]; - p_timestamp[OLD] = p_timestamp[NEW]; - p_timestamp[NEW] = ti; - t = name[OLD]; - name[OLD] = name[NEW]; - name[NEW] = t; - - s += 4; - if (s[0] == '0' && !ISDIGIT (s[1])) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - while (*s != ' ' && *s != '\n') - s++; - while (*s == ' ') - s++; - if (s[0] == '+' && s[1] == '0' && !ISDIGIT (s[2])) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - p_indent = indent; - p_start = this_line; - p_sline = p_input_line; - retval = UNI_DIFF; - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW])) - && ! name[INDEX]) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("missing header for unified diff at line %s of patch\n", - format_linenum (numbuf, p_sline)); - } - goto scan_exit; - } - stars_this_line = strnEQ(s, "********", 8); - if ((diff_type == NO_DIFF - || diff_type == CONTEXT_DIFF - || diff_type == NEW_CONTEXT_DIFF) - && stars_last_line && strnEQ (s, "*** ", 4)) { - s += 4; - if (s[0] == '0' && !ISDIGIT (s[1])) - p_says_nonexistent[OLD] = 1 + ! p_timestamp[OLD]; - /* if this is a new context diff the character just before */ - /* the newline is a '*'. */ - while (*s != '\n') - s++; - p_indent = indent; - p_strip_trailing_cr = strip_trailing_cr; - p_start = previous_line; - p_sline = p_input_line - 1; - retval = (*(s-1) == '*' ? NEW_CONTEXT_DIFF : CONTEXT_DIFF); - - { - /* Scan the first hunk to see whether the file contents - appear to have been deleted. */ - file_offset saved_p_base = p_base; - LINENUM saved_p_bline = p_bline; - Fseek (pfp, previous_line, SEEK_SET); - p_input_line -= 2; - if (another_hunk (retval, false) - && ! p_repl_lines && p_newfirst == 1) - p_says_nonexistent[NEW] = 1 + ! p_timestamp[NEW]; - next_intuit_at (saved_p_base, saved_p_bline); - } - - if (! ((name[OLD] || ! p_timestamp[OLD]) - && (name[NEW] || ! p_timestamp[NEW])) - && ! name[INDEX]) - { - char numbuf[LINENUM_LENGTH_BOUND + 1]; - say ("missing header for context diff at line %s of patch\n", - format_linenum (numbuf, p_sline)); - } - goto scan_exit; - } - if ((diff_type == NO_DIFF || diff_type == NORMAL_DIFF) && - last_line_was_command && - (strnEQ(s, "< ", 2) || strnEQ(s, "> ", 2)) ) { - p_start = previous_line; - p_sline = p_input_line - 1; - p_indent = indent; - p_strip_trailing_cr = strip_trailing_cr; - retval = NORMAL_DIFF; - goto scan_exit; - } - } - - scan_exit: - - /* To intuit `inname', the name of the file to patch, - use the algorithm specified by POSIX 1003.1-2001 XCU lines 25680-26599 - (with some modifications if posixly_correct is zero): - - - Take the old and new names from the context header if present, - and take the index name from the `Index:' line if present and - if either the old and new names are both absent - or posixly_correct is nonzero. - Consider the file names to be in the order (old, new, index). - - If some named files exist, use the first one if posixly_correct - is nonzero, the best one otherwise. - - If patch_get is nonzero, and no named files exist, - but an RCS or SCCS master file exists, - use the first named file with an RCS or SCCS master. - - If no named files exist, no RCS or SCCS master was found, - some names are given, posixly_correct is zero, - and the patch appears to create a file, then use the best name - requiring the creation of the fewest directories. - - Otherwise, report failure by setting `inname' to 0; - this causes our invoker to ask the user for a file name. */ - - i = NONE; - - if (!inname) - { - enum nametype i0 = NONE; - - if (! posixly_correct && (name[OLD] || name[NEW]) && name[INDEX]) - { - free (name[INDEX]); - name[INDEX] = 0; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - if (i0 != NONE && strcmp (name[i0], name[i]) == 0) - { - /* It's the same name as before; reuse stat results. */ - stat_errno[i] = stat_errno[i0]; - if (! stat_errno[i]) - st[i] = st[i0]; - } - else if (stat (name[i], &st[i]) != 0) - stat_errno[i] = errno; - else - { - stat_errno[i] = 0; - if (posixly_correct) - break; - } - i0 = i; - } - - if (! posixly_correct) - { - bool is_empty; - - i = best_name (name, stat_errno); - - if (i == NONE && patch_get) - { - enum nametype nope = NONE; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - char const *cs; - char *getbuf; - char *diffbuf; - bool readonly = (outfile - && strcmp (outfile, name[i]) != 0); - - if (nope == NONE || strcmp (name[nope], name[i]) != 0) - { - cs = (version_controller - (name[i], readonly, (struct stat *) 0, - &getbuf, &diffbuf)); - version_controlled[i] = !! cs; - if (cs) - { - if (version_get (name[i], cs, false, readonly, - getbuf, &st[i])) - stat_errno[i] = 0; - else - version_controlled[i] = 0; - - free (getbuf); - if (diffbuf) - free (diffbuf); - - if (! stat_errno[i]) - break; - } - } - - nope = i; - } - } - - is_empty = i == NONE || st[i].st_size == 0; - if ((! is_empty) < p_says_nonexistent[reverse ^ is_empty]) - { - assert (i0 != NONE); - reverse ^= - ok_to_reverse - ("The next patch%s would %s the file %s,\nwhich %s!", - reverse ? ", when reversed," : "", - (i == NONE ? "delete" - : st[i].st_size == 0 ? "empty out" - : "create"), - quotearg (name[i == NONE || st[i].st_size == 0 ? i0 : i]), - (i == NONE ? "does not exist" - : st[i].st_size == 0 ? "is already empty" - : "already exists")); - } - - if (i == NONE && p_says_nonexistent[reverse]) - { - int newdirs[3]; - int newdirs_min = INT_MAX; - int distance_from_minimum[3]; - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - { - newdirs[i] = (prefix_components (name[i], false) - - prefix_components (name[i], true)); - if (newdirs[i] < newdirs_min) - newdirs_min = newdirs[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - distance_from_minimum[i] = newdirs[i] - newdirs_min; - - i = best_name (name, distance_from_minimum); - } - } - } - - if (i == NONE) - inerrno = -1; - else - { - inname = name[i]; - name[i] = 0; - inerrno = stat_errno[i]; - invc = version_controlled[i]; - instat = st[i]; - } - - for (i = OLD; i <= INDEX; i++) - if (name[i]) - free (name[i]); - - return retval; -} - -/* Count the path name components in FILENAME's prefix. - If CHECKDIRS is true, count only existing directories. */ -static int -prefix_components (char *filename, bool checkdirs) -{ - int count = 0; - struct stat stat_buf; - int stat_result; - char *f = filename + FILESYSTEM_PREFIX_LEN (filename); - - if (*f) - while (*++f) - if (ISSLASH (f[0]) && ! ISSLASH (f[-1])) - { - if (checkdirs) - { - *f = '\0'; - stat_result = stat (filename, &stat_buf); - *f = '/'; - if (! (stat_result == 0 && S_ISDIR (stat_buf.st_mode))) - break; - } - - count++; - } - - return count; -} - -/* Return the index of the best of NAME[OLD], NAME[NEW], and NAME[INDEX]. - Ignore null names, and ignore NAME[i] if IGNORE[i] is nonzero. - Return NONE if all names are ignored. */ -static enum nametype -best_name (char *const *name, int const *ignore) -{ - enum nametype i; - int components[3]; - int components_min = INT_MAX; - size_t basename_len[3]; - size_t basename_len_min = SIZE_MAX; - size_t len[3]; - size_t len_min = SIZE_MAX; - - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i]) - { - /* Take the names with the fewest prefix components. */ - components[i] = prefix_components (name[i], false); - if (components_min < components[i]) - continue; - components_min = components[i]; - - /* Of those, take the names with the shortest basename. */ - basename_len[i] = strlen (base_name (name[i])); - if (basename_len_min < basename_len[i]) - continue; - basename_len_min = basename_len[i]; - - /* Of those, take the shortest names. */ - len[i] = strlen (name[i]); - if (len_min < len[i]) - continue; - len_min = len[i]; - } - - /* Of those, take the first name. */ - for (i = OLD; i <= INDEX; i++) - if (name[i] && !ignore[i] - && components[i] == components_min - && basename_len[i] == basename_len_min - && len[i] == len_min) - break; - - return i; -} - -/* Remember where this patch ends so we know where to start up again. */ - -static void -next_intuit_at (file_offset file_pos, LINENUM file_line) -{ - p_base = file_pos; - p_bline = file_line; -} - -/* Basically a verbose fseek() to the actual diff listing. */ - -static void -skip_to (file_offset file_pos, LINENUM file_line) -{ - register FILE *i = pfp; - register FILE *o = stdout; - register int c; - - assert(p_base <= file_pos); - if ((verbosity == VERBOSE || !inname) && p_base < file_pos) { - Fseek (i, p_base, SEEK_SET); - say ("The text leading up to this was:\n--------------------------\n"); - - while (file_tell (i) < file_pos) - { - putc ('|', o); - do - { - if ((c = getc (i)) == EOF) - read_fatal (); - putc (c, o); - } - while (c != '\n'); - } - - say ("--------------------------\n"); - } - else - Fseek (i, file_pos, SEEK_SET); - p_input_line = file_line - 1; -} - -/* Make this a function for better debugging. */ -static void -malformed (void) -{ - char numbuf[LINENUM_LENGTH_BOUND + 1]; - fatal ("malformed patch at line %s: %s", - format_linenum (numbuf, p_input_line), buf); - /* about as informative as "Syntax error" in C */ -} - -/* Parse a line number from a string. - Return the address of the first char after the number. */ -static char * -scan_linenum (char *s0, LINENUM *linenum) -{ - char *s; - LINENUM n = 0; - bool overflow = false; - char numbuf[LINENUM_LENGTH_BOUND + 1]; - - for (s = s0; ISDIGIT (*s); s++) - { - LINENUM new_n = 10 * n + (*s - '0'); - overflow |= new_n / 10 != n; - n = new_n; - } - - if (s == s0) - fatal ("missing line number at line %s: %s", - format_linenum (numbuf, p_input_line), buf); - - if (overflow) - fatal ("line number %.*s is too large at line %s: %s", - (int) (s - s0), s0, format_linenum (numbuf, p_input_line), buf); - - *linenum = n; - return s; -} - -/* 1 if there is more of the current diff listing to process; - 0 if not; -1 if ran out of memory. */ - -int -another_hunk (enum diff difftype, bool rev) -{ - register char *s; - register LINENUM context = 0; - register size_t chars_read; - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - char numbuf2[LINENUM_LENGTH_BOUND + 1]; - char numbuf3[LINENUM_LENGTH_BOUND + 1]; - - while (p_end >= 0) { - if (p_end == p_efake) - p_end = p_bfake; /* don't free twice */ - else - free(p_line[p_end]); - p_end--; - } - assert(p_end == -1); - p_efake = -1; - - p_max = hunkmax; /* gets reduced when --- found */ - if (difftype == CONTEXT_DIFF || difftype == NEW_CONTEXT_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - LINENUM repl_beginning = 0; /* index of --- line */ - register LINENUM fillcnt = 0; /* #lines of missing ptrn or repl */ - register LINENUM fillsrc; /* index of first line to copy */ - register LINENUM filldst; /* index of first missing line */ - bool ptrn_spaces_eaten = false; /* ptrn was slightly misformed */ - bool some_context = false; /* (perhaps internal) context seen */ - register bool repl_could_be_missing = true; - bool ptrn_missing = false; /* The pattern was missing. */ - bool repl_missing = false; /* Likewise for replacement. */ - file_offset repl_backtrack_position = 0; - /* file pos of first repl line */ - LINENUM repl_patch_line; /* input line number for same */ - LINENUM repl_context; /* context for same */ - LINENUM ptrn_prefix_context = -1; /* lines in pattern prefix context */ - LINENUM ptrn_suffix_context = -1; /* lines in pattern suffix context */ - LINENUM repl_prefix_context = -1; /* lines in replac. prefix context */ - LINENUM ptrn_copiable = 0; /* # of copiable lines in ptrn */ - LINENUM repl_copiable = 0; /* Likewise for replacement. */ - - /* Pacify `gcc -Wall'. */ - fillsrc = filldst = repl_patch_line = repl_context = 0; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 8 - || strncmp (buf, "********", 8) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - p_hunk_beg = p_input_line + 1; - while (p_end < p_max) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - return -1; - if (!chars_read) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - if (p_max - p_end < 4) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 3; - } else { - fatal ("unexpected end of file in patch"); - } - } - p_end++; - if (p_end == hunkmax) - fatal ("unterminated hunk starting at line %s; giving up at line %s: %s", - format_linenum (numbuf0, pch_hunk_beg ()), - format_linenum (numbuf1, p_input_line), buf); - assert(p_end < hunkmax); - p_Char[p_end] = *buf; - p_len[p_end] = 0; - p_line[p_end] = 0; - switch (*buf) { - case '*': - if (strnEQ(buf, "********", 8)) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - else - fatal ("unexpected end of hunk at line %s", - format_linenum (numbuf0, p_input_line)); - } - if (p_end != 0) { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal ("unexpected `***' at line %s: %s", - format_linenum (numbuf0, p_input_line), buf); - } - context = 0; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) { - p_end--; - return -1; - } - for (s = buf; *s && !ISDIGIT (*s); s++) - continue; - if (strnEQ(s,"0,0",3)) - remove_prefix (s, 2); - s = scan_linenum (s, &p_first); - if (*s == ',') { - while (*s && !ISDIGIT (*s)) - s++; - scan_linenum (s, &p_ptrn_lines); - p_ptrn_lines += 1 - p_first; - } - else if (p_first) - p_ptrn_lines = 1; - else { - p_ptrn_lines = 0; - p_first = 1; - } - p_max = p_ptrn_lines + 6; /* we need this much at least */ - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - p_max = hunkmax; - break; - case '-': - if (buf[1] != '-') - goto change_line; - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - ptrn_suffix_context = context; - if (repl_beginning - || (p_end - != p_ptrn_lines + 1 + (p_Char[p_end - 1] == '\n'))) - { - if (p_end == 1) - { - /* `Old' lines were omitted. Set up to fill - them in from `new' context lines. */ - ptrn_missing = true; - p_end = p_ptrn_lines + 1; - ptrn_prefix_context = ptrn_suffix_context = -1; - fillsrc = p_end + 1; - filldst = 1; - fillcnt = p_ptrn_lines; - } - else if (! repl_beginning) - fatal ("%s `---' at line %s; check line numbers at line %s", - (p_end <= p_ptrn_lines - ? "Premature" - : "Overdue"), - format_linenum (numbuf0, p_input_line), - format_linenum (numbuf1, p_hunk_beg)); - else if (! repl_could_be_missing) - fatal ("duplicate `---' at line %s; check line numbers at line %s", - format_linenum (numbuf0, p_input_line), - format_linenum (numbuf1, - p_hunk_beg + repl_beginning)); - else - { - repl_missing = true; - goto hunk_done; - } - } - repl_beginning = p_end; - repl_backtrack_position = file_tell (pfp); - repl_patch_line = p_input_line; - repl_context = context; - p_len[p_end] = strlen (buf); - if (! (p_line[p_end] = savestr (buf))) - { - p_end--; - return -1; - } - p_Char[p_end] = '='; - for (s = buf; *s && ! ISDIGIT (*s); s++) - continue; - s = scan_linenum (s, &p_newfirst); - if (*s == ',') - { - do - { - if (!*++s) - malformed (); - } - while (! ISDIGIT (*s)); - scan_linenum (s, &p_repl_lines); - p_repl_lines += 1 - p_newfirst; - } - else if (p_newfirst) - p_repl_lines = 1; - else - { - p_repl_lines = 0; - p_newfirst = 1; - } - p_max = p_repl_lines + p_end; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - if (p_repl_lines != ptrn_copiable - && (p_prefix_context != 0 - || context != 0 - || p_repl_lines != 1)) - repl_could_be_missing = false; - context = 0; - break; - case '+': case '!': - repl_could_be_missing = false; - change_line: - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, " \n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - if (! repl_beginning) - { - if (ptrn_prefix_context == -1) - ptrn_prefix_context = context; - } - else - { - if (repl_prefix_context == -1) - repl_prefix_context = context; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (s, chars_read))) { - p_end--; - return -1; - } - context = 0; - break; - case '\t': case '\n': /* assume spaces got eaten */ - s = buf; - if (*buf == '\t') { - s++; - chars_read--; - } - if (repl_beginning && repl_could_be_missing && - (!ptrn_spaces_eaten || difftype == NEW_CONTEXT_DIFF) ) { - repl_missing = true; - goto hunk_done; - } - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf, chars_read))) { - p_end--; - return -1; - } - if (p_end != p_ptrn_lines + 1) { - ptrn_spaces_eaten |= (repl_beginning != 0); - some_context = true; - context++; - if (repl_beginning) - repl_copiable++; - else - ptrn_copiable++; - p_Char[p_end] = ' '; - } - break; - case ' ': - s = buf + 1; - chars_read--; - if (*s == '\n' && canonicalize) { - strcpy (s, "\n"); - chars_read = 2; - } - if (*s == ' ' || *s == '\t') { - s++; - chars_read--; - } else if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - some_context = true; - context++; - if (repl_beginning) - repl_copiable++; - else - ptrn_copiable++; - chars_read -= - (1 < chars_read - && p_end == (repl_beginning ? p_max : p_ptrn_lines) - && incomplete_line ()); - p_len[p_end] = chars_read; - if (! (p_line[p_end] = savebuf (buf + 2, chars_read))) { - p_end--; - return -1; - } - break; - default: - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - malformed (); - } - } - - hunk_done: - if (p_end >=0 && !repl_beginning) - fatal ("no `---' found in patch at line %s", - format_linenum (numbuf0, pch_hunk_beg ())); - - if (repl_missing) { - - /* reset state back to just after --- */ - p_input_line = repl_patch_line; - context = repl_context; - for (p_end--; p_end > repl_beginning; p_end--) - free(p_line[p_end]); - Fseek (pfp, repl_backtrack_position, SEEK_SET); - - /* redundant 'new' context lines were omitted - set */ - /* up to fill them in from the old file context */ - fillsrc = 1; - filldst = repl_beginning+1; - fillcnt = p_repl_lines; - p_end = p_max; - } - else if (! ptrn_missing && ptrn_copiable != repl_copiable) - fatal ("context mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - else if (!some_context && fillcnt == 1) { - /* the first hunk was a null hunk with no context */ - /* and we were expecting one line -- fix it up. */ - while (filldst < p_end) { - p_line[filldst] = p_line[filldst+1]; - p_Char[filldst] = p_Char[filldst+1]; - p_len[filldst] = p_len[filldst+1]; - filldst++; - } -#if 0 - repl_beginning--; /* this doesn't need to be fixed */ -#endif - p_end--; - p_first++; /* do append rather than insert */ - fillcnt = 0; - p_ptrn_lines = 0; - } - - p_prefix_context = ((repl_prefix_context == -1 - || (ptrn_prefix_context != -1 - && ptrn_prefix_context < repl_prefix_context)) - ? ptrn_prefix_context : repl_prefix_context); - p_suffix_context = ((ptrn_suffix_context != -1 - && ptrn_suffix_context < context) - ? ptrn_suffix_context : context); - assert (p_prefix_context != -1 && p_suffix_context != -1); - - if (difftype == CONTEXT_DIFF - && (fillcnt - || (p_first > 1 - && p_prefix_context + p_suffix_context < ptrn_copiable))) { - if (verbosity == VERBOSE) - say ("%s\n%s\n%s\n", -"(Fascinating -- this is really a new-style context diff but without", -"the telltale extra asterisks on the *** line that usually indicate", -"the new style...)"); - diff_type = difftype = NEW_CONTEXT_DIFF; - } - - /* if there were omitted context lines, fill them in now */ - if (fillcnt) { - p_bfake = filldst; /* remember where not to free() */ - p_efake = filldst + fillcnt - 1; - while (fillcnt-- > 0) { - while (fillsrc <= p_end && fillsrc != repl_beginning - && p_Char[fillsrc] != ' ') - fillsrc++; - if (p_end < fillsrc || fillsrc == repl_beginning) - { - fatal ("replacement text or line numbers mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - } - p_line[filldst] = p_line[fillsrc]; - p_Char[filldst] = p_Char[fillsrc]; - p_len[filldst] = p_len[fillsrc]; - fillsrc++; filldst++; - } - while (fillsrc <= p_end && fillsrc != repl_beginning) - { - if (p_Char[fillsrc] == ' ') - fatal ("replacement text or line numbers mangled in hunk at line %s", - format_linenum (numbuf0, p_hunk_beg)); - fillsrc++; - } - if (debug & 64) - printf ("fillsrc %s, filldst %s, rb %s, e+1 %s\n", - format_linenum (numbuf0, fillsrc), - format_linenum (numbuf1, filldst), - format_linenum (numbuf2, repl_beginning), - format_linenum (numbuf3, p_end + 1)); - assert(fillsrc==p_end+1 || fillsrc==repl_beginning); - assert(filldst==p_end+1 || filldst==repl_beginning); - } - } - else if (difftype == UNI_DIFF) { - file_offset line_beginning = file_tell (pfp); - /* file pos of the current line */ - register LINENUM fillsrc; /* index of old lines */ - register LINENUM filldst; /* index of new lines */ - char ch = '\0'; - - chars_read = get_line (); - if (chars_read == (size_t) -1 - || chars_read <= 4 - || strncmp (buf, "@@ -", 4) != 0) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = scan_linenum (buf + 4, &p_first); - if (*s == ',') - s = scan_linenum (s + 1, &p_ptrn_lines); - else - p_ptrn_lines = 1; - if (*s == ' ') s++; - if (*s != '+') - malformed (); - s = scan_linenum (s + 1, &p_newfirst); - if (*s == ',') - s = scan_linenum (s + 1, &p_repl_lines); - else - p_repl_lines = 1; - if (*s == ' ') s++; - if (*s != '@') - malformed (); - if (!p_ptrn_lines) - p_first++; /* do append rather than insert */ - if (!p_repl_lines) - p_newfirst++; - p_max = p_ptrn_lines + p_repl_lines + 1; - while (p_max >= hunkmax) - if (! grow_hunkmax ()) - return -1; - fillsrc = 1; - filldst = fillsrc + p_ptrn_lines; - p_end = filldst + p_repl_lines; - sprintf (buf, "*** %s,%s ****\n", - format_linenum (numbuf0, p_first), - format_linenum (numbuf1, p_first + p_ptrn_lines - 1)); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - sprintf (buf, "--- %s,%s ----\n", - format_linenum (numbuf0, p_newfirst), - format_linenum (numbuf1, p_newfirst + p_repl_lines - 1)); - p_len[filldst] = strlen (buf); - if (! (p_line[filldst] = savestr (buf))) { - p_end = 0; - return -1; - } - p_Char[filldst++] = '='; - p_prefix_context = -1; - p_hunk_beg = p_input_line + 1; - while (fillsrc <= p_ptrn_lines || filldst <= p_end) { - chars_read = get_line (); - if (!chars_read) { - if (p_max - filldst < 3) { - strcpy (buf, " \n"); /* assume blank lines got chopped */ - chars_read = 2; - } else { - fatal ("unexpected end of file in patch"); - } - } - if (chars_read == (size_t) -1) - s = 0; - else if (*buf == '\t' || *buf == '\n') { - ch = ' '; /* assume the space got eaten */ - s = savebuf (buf, chars_read); - } - else { - ch = *buf; - s = savebuf (buf+1, --chars_read); - } - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - switch (ch) { - case '-': - if (fillsrc > p_ptrn_lines) { - free(s); - p_end = filldst-1; - malformed (); - } - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - break; - case '=': - ch = ' '; - /* FALL THROUGH */ - case ' ': - if (fillsrc > p_ptrn_lines) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - context++; - chars_read -= fillsrc == p_ptrn_lines && incomplete_line (); - p_Char[fillsrc] = ch; - p_line[fillsrc] = s; - p_len[fillsrc++] = chars_read; - s = savebuf (s, chars_read); - if (!s) { - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - return -1; - } - /* FALL THROUGH */ - case '+': - if (filldst > p_end) { - free(s); - while (--filldst > p_ptrn_lines) - free(p_line[filldst]); - p_end = fillsrc-1; - malformed (); - } - chars_read -= filldst == p_end && incomplete_line (); - p_Char[filldst] = ch; - p_line[filldst] = s; - p_len[filldst++] = chars_read; - break; - default: - p_end = filldst; - malformed (); - } - if (ch != ' ') { - if (p_prefix_context == -1) - p_prefix_context = context; - context = 0; - } - }/* while */ - if (p_prefix_context == -1) - malformed (); - p_suffix_context = context; - } - else { /* normal diff--fake it up */ - char hunk_type; - register int i; - LINENUM min, max; - file_offset line_beginning = file_tell (pfp); - - p_prefix_context = p_suffix_context = 0; - chars_read = get_line (); - if (chars_read == (size_t) -1 || !chars_read || !ISDIGIT (*buf)) { - next_intuit_at(line_beginning,p_input_line); - return chars_read == (size_t) -1 ? -1 : 0; - } - s = scan_linenum (buf, &p_first); - if (*s == ',') { - s = scan_linenum (s + 1, &p_ptrn_lines); - p_ptrn_lines += 1 - p_first; - } - else - p_ptrn_lines = (*s != 'a'); - hunk_type = *s; - if (hunk_type == 'a') - p_first++; /* do append rather than insert */ - s = scan_linenum (s + 1, &min); - if (*s == ',') - scan_linenum (s + 1, &max); - else - max = min; - if (hunk_type == 'd') - min++; - p_end = p_ptrn_lines + 1 + max - min + 1; - while (p_end >= hunkmax) - if (! grow_hunkmax ()) - { - p_end = -1; - return -1; - } - p_newfirst = min; - p_repl_lines = max - min + 1; - sprintf (buf, "*** %s,%s\n", - format_linenum (numbuf0, p_first), - format_linenum (numbuf1, p_first + p_ptrn_lines - 1)); - p_len[0] = strlen (buf); - if (! (p_line[0] = savestr (buf))) { - p_end = -1; - return -1; - } - p_Char[0] = '*'; - for (i=1; i<=p_ptrn_lines; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (buf[0] != '<' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`<' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - chars_read -= 2 + (i == p_ptrn_lines && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '-'; - } - if (hunk_type == 'c') { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (! chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (*buf != '-') - fatal ("`---' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - } - sprintf (buf, "--- %s,%s\n", - format_linenum (numbuf0, min), - format_linenum (numbuf1, max)); - p_len[i] = strlen (buf); - if (! (p_line[i] = savestr (buf))) { - p_end = i-1; - return -1; - } - p_Char[i] = '='; - for (i++; i<=p_end; i++) { - chars_read = get_line (); - if (chars_read == (size_t) -1) - { - p_end = i - 1; - return -1; - } - if (!chars_read) - fatal ("unexpected end of file in patch at line %s", - format_linenum (numbuf0, p_input_line)); - if (buf[0] != '>' || (buf[1] != ' ' && buf[1] != '\t')) - fatal ("`>' expected at line %s of patch", - format_linenum (numbuf0, p_input_line)); - chars_read -= 2 + (i == p_end && incomplete_line ()); - p_len[i] = chars_read; - if (! (p_line[i] = savebuf (buf + 2, chars_read))) { - p_end = i-1; - return -1; - } - p_Char[i] = '+'; - } - } - if (rev) /* backwards patch? */ - if (!pch_swap()) - say ("Not enough memory to swap next hunk!\n"); - if (debug & 2) { - LINENUM i; - char special; - - for (i=0; i <= p_end; i++) { - if (i == p_ptrn_lines) - special = '^'; - else - special = ' '; - fprintf (stderr, "%s %c %c ", format_linenum (numbuf0, i), - p_Char[i], special); - pch_write_line (i, stderr); - fflush (stderr); - } - } - if (p_end+1 < hunkmax) /* paranoia reigns supreme... */ - p_Char[p_end+1] = '^'; /* add a stopper for apply_hunk */ - return 1; -} - -static size_t -get_line (void) -{ - return pget_line (p_indent, p_rfc934_nesting, p_strip_trailing_cr, - p_pass_comments_through); -} - -/* Input a line from the patch file, worrying about indentation. - Strip up to INDENT characters' worth of leading indentation. - Then remove up to RFC934_NESTING instances of leading "- ". - If STRIP_TRAILING_CR is true, remove any trailing carriage-return. - Unless PASS_COMMENTS_THROUGH is true, ignore any resulting lines - that begin with '#'; they're comments. - Ignore any partial lines at end of input, but warn about them. - Succeed if a line was read; it is terminated by "\n\0" for convenience. - Return the number of characters read, including '\n' but not '\0'. - Return -1 if we ran out of memory. */ - -static size_t -pget_line (int indent, int rfc934_nesting, bool strip_trailing_cr, - bool pass_comments_through) -{ - register FILE *fp = pfp; - register int c; - register int i; - register char *b; - register size_t s; - - do - { - i = 0; - for (;;) - { - c = getc (fp); - if (c == EOF) - { - if (ferror (fp)) - read_fatal (); - return 0; - } - if (indent <= i) - break; - if (c == ' ' || c == 'X') - i++; - else if (c == '\t') - i = (i + 8) & ~7; - else - break; - } - - i = 0; - b = buf; - - while (c == '-' && 0 <= --rfc934_nesting) - { - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - if (c != ' ') - { - i = 1; - b[0] = '-'; - break; - } - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - s = bufsize; - - for (;;) - { - if (i == s - 1) - { - s *= 2; - b = realloc (b, s); - if (!b) - { - if (!using_plan_a) - memory_fatal (); - return (size_t) -1; - } - buf = b; - bufsize = s; - } - b[i++] = c; - if (c == '\n') - break; - c = getc (fp); - if (c == EOF) - goto patch_ends_in_middle_of_line; - } - - p_input_line++; - } - while (*b == '#' && !pass_comments_through); - - if (strip_trailing_cr && 2 <= i && b[i - 2] == '\r') - b[i-- - 2] = '\n'; - b[i] = '\0'; - return i; - - patch_ends_in_middle_of_line: - if (ferror (fp)) - read_fatal (); - say ("patch unexpectedly ends in middle of line\n"); - return 0; -} - -static bool -incomplete_line (void) -{ - register FILE *fp = pfp; - register int c; - register file_offset line_beginning = file_tell (fp); - - if (getc (fp) == '\\') - { - while ((c = getc (fp)) != '\n' && c != EOF) - continue; - return true; - } - else - { - /* We don't trust ungetc. */ - Fseek (pfp, line_beginning, SEEK_SET); - return false; - } -} - -/* Reverse the old and new portions of the current hunk. */ - -bool -pch_swap (void) -{ - char **tp_line; /* the text of the hunk */ - size_t *tp_len; /* length of each line */ - char *tp_char; /* +, -, and ! */ - register LINENUM i; - register LINENUM n; - bool blankline = false; - register char *s; - - i = p_first; - p_first = p_newfirst; - p_newfirst = i; - - /* make a scratch copy */ - - tp_line = p_line; - tp_len = p_len; - tp_char = p_Char; - p_line = 0; /* force set_hunkmax to allocate again */ - p_len = 0; - p_Char = 0; - set_hunkmax(); - if (!p_line || !p_len || !p_Char) { - if (p_line) - free (p_line); - p_line = tp_line; - if (p_len) - free (p_len); - p_len = tp_len; - if (p_Char) - free (p_Char); - p_Char = tp_char; - return false; /* not enough memory to swap hunk! */ - } - - /* now turn the new into the old */ - - i = p_ptrn_lines + 1; - if (tp_char[i] == '\n') { /* account for possible blank line */ - blankline = true; - i++; - } - if (p_efake >= 0) { /* fix non-freeable ptr range */ - if (p_efake <= i) - n = p_end - i + 1; - else - n = -i; - p_efake += n; - p_bfake += n; - } - for (n=0; i <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '+') - p_Char[n] = '-'; - p_len[n] = tp_len[i]; - } - if (blankline) { - i = p_ptrn_lines + 1; - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - p_len[n] = tp_len[i]; - n++; - } - assert(p_Char[0] == '='); - p_Char[0] = '*'; - for (s=p_line[0]; *s; s++) - if (*s == '-') - *s = '*'; - - /* now turn the old into the new */ - - assert(tp_char[0] == '*'); - tp_char[0] = '='; - for (s=tp_line[0]; *s; s++) - if (*s == '*') - *s = '-'; - for (i=0; n <= p_end; i++,n++) { - p_line[n] = tp_line[i]; - p_Char[n] = tp_char[i]; - if (p_Char[n] == '-') - p_Char[n] = '+'; - p_len[n] = tp_len[i]; - } - assert(i == p_ptrn_lines + 1); - i = p_ptrn_lines; - p_ptrn_lines = p_repl_lines; - p_repl_lines = i; - if (tp_line) - free (tp_line); - if (tp_len) - free (tp_len); - if (tp_char) - free (tp_char); - return true; -} - -/* Return whether file WHICH (false = old, true = new) appears to nonexistent. - Return 1 for empty, 2 for nonexistent. */ - -int -pch_says_nonexistent (bool which) -{ - return p_says_nonexistent[which]; -} - -/* Return timestamp of patch header for file WHICH (false = old, true = new), - or -1 if there was no timestamp or an error in the timestamp. */ - -time_t -pch_timestamp (bool which) -{ - return p_timestamp[which]; -} - -/* Return the specified line position in the old file of the old context. */ - -LINENUM -pch_first (void) -{ - return p_first; -} - -/* Return the number of lines of old context. */ - -LINENUM -pch_ptrn_lines (void) -{ - return p_ptrn_lines; -} - -/* Return the probable line position in the new file of the first line. */ - -LINENUM -pch_newfirst (void) -{ - return p_newfirst; -} - -/* Return the number of lines in the replacement text including context. */ - -LINENUM -pch_repl_lines (void) -{ - return p_repl_lines; -} - -/* Return the number of lines in the whole hunk. */ - -LINENUM -pch_end (void) -{ - return p_end; -} - -/* Return the number of context lines before the first changed line. */ - -LINENUM -pch_prefix_context (void) -{ - return p_prefix_context; -} - -/* Return the number of context lines after the last changed line. */ - -LINENUM -pch_suffix_context (void) -{ - return p_suffix_context; -} - -/* Return the length of a particular patch line. */ - -size_t -pch_line_len (LINENUM line) -{ - return p_len[line]; -} - -/* Return the control character (+, -, *, !, etc) for a patch line. */ - -char -pch_char (LINENUM line) -{ - return p_Char[line]; -} - -/* Return a pointer to a particular patch line. */ - -char * -pfetch (LINENUM line) -{ - return p_line[line]; -} - -/* Output a patch line. */ - -bool -pch_write_line (LINENUM line, FILE *file) -{ - bool after_newline = p_line[line][p_len[line] - 1] == '\n'; - if (! fwrite (p_line[line], sizeof (*p_line[line]), p_len[line], file)) - write_fatal (); - return after_newline; -} - -/* Return where in the patch file this hunk began, for error messages. */ - -LINENUM -pch_hunk_beg (void) -{ - return p_hunk_beg; -} - -/* Is the newline-terminated line a valid `ed' command for patch - input? If so, return the command character; if not, return 0. - This accepts accepts just a subset of the valid commands, but it's - good enough in practice. */ - -static char -get_ed_command_letter (char const *line) -{ - char const *p = line; - char letter; - bool pair = false; - if (! ISDIGIT (*p)) - return 0; - while (ISDIGIT (*++p)) - continue; - if (*p == ',') - { - if (! ISDIGIT (*++p)) - return 0; - while (ISDIGIT (*++p)) - continue; - pair = true; - } - letter = *p++; - - switch (letter) - { - case 'a': - case 'i': - if (pair) - return 0; - break; - - case 'c': - case 'd': - break; - - case 's': - if (strncmp (p, "/.//", 4) != 0) - return 0; - p += 4; - break; - - default: - return 0; - } - - while (*p == ' ' || *p == '\t') - p++; - if (*p == '\n') - return letter; - return 0; -} - -/* Apply an ed script by feeding ed itself. */ - -void -do_ed_script (FILE *ofp) -{ - static char const ed_program[] = ed_PROGRAM; - - register file_offset beginning_of_this_line; - register FILE *pipefp = 0; - register size_t chars_read; - - if (! dry_run && ! skip_rest_of_patch) { - int exclusive = TMPOUTNAME_needs_removal ? 0 : O_EXCL; - assert (! inerrno); - TMPOUTNAME_needs_removal = 1; - copy_file (inname, TMPOUTNAME, exclusive, instat.st_mode); - sprintf (buf, "%s %s%s", ed_program, verbosity == VERBOSE ? "" : "- ", - TMPOUTNAME); - fflush (stdout); - pipefp = popen(buf, binary_transput ? "wb" : "w"); - if (!pipefp) - pfatal ("Can't open pipe to %s", quotearg (buf)); - } - for (;;) { - char ed_command_letter; - beginning_of_this_line = file_tell (pfp); - chars_read = get_line (); - if (! chars_read) { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - ed_command_letter = get_ed_command_letter (buf); - if (ed_command_letter) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (ed_command_letter != 'd' && ed_command_letter != 's') { - p_pass_comments_through = true; - while ((chars_read = get_line ()) != 0) { - if (pipefp) - if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) - write_fatal (); - if (chars_read == 2 && strEQ (buf, ".\n")) - break; - } - p_pass_comments_through = false; - } - } - else { - next_intuit_at(beginning_of_this_line,p_input_line); - break; - } - } - if (!pipefp) - return; - if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0 - || fflush (pipefp) != 0) - write_fatal (); - if (pclose (pipefp) != 0) - fatal ("%s FAILED", ed_program); - - if (ofp) - { - FILE *ifp = fopen (TMPOUTNAME, binary_transput ? "rb" : "r"); - int c; - if (!ifp) - pfatal ("can't open `%s'", TMPOUTNAME); - while ((c = getc (ifp)) != EOF) - if (putc (c, ofp) == EOF) - write_fatal (); - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - } -} Property changes on: vendor/misc-GNU/patch/dist/pch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/xmalloc.c =================================================================== --- vendor/misc-GNU/patch/dist/xmalloc.c (revision 358868) +++ vendor/misc-GNU/patch/dist/xmalloc.c (nonexistent) @@ -1,113 +0,0 @@ -/* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - -#if STDC_HEADERS -# include -#else -void *calloc (); -void *malloc (); -void *realloc (); -void free (); -#endif - -#include "gettext.h" -#define _(msgid) gettext (msgid) -#define N_(msgid) msgid - -#include "error.h" -#include "xalloc.h" - -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -/* The following tests require AC_PREREQ(2.54). */ - -#ifndef HAVE_MALLOC -"you must run the autoconf test for a GNU libc compatible malloc" -#endif - -#ifndef HAVE_REALLOC -"you must run the autoconf test for a GNU libc compatible realloc" -#endif - -/* Exit value when the requested amount of memory is not available. - The caller may set it to some other value. */ -int xalloc_exit_failure = EXIT_FAILURE; - -/* If non NULL, call this function when memory is exhausted. */ -void (*xalloc_fail_func) PARAMS ((void)) = 0; - -/* If XALLOC_FAIL_FUNC is NULL, or does return, display this message - before exiting when memory is exhausted. Goes through gettext. */ -char const xalloc_msg_memory_exhausted[] = N_("memory exhausted"); - -void -xalloc_die (void) -{ - if (xalloc_fail_func) - (*xalloc_fail_func) (); - error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); - /* The `noreturn' cannot be given to error, since it may return if - its first argument is 0. To help compilers understand the - xalloc_die does terminate, call exit. */ - exit (EXIT_FAILURE); -} - -/* Allocate N bytes of memory dynamically, with error checking. */ - -void * -xmalloc (size_t n) -{ - void *p; - - p = malloc (n); - if (p == 0) - xalloc_die (); - return p; -} - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. */ - -void * -xrealloc (void *p, size_t n) -{ - p = realloc (p, n); - if (p == 0) - xalloc_die (); - return p; -} - -/* Allocate memory for N elements of S bytes, with error checking. */ - -void * -xcalloc (size_t n, size_t s) -{ - void *p; - - p = calloc (n, s); - if (p == 0) - xalloc_die (); - return p; -} Property changes on: vendor/misc-GNU/patch/dist/xmalloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/INSTALL =================================================================== --- vendor/misc-GNU/patch/dist/INSTALL (revision 358868) +++ vendor/misc-GNU/patch/dist/INSTALL (nonexistent) @@ -1,228 +0,0 @@ -Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for variables by setting -them in the environment. You can do that on the command line like this: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - Property changes on: vendor/misc-GNU/patch/dist/INSTALL ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/pch.h =================================================================== --- vendor/misc-GNU/patch/dist/pch.h (revision 358868) +++ vendor/misc-GNU/patch/dist/pch.h (nonexistent) @@ -1,45 +0,0 @@ -/* reading patches */ - -/* $Id: pch.h,v 1.11 2003/05/20 13:56:03 eggert Exp $ */ - -/* Copyright (C) 1986, 1987, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -LINENUM pch_end (void); -LINENUM pch_first (void); -LINENUM pch_hunk_beg (void); -LINENUM pch_newfirst (void); -LINENUM pch_prefix_context (void); -LINENUM pch_ptrn_lines (void); -LINENUM pch_repl_lines (void); -LINENUM pch_suffix_context (void); -bool pch_swap (void); -bool pch_write_line (LINENUM, FILE *); -bool there_is_another_patch (void); -char *pfetch (LINENUM); -char pch_char (LINENUM); -int another_hunk (enum diff, bool); -int pch_says_nonexistent (bool); -size_t pch_line_len (LINENUM); -time_t pch_timestamp (bool); -void do_ed_script (FILE *); -void open_patch_file (char const *); -void re_patch (void); -void set_hunkmax (void); Property changes on: vendor/misc-GNU/patch/dist/pch.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/unlocked-io.h =================================================================== --- vendor/misc-GNU/patch/dist/unlocked-io.h (revision 358868) +++ vendor/misc-GNU/patch/dist/unlocked-io.h (nonexistent) @@ -1,90 +0,0 @@ -/* Prefer faster, non-thread-safe stdio functions if available. - - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* Written by Jim Meyering. */ - -#ifndef UNLOCKED_IO_H -# define UNLOCKED_IO_H 1 - -# ifndef USE_UNLOCKED_IO -# define USE_UNLOCKED_IO 1 -# endif - -# if USE_UNLOCKED_IO - -/* These are wrappers for functions/macros from GNU libc. - The standard I/O functions are thread-safe. These *_unlocked ones are - more efficient but not thread-safe. That they're not thread-safe is - fine since all of the applications in this package are single threaded. */ - -# if HAVE_DECL_CLEARERR_UNLOCKED -# undef clearerr -# define clearerr(x) clearerr_unlocked (x) -# endif -# if HAVE_DECL_FEOF_UNLOCKED -# undef feof -# define feof(x) feof_unlocked (x) -# endif -# if HAVE_DECL_FERROR_UNLOCKED -# undef ferror -# define ferror(x) ferror_unlocked (x) -# endif -# if HAVE_DECL_FFLUSH_UNLOCKED -# undef fflush -# define fflush(x) fflush_unlocked (x) -# endif -# if HAVE_DECL_FGETS_UNLOCKED -# undef fgets -# define fgets(x,y,z) fgets_unlocked (x,y,z) -# endif -# if HAVE_DECL_FPUTC_UNLOCKED -# undef fputc -# define fputc(x,y) fputc_unlocked (x,y) -# endif -# if HAVE_DECL_FPUTS_UNLOCKED -# undef fputs -# define fputs(x,y) fputs_unlocked (x,y) -# endif -# if HAVE_DECL_FREAD_UNLOCKED -# undef fread -# define fread(w,x,y,z) fread_unlocked (w,x,y,z) -# endif -# if HAVE_DECL_FWRITE_UNLOCKED -# undef fwrite -# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) -# endif -# if HAVE_DECL_GETC_UNLOCKED -# undef getc -# define getc(x) getc_unlocked (x) -# endif -# if HAVE_DECL_GETCHAR_UNLOCKED -# undef getchar -# define getchar() getchar_unlocked () -# endif -# if HAVE_DECL_PUTC_UNLOCKED -# undef putc -# define putc(x,y) putc_unlocked (x,y) -# endif -# if HAVE_DECL_PUTCHAR_UNLOCKED -# undef putchar -# define putchar(x) putchar_unlocked (x) -# endif - -# endif /* USE_UNLOCKED_IO */ -#endif /* UNLOCKED_IO_H */ Property changes on: vendor/misc-GNU/patch/dist/unlocked-io.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/basename.c =================================================================== --- vendor/misc-GNU/patch/dist/basename.c (revision 358868) +++ vendor/misc-GNU/patch/dist/basename.c (nonexistent) @@ -1,79 +0,0 @@ -/* basename.c -- return the last element in a path - Copyright (C) 1990, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#endif -#include "dirname.h" - -/* In general, we can't use the builtin `basename' function if available, - since it has different meanings in different environments. - In some environments the builtin `basename' modifies its argument. - - Return the address of the last file name component of NAME. If - NAME has no file name components because it is all slashes, return - NAME if it is empty, the address of its last slash otherwise. */ - -char * -base_name (char const *name) -{ - char const *base = name + FILESYSTEM_PREFIX_LEN (name); - char const *p; - - for (p = base; *p; p++) - { - if (ISSLASH (*p)) - { - /* Treat multiple adjacent slashes like a single slash. */ - do p++; - while (ISSLASH (*p)); - - /* If the file name ends in slash, use the trailing slash as - the basename if no non-slashes have been found. */ - if (! *p) - { - if (ISSLASH (*base)) - base = p - 1; - break; - } - - /* *P is a non-slash preceded by a slash. */ - base = p; - } - } - - return (char *) base; -} - -/* Return the length of of the basename NAME. Typically NAME is the - value returned by base_name. Act like strlen (NAME), except omit - redundant trailing slashes. */ - -size_t -base_len (char const *name) -{ - size_t len; - - for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) - continue; - - return len; -} Property changes on: vendor/misc-GNU/patch/dist/basename.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/config.hin =================================================================== --- vendor/misc-GNU/patch/dist/config.hin (revision 358868) +++ vendor/misc-GNU/patch/dist/config.hin (nonexistent) @@ -1,365 +0,0 @@ -/* config.hin. Generated from configure.ac by autoheader. */ - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define if there is a member named d_ino in the struct describing directory - headers. */ -#undef D_INO_IN_DIRENT - -/* Define on systems for which file names may have a so-called `drive letter' - prefix, define this to compute the length of that prefix, including the - colon. */ -#undef FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX - -/* Define if the backslash character may also serve as a file name component - separator. */ -#undef FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR - -#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif - -/* Define to 1 if you have the header file. */ -#undef HAVE_BP_SYM_H - -/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_CLEARERR_UNLOCKED - -/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_FEOF_UNLOCKED - -/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FERROR_UNLOCKED - -/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FFLUSH_UNLOCKED - -/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FGETS_UNLOCKED - -/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FPUTC_UNLOCKED - -/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FPUTS_UNLOCKED - -/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FREAD_UNLOCKED - -/* Define to 1 if you have the declaration of `free', and to 0 if you don't. - */ -#undef HAVE_DECL_FREE - -/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_FWRITE_UNLOCKED - -/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_GETCHAR_UNLOCKED - -/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_GETC_UNLOCKED - -/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. - */ -#undef HAVE_DECL_GETENV - -/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. - */ -#undef HAVE_DECL_MALLOC - -/* Define to 1 if you have the declaration of `mktemp', and to 0 if you don't. - */ -#undef HAVE_DECL_MKTEMP - -/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if - you don't. */ -#undef HAVE_DECL_PUTCHAR_UNLOCKED - -/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you - don't. */ -#undef HAVE_DECL_PUTC_UNLOCKED - -/* Define to 1 if you have the declaration of `strerror', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `getuid' function. */ -#undef HAVE_GETUID - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `isascii' function. */ -#undef HAVE_ISASCII - -/* Define to 1 if you have the `iswprint' function. */ -#undef HAVE_ISWPRINT - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you support file names longer than 14 characters. */ -#undef HAVE_LONG_FILE_NAMES - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ -#undef HAVE_MBRTOWC - -/* Define to 1 if you have the `mbsinit' function. */ -#undef HAVE_MBSINIT - -/* Define to 1 if declares mbstate_t. */ -#undef HAVE_MBSTATE_T - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memcmp' function. */ -#undef HAVE_MEMCMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have the `mktemp' function. */ -#undef HAVE_MKTEMP - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `pathconf' function. */ -#undef HAVE_PATHCONF - -/* Define to 1 if you have the `raise' function. */ -#undef HAVE_RAISE - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the DOS-style `setmode' function. */ -#undef HAVE_SETMODE_DOS - -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if you have the `sigprocmask' function. */ -#undef HAVE_SIGPROCMASK - -/* Define to 1 if you have the `sigsetmask' function. */ -#undef HAVE_SIGSETMASK - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strncasecmp' function. */ -#undef HAVE_STRNCASECMP - -/* Define if struct utimbuf is declared -- usually in . Some systems - have utime.h but don't declare the struct anywhere. */ -#undef HAVE_STRUCT_UTIMBUF - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VARARGS_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCTYPE_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if you have the `_doprintf' function. */ -#undef HAVE__DOPRINTF - -#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif - -/* Define if mkdir takes only one argument. */ -#undef MKDIR_TAKES_ONE_ARG - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to a type if does not define. */ -#undef mbstate_t - -/* Define to `int' if does not define. */ -#undef mode_t - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `unsigned' if does not define. */ -#undef size_t Index: vendor/misc-GNU/patch/dist/configure.ac =================================================================== --- vendor/misc-GNU/patch/dist/configure.ac (revision 358868) +++ vendor/misc-GNU/patch/dist/configure.ac (nonexistent) @@ -1,95 +0,0 @@ -# Configure `patch'. - -# Copyright (C) 1993, 1997, 1998, 1999, 2002, 2003 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_PREREQ(2.57) -AC_INIT(patch, 2.5.9, bug-patch@gnu.org) -AC_CONFIG_SRCDIR(patch.c) -AC_CONFIG_HEADER(config.h:config.hin) -AC_ARG_PROGRAM - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_MAKE_SET -# Use ed_PROGRAM, not ED_PROGRAM, -# because reserves symbols starting with `E'. -AC_PATH_PROG(ed_PROGRAM, ed, ed) - -AC_GNU_SOURCE -AC_AIX -AC_MINIX -AC_PROG_CC_STDC -AC_ISC_POSIX -AC_SYS_LARGEFILE -AC_EXEEXT - -AC_C_PROTOTYPES -AC_C_CONST - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h string.h unistd.h utime.h varargs.h) - -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIGNAL -AC_TYPE_SIZE_T -AM_STDBOOL_H -jm_CHECK_TYPE_STRUCT_UTIMBUF - -gl_BACKUPFILE -gl_DIRNAME -gl_ERROR -gl_FUNC_MEMCHR -gl_FUNC_RMDIR -gl_GETOPT -gl_PREREQ_XMALLOC -gl_QUOTE -gl_QUOTEARG - -dnl This should be in gnulib, but isn't for some reason. -AC_DEFUN([jm_PREREQ_ADDEXT], -[ - dnl For addext.c. - AC_REQUIRE([AC_SYS_LONG_FILE_NAMES]) - AC_CHECK_FUNCS(pathconf) - AC_CHECK_HEADERS(limits.h string.h unistd.h) -]) -jm_PREREQ_ADDEXT - -AC_CHECK_DECLS([free, getenv, malloc, mktemp]) -AC_CHECK_FUNCS(_doprintf geteuid getuid isascii memcmp mktemp \ - pathconf raise sigaction sigprocmask sigsetmask strerror) -AC_REPLACE_FUNCS(mkdir strncasecmp) -AC_FUNC_FSEEKO -jm_FUNC_GLIBC_UNLOCKED_IO -jm_FUNC_MALLOC -jm_FUNC_REALLOC -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_SETMODE_DOS -AC_FUNC_VPRINTF -PATCH_FUNC_MKDIR_TAKES_ONE_ARG - -jm_AC_DOS -AC_SYS_LONG_FILE_NAMES - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT Index: vendor/misc-GNU/patch/dist/version.c =================================================================== --- vendor/misc-GNU/patch/dist/version.c (revision 358868) +++ vendor/misc-GNU/patch/dist/version.c (nonexistent) @@ -1,29 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.c,v 1.13 2003/05/18 08:25:17 eggert Exp $ */ - -#define XTERN extern -#include -#undef XTERN -#define XTERN -#include - -static char const copyright_string[] = "\ -Copyright (C) 1988 Larry Wall\n\ -Copyright (C) 2003 Free Software Foundation, Inc."; - -static char const free_software_msgid[] = "\ -This program comes with NO WARRANTY, to the extent permitted by law.\n\ -You may redistribute copies of this program\n\ -under the terms of the GNU General Public License.\n\ -For more information about these matters, see the file named COPYING."; - -static char const authorship_msgid[] = "\ -written by Larry Wall and Paul Eggert"; - -void -version (void) -{ - printf ("%s %s\n%s\n\n%s\n\n%s\n", PACKAGE_NAME, PACKAGE_VERSION, - copyright_string, free_software_msgid, authorship_msgid); -} Property changes on: vendor/misc-GNU/patch/dist/version.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/dirname.c =================================================================== --- vendor/misc-GNU/patch/dist/dirname.c (revision 358868) +++ vendor/misc-GNU/patch/dist/dirname.c (nonexistent) @@ -1,121 +0,0 @@ -/* dirname.c -- return all but the last element in a path - Copyright 1990, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#endif - -#include "dirname.h" -#include "xalloc.h" - -/* Return the length of `dirname (PATH)', or zero if PATH is - in the working directory. Works properly even if - there are trailing slashes (by effectively ignoring them). */ -size_t -dir_len (char const *path) -{ - size_t prefix_length = FILESYSTEM_PREFIX_LEN (path); - size_t length; - - /* Strip the basename and any redundant slashes before it. */ - for (length = base_name (path) - path; prefix_length < length; length--) - if (! ISSLASH (path[length - 1])) - return length; - - /* But don't strip the only slash from "/". */ - return prefix_length + ISSLASH (path[prefix_length]); -} - -/* Return the leading directories part of PATH, - allocated with xmalloc. - Works properly even if there are trailing slashes - (by effectively ignoring them). */ - -char * -dir_name (char const *path) -{ - size_t length = dir_len (path); - int append_dot = (length == FILESYSTEM_PREFIX_LEN (path)); - char *newpath = xmalloc (length + append_dot + 1); - memcpy (newpath, path, length); - if (append_dot) - newpath[length++] = '.'; - newpath[length] = 0; - return newpath; -} - -#ifdef TEST_DIRNAME -/* - -Run the test like this (expect no output): - gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \ - basename.c dirname.c xmalloc.c error.c - sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out - -If it's been built on a DOS or Windows platforms, run another test like -this (again, expect no output): - sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out - -BEGIN-DATA -foo//// . -bar/foo//// bar -foo/ . -/ / -. . -a . -END-DATA - -BEGIN-DOS-DATA -c:///// c:/ -c:/ c:/ -c:/. c:/ -c:foo c:. -c:foo/bar c:foo -END-DOS-DATA - -*/ - -# define MAX_BUFF_LEN 1024 -# include - -char *program_name; - -int -main (int argc, char *argv[]) -{ - char buff[MAX_BUFF_LEN + 1]; - - program_name = argv[0]; - - buff[MAX_BUFF_LEN] = 0; - while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0]) - { - char path[MAX_BUFF_LEN]; - char expected_result[MAX_BUFF_LEN]; - char const *result; - sscanf (buff, "%s %s", path, expected_result); - result = dir_name (path); - if (strcmp (result, expected_result)) - printf ("%s: got %s, expected %s\n", path, result, expected_result); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/dist/dirname.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/version.h =================================================================== --- vendor/misc-GNU/patch/dist/version.h (revision 358868) +++ vendor/misc-GNU/patch/dist/version.h (nonexistent) @@ -1,5 +0,0 @@ -/* Print the version number. */ - -/* $Id: version.h,v 1.5 2002/05/28 07:24:05 eggert Exp $ */ - -void version (void); Property changes on: vendor/misc-GNU/patch/dist/version.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quotearg.c =================================================================== --- vendor/misc-GNU/patch/dist/quotearg.c (revision 358868) +++ vendor/misc-GNU/patch/dist/quotearg.c (nonexistent) @@ -1,630 +0,0 @@ -/* quotearg.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include "quotearg.h" - -#include "xalloc.h" - -#include -#include -#include -#include -#include - -#include "gettext.h" -#define _(msgid) gettext (msgid) -#define N_(msgid) msgid - -#if HAVE_WCHAR_H - -/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */ -# include -# include - -# include -#endif - -#if !HAVE_MBRTOWC -/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the - other macros are defined only for documentation and to satisfy C - syntax. */ -# undef MB_CUR_MAX -# define MB_CUR_MAX 1 -# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) -# define iswprint(wc) isprint ((unsigned char) (wc)) -# undef HAVE_MBSINIT -#endif - -#if !defined mbsinit && !HAVE_MBSINIT -# define mbsinit(ps) 1 -#endif - -#ifndef iswprint -# if HAVE_WCTYPE_H -# include -# endif -# if !defined iswprint && !HAVE_ISWPRINT -# define iswprint(wc) 1 -# endif -#endif - -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif - -#define INT_BITS (sizeof (int) * CHAR_BIT) - -struct quoting_options -{ - /* Basic quoting style. */ - enum quoting_style style; - - /* Quote the characters indicated by this bit vector even if the - quoting style would not normally require them to be quoted. */ - int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; -}; - -/* Names of quoting styles. */ -char const *const quoting_style_args[] = -{ - "literal", - "shell", - "shell-always", - "c", - "escape", - "locale", - "clocale", - 0 -}; - -/* Correspondences to quoting style names. */ -enum quoting_style const quoting_style_vals[] = -{ - literal_quoting_style, - shell_quoting_style, - shell_always_quoting_style, - c_quoting_style, - escape_quoting_style, - locale_quoting_style, - clocale_quoting_style -}; - -/* The default quoting options. */ -static struct quoting_options default_quoting_options; - -/* Allocate a new set of quoting options, with contents initially identical - to O if O is not null, or to the default if O is null. - It is the caller's responsibility to free the result. */ -struct quoting_options * -clone_quoting_options (struct quoting_options *o) -{ - int e = errno; - struct quoting_options *p = xmalloc (sizeof *p); - *p = *(o ? o : &default_quoting_options); - errno = e; - return p; -} - -/* Get the value of O's quoting style. If O is null, use the default. */ -enum quoting_style -get_quoting_style (struct quoting_options *o) -{ - return (o ? o : &default_quoting_options)->style; -} - -/* In O (or in the default if O is null), - set the value of the quoting style to S. */ -void -set_quoting_style (struct quoting_options *o, enum quoting_style s) -{ - (o ? o : &default_quoting_options)->style = s; -} - -/* In O (or in the default if O is null), - set the value of the quoting options for character C to I. - Return the old value. Currently, the only values defined for I are - 0 (the default) and 1 (which means to quote the character even if - it would not otherwise be quoted). */ -int -set_char_quoting (struct quoting_options *o, char c, int i) -{ - unsigned char uc = c; - int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; - int shift = uc % INT_BITS; - int r = (*p >> shift) & 1; - *p ^= ((i & 1) ^ r) << shift; - return r; -} - -/* MSGID approximates a quotation mark. Return its translation if it - has one; otherwise, return either it or "\"", depending on S. */ -static char const * -gettext_quote (char const *msgid, enum quoting_style s) -{ - char const *translation = _(msgid); - if (translation == msgid && s == clocale_quoting_style) - translation = "\""; - return translation; -} - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using QUOTING_STYLE and the - non-quoting-style part of O to control quoting. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. - - This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG, - ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting - style specified by O, and O may not be null. */ - -static size_t -quotearg_buffer_restyled (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - enum quoting_style quoting_style, - struct quoting_options const *o) -{ - size_t i; - size_t len = 0; - char const *quote_string = 0; - size_t quote_string_len = 0; - int backslash_escapes = 0; - int unibyte_locale = MB_CUR_MAX == 1; - -#define STORE(c) \ - do \ - { \ - if (len < buffersize) \ - buffer[len] = (c); \ - len++; \ - } \ - while (0) - - switch (quoting_style) - { - case c_quoting_style: - STORE ('"'); - backslash_escapes = 1; - quote_string = "\""; - quote_string_len = 1; - break; - - case escape_quoting_style: - backslash_escapes = 1; - break; - - case locale_quoting_style: - case clocale_quoting_style: - { - /* Get translations for open and closing quotation marks. - - The message catalog should translate "`" to a left - quotation mark suitable for the locale, and similarly for - "'". If the catalog has no translation, - locale_quoting_style quotes `like this', and - clocale_quoting_style quotes "like this". - - For example, an American English Unicode locale should - translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and - should translate "'" to U+201D (RIGHT DOUBLE QUOTATION - MARK). A British English Unicode locale should instead - translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and - U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. */ - - char const *left = gettext_quote (N_("`"), quoting_style); - char const *right = gettext_quote (N_("'"), quoting_style); - for (quote_string = left; *quote_string; quote_string++) - STORE (*quote_string); - backslash_escapes = 1; - quote_string = right; - quote_string_len = strlen (quote_string); - } - break; - - case shell_always_quoting_style: - STORE ('\''); - quote_string = "'"; - quote_string_len = 1; - break; - - default: - break; - } - - for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) - { - unsigned char c; - unsigned char esc; - - if (backslash_escapes - && quote_string_len - && i + quote_string_len <= argsize - && memcmp (arg + i, quote_string, quote_string_len) == 0) - STORE ('\\'); - - c = arg[i]; - switch (c) - { - case '\0': - if (backslash_escapes) - { - STORE ('\\'); - STORE ('0'); - STORE ('0'); - c = '0'; - } - break; - - case '?': - switch (quoting_style) - { - case shell_quoting_style: - goto use_shell_always_quoting_style; - - case c_quoting_style: - if (i + 2 < argsize && arg[i + 1] == '?') - switch (arg[i + 2]) - { - case '!': case '\'': - case '(': case ')': case '-': case '/': - case '<': case '=': case '>': - /* Escape the second '?' in what would otherwise be - a trigraph. */ - c = arg[i + 2]; - i += 2; - STORE ('?'); - STORE ('\\'); - STORE ('?'); - break; - } - break; - - default: - break; - } - break; - - case '\a': esc = 'a'; goto c_escape; - case '\b': esc = 'b'; goto c_escape; - case '\f': esc = 'f'; goto c_escape; - case '\n': esc = 'n'; goto c_and_shell_escape; - case '\r': esc = 'r'; goto c_and_shell_escape; - case '\t': esc = 't'; goto c_and_shell_escape; - case '\v': esc = 'v'; goto c_escape; - case '\\': esc = c; goto c_and_shell_escape; - - c_and_shell_escape: - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; - c_escape: - if (backslash_escapes) - { - c = esc; - goto store_escape; - } - break; - - case '#': case '~': - if (i != 0) - break; - /* Fall through. */ - case ' ': - case '!': /* special in bash */ - case '"': case '$': case '&': - case '(': case ')': case '*': case ';': - case '<': case '>': case '[': - case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */ - case '`': case '|': - /* A shell special character. In theory, '$' and '`' could - be the first bytes of multibyte characters, which means - we should check them with mbrtowc, but in practice this - doesn't happen so it's not worth worrying about. */ - if (quoting_style == shell_quoting_style) - goto use_shell_always_quoting_style; - break; - - case '\'': - switch (quoting_style) - { - case shell_quoting_style: - goto use_shell_always_quoting_style; - - case shell_always_quoting_style: - STORE ('\''); - STORE ('\\'); - STORE ('\''); - break; - - default: - break; - } - break; - - case '%': case '+': case ',': case '-': case '.': case '/': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': case ':': case '=': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': case ']': case '_': case 'a': case 'b': - case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': - case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': - case 'o': case 'p': case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': - case '{': case '}': - /* These characters don't cause problems, no matter what the - quoting style is. They cannot start multibyte sequences. */ - break; - - default: - /* If we have a multibyte sequence, copy it until we reach - its end, find an error, or come back to the initial shift - state. For C-like styles, if the sequence has - unprintable characters, escape the whole sequence, since - we can't easily escape single characters within it. */ - { - /* Length of multibyte sequence found so far. */ - size_t m; - - int printable; - - if (unibyte_locale) - { - m = 1; - printable = isprint (c); - } - else - { - mbstate_t mbstate; - memset (&mbstate, 0, sizeof mbstate); - - m = 0; - printable = 1; - if (argsize == SIZE_MAX) - argsize = strlen (arg); - - do - { - wchar_t w; - size_t bytes = mbrtowc (&w, &arg[i + m], - argsize - (i + m), &mbstate); - if (bytes == 0) - break; - else if (bytes == (size_t) -1) - { - printable = 0; - break; - } - else if (bytes == (size_t) -2) - { - printable = 0; - while (i + m < argsize && arg[i + m]) - m++; - break; - } - else - { - if (! iswprint (w)) - printable = 0; - m += bytes; - } - } - while (! mbsinit (&mbstate)); - } - - if (1 < m || (backslash_escapes && ! printable)) - { - /* Output a multibyte sequence, or an escaped - unprintable unibyte character. */ - size_t ilim = i + m; - - for (;;) - { - if (backslash_escapes && ! printable) - { - STORE ('\\'); - STORE ('0' + (c >> 6)); - STORE ('0' + ((c >> 3) & 7)); - c = '0' + (c & 7); - } - if (ilim <= i + 1) - break; - STORE (c); - c = arg[++i]; - } - - goto store_c; - } - } - } - - if (! (backslash_escapes - && o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) - goto store_c; - - store_escape: - STORE ('\\'); - - store_c: - STORE (c); - } - - if (quote_string) - for (; *quote_string; quote_string++) - STORE (*quote_string); - - if (len < buffersize) - buffer[len] = '\0'; - return len; - - use_shell_always_quoting_style: - return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - shell_always_quoting_style, o); -} - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using O to control quoting. - If O is null, use the default. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ -size_t -quotearg_buffer (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - struct quoting_options const *o) -{ - struct quoting_options const *p = o ? o : &default_quoting_options; - int e = errno; - size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize, - p->style, p); - errno = e; - return r; -} - -/* Use storage slot N to return a quoted version of argument ARG. - ARG is of size ARGSIZE, but if that is -1, ARG is a null-terminated string. - OPTIONS specifies the quoting options. - The returned value points to static storage that can be - reused by the next call to this function with the same value of N. - N must be nonnegative. N is deliberately declared with type "int" - to allow for future extensions (using negative values). */ -static char * -quotearg_n_options (int n, char const *arg, size_t argsize, - struct quoting_options const *options) -{ - int e = errno; - - /* Preallocate a slot 0 buffer, so that the caller can always quote - one small component of a "memory exhausted" message in slot 0. */ - static char slot0[256]; - static unsigned int nslots = 1; - unsigned int n0 = n; - struct slotvec - { - size_t size; - char *val; - }; - static struct slotvec slotvec0 = {sizeof slot0, slot0}; - static struct slotvec *slotvec = &slotvec0; - - if (n < 0) - abort (); - - if (nslots <= n0) - { - unsigned int n1 = n0 + 1; - size_t s = n1 * sizeof *slotvec; - - if (SIZE_MAX / UINT_MAX <= sizeof *slotvec - && n1 != s / sizeof *slotvec) - xalloc_die (); - - if (slotvec == &slotvec0) - { - slotvec = xmalloc (sizeof *slotvec); - *slotvec = slotvec0; - } - slotvec = xrealloc (slotvec, s); - memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec); - nslots = n1; - } - - { - size_t size = slotvec[n].size; - char *val = slotvec[n].val; - size_t qsize = quotearg_buffer (val, size, arg, argsize, options); - - if (size <= qsize) - { - slotvec[n].size = size = qsize + 1; - slotvec[n].val = val = xrealloc (val == slot0 ? 0 : val, size); - quotearg_buffer (val, size, arg, argsize, options); - } - - errno = e; - return val; - } -} - -char * -quotearg_n (int n, char const *arg) -{ - return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options); -} - -char * -quotearg (char const *arg) -{ - return quotearg_n (0, arg); -} - -/* Return quoting options for STYLE, with no extra quoting. */ -static struct quoting_options -quoting_options_from_style (enum quoting_style style) -{ - struct quoting_options o; - o.style = style; - memset (o.quote_these_too, 0, sizeof o.quote_these_too); - return o; -} - -char * -quotearg_n_style (int n, enum quoting_style s, char const *arg) -{ - struct quoting_options const o = quoting_options_from_style (s); - return quotearg_n_options (n, arg, SIZE_MAX, &o); -} - -char * -quotearg_n_style_mem (int n, enum quoting_style s, - char const *arg, size_t argsize) -{ - struct quoting_options const o = quoting_options_from_style (s); - return quotearg_n_options (n, arg, argsize, &o); -} - -char * -quotearg_style (enum quoting_style s, char const *arg) -{ - return quotearg_n_style (0, s, arg); -} - -char * -quotearg_char (char const *arg, char ch) -{ - struct quoting_options options; - options = default_quoting_options; - set_char_quoting (&options, ch, 1); - return quotearg_n_options (0, arg, SIZE_MAX, &options); -} - -char * -quotearg_colon (char const *arg) -{ - return quotearg_char (arg, ':'); -} Property changes on: vendor/misc-GNU/patch/dist/quotearg.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/dirname.h =================================================================== --- vendor/misc-GNU/patch/dist/dirname.h (revision 358868) +++ vendor/misc-GNU/patch/dist/dirname.h (nonexistent) @@ -1,47 +0,0 @@ -/* Copyright (C) 1998, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef DIRNAME_H_ -# define DIRNAME_H_ 1 - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -# ifndef DIRECTORY_SEPARATOR -# define DIRECTORY_SEPARATOR '/' -# endif - -# ifndef ISSLASH -# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) -# endif - -# ifndef FILESYSTEM_PREFIX_LEN -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -# endif - -char *base_name PARAMS ((char const *path)); -char *dir_name PARAMS ((char const *path)); -size_t base_len PARAMS ((char const *path)); -size_t dir_len PARAMS ((char const *path)); - -int strip_trailing_slashes PARAMS ((char *path)); - -#endif /* not DIRNAME_H_ */ Property changes on: vendor/misc-GNU/patch/dist/dirname.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quotesys.c =================================================================== --- vendor/misc-GNU/patch/dist/quotesys.c (revision 358868) +++ vendor/misc-GNU/patch/dist/quotesys.c (nonexistent) @@ -1,125 +0,0 @@ -/* Shell command argument quoting. - Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -/* Place into QUOTED a quoted version of ARG suitable for `system'. - Return the length of the resulting string (which is not null-terminated). - If QUOTED is null, return the length without any side effects. */ - -size_t -quote_system_arg (quoted, arg) - char *quoted; - char const *arg; -{ - char const *a; - size_t len = 0; - - /* Scan ARG, copying it to QUOTED if QUOTED is not null, - looking for shell metacharacters. */ - - for (a = arg; ; a++) - { - char c = *a; - switch (c) - { - case 0: - /* ARG has no shell metacharacters. */ - return len; - - case '=': - if (*arg == '-') - break; - /* Fall through. */ - case '\t': case '\n': case ' ': - case '!': case '"': case '#': case '$': case '%': case '&': case '\'': - case '(': case ')': case '*': case ';': - case '<': case '>': case '?': case '[': case '\\': - case '^': case '`': case '|': case '~': - { - /* ARG has a shell metacharacter. - Start over, quoting it this time. */ - - len = 0; - c = *arg++; - - /* If ARG is an option, quote just its argument. - This is not necessary, but it looks nicer. */ - if (c == '-' && arg < a) - { - c = *arg++; - - if (quoted) - { - quoted[len] = '-'; - quoted[len + 1] = c; - } - len += 2; - - if (c == '-') - while (arg < a) - { - c = *arg++; - if (quoted) - quoted[len] = c; - len++; - if (c == '=') - break; - } - c = *arg++; - } - - if (quoted) - quoted[len] = '\''; - len++; - - for (; c; c = *arg++) - { - if (c == '\'') - { - if (quoted) - { - quoted[len] = '\''; - quoted[len + 1] = '\\'; - quoted[len + 2] = '\''; - } - len += 3; - } - if (quoted) - quoted[len] = c; - len++; - } - - if (quoted) - quoted[len] = '\''; - return len + 1; - } - } - - if (quoted) - quoted[len] = c; - len++; - } -} Property changes on: vendor/misc-GNU/patch/dist/quotesys.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quotearg.h =================================================================== --- vendor/misc-GNU/patch/dist/quotearg.h (revision 358868) +++ vendor/misc-GNU/patch/dist/quotearg.h (nonexistent) @@ -1,114 +0,0 @@ -/* quotearg.h - quote arguments for output - - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#ifndef QUOTEARG_H_ -# define QUOTEARG_H_ 1 - -# include - -/* Basic quoting styles. */ -enum quoting_style - { - literal_quoting_style, /* --quoting-style=literal */ - shell_quoting_style, /* --quoting-style=shell */ - shell_always_quoting_style, /* --quoting-style=shell-always */ - c_quoting_style, /* --quoting-style=c */ - escape_quoting_style, /* --quoting-style=escape */ - locale_quoting_style, /* --quoting-style=locale */ - clocale_quoting_style /* --quoting-style=clocale */ - }; - -/* For now, --quoting-style=literal is the default, but this may change. */ -# ifndef DEFAULT_QUOTING_STYLE -# define DEFAULT_QUOTING_STYLE literal_quoting_style -# endif - -/* Names of quoting styles and their corresponding values. */ -extern char const *const quoting_style_args[]; -extern enum quoting_style const quoting_style_vals[]; - -struct quoting_options; - -/* The functions listed below set and use a hidden variable - that contains the default quoting style options. */ - -/* Allocate a new set of quoting options, with contents initially identical - to O if O is not null, or to the default if O is null. - It is the caller's responsibility to free the result. */ -struct quoting_options *clone_quoting_options (struct quoting_options *o); - -/* Get the value of O's quoting style. If O is null, use the default. */ -enum quoting_style get_quoting_style (struct quoting_options *o); - -/* In O (or in the default if O is null), - set the value of the quoting style to S. */ -void set_quoting_style (struct quoting_options *o, enum quoting_style s); - -/* In O (or in the default if O is null), - set the value of the quoting options for character C to I. - Return the old value. Currently, the only values defined for I are - 0 (the default) and 1 (which means to quote the character even if - it would not otherwise be quoted). */ -int set_char_quoting (struct quoting_options *o, char c, int i); - -/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of - argument ARG (of size ARGSIZE), using O to control quoting. - If O is null, use the default. - Terminate the output with a null character, and return the written - size of the output, not counting the terminating null. - If BUFFERSIZE is too small to store the output string, return the - value that would have been returned had BUFFERSIZE been large enough. - If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ -size_t quotearg_buffer (char *buffer, size_t buffersize, - char const *arg, size_t argsize, - struct quoting_options const *o); - -/* Use storage slot N to return a quoted version of the string ARG. - Use the default quoting options. - The returned value points to static storage that can be - reused by the next call to this function with the same value of N. - N must be nonnegative. */ -char *quotearg_n (int n, char const *arg); - -/* Equivalent to quotearg_n (0, ARG). */ -char *quotearg (char const *arg); - -/* Use style S and storage slot N to return a quoted version of the string ARG. - This is like quotearg_n (N, ARG), except that it uses S with no other - options to specify the quoting method. */ -char *quotearg_n_style (int n, enum quoting_style s, char const *arg); - -/* Use style S and storage slot N to return a quoted version of the - argument ARG of size ARGSIZE. This is like quotearg_n_style - (N, S, ARG), except it can quote null bytes. */ -char *quotearg_n_style_mem (int n, enum quoting_style s, - char const *arg, size_t argsize); - -/* Equivalent to quotearg_n_style (0, S, ARG). */ -char *quotearg_style (enum quoting_style s, char const *arg); - -/* Like quotearg (ARG), except also quote any instances of CH. */ -char *quotearg_char (char const *arg, char ch); - -/* Equivalent to quotearg_char (ARG, ':'). */ -char *quotearg_colon (char const *arg); - -#endif /* !QUOTEARG_H_ */ Property changes on: vendor/misc-GNU/patch/dist/quotearg.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/maketime.c =================================================================== --- vendor/misc-GNU/patch/dist/maketime.c (revision 358868) +++ vendor/misc-GNU/patch/dist/maketime.c (nonexistent) @@ -1,501 +0,0 @@ -/* Convert struct partime into time_t. */ - -/* Copyright 1992, 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -/* For maximum portability, use only localtime and gmtime. - Make no assumptions about the time_t epoch or the range of time_t values. - Avoid mktime because it's not universal and because there's no easy, - portable way for mktime to yield the inverse of gmtime. */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif - /* MIPS RISCOS4.52 defines time_t in not . */ -# include -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#include -#include - -char const maket_id[] = - "$Id: maketime.c,v 5.17 1999/08/29 11:12:37 eggert Exp $"; - -static int isleap P ((int)); -static int month_days P ((struct tm const *)); -static time_t maketime P ((struct partime const *, time_t)); - -/* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow. - Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1. - Then this yields nonzero if overflow occurred during the addition. - Overflow occurs if A and B have the same sign, but A and SUM differ in sign. - Use `^' to test whether signs differ, and `< 0' to isolate the sign. */ -#define overflow_sum_sign(a, b, sum) ((~((a) ^ (b)) & ((a) ^ (sum))) < 0) - -/* Quotient and remainder when dividing A by B, - truncating towards minus infinity, where B is positive. */ -#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0)) -#define MOD(a, b) ((a) % (b) + (b) * ((a) % (b) < 0)) - -/* Number of days in 400 consecutive Gregorian years. */ -#define Y400_DAYS (365 * 400L + 100 - 4 + 1) - -/* Number of years to add to tm_year to get Gregorian year. */ -#define TM_YEAR_ORIGIN 1900 - -static int -isleap (y) - int y; -{ - return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); -} - -/* days in year before start of months 0-12 */ -static int const month_yday[] = -{ - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 -}; - -/* Yield the number of days in TM's month. */ -static int -month_days (tm) - struct tm const *tm; -{ - int m = tm->tm_mon; - return (month_yday[m + 1] - month_yday[m] - + (m == 1 && isleap (tm->tm_year + TM_YEAR_ORIGIN))); -} - -/* Convert UNIXTIME to struct tm form. - Use gmtime if available and if !LOCALZONE, localtime otherwise. */ -struct tm * -time2tm (unixtime, localzone) - time_t unixtime; - int localzone; -{ - struct tm *tm; -#ifdef TZ_is_unset - static char const *TZ; - if (!TZ && !(TZ = getenv ("TZ"))) - TZ_is_unset ("The TZ environment variable is not set; please set it to your timezone"); -#endif - if (localzone || !(tm = gmtime (&unixtime))) - tm = localtime (&unixtime); - return tm; -} - -/* Yield A - B, measured in seconds. */ -time_t -difftm (a, b) - struct tm const *a; - struct tm const *b; -{ - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); - int ac = DIV (ay, 100); - int bc = DIV (by, 100); - int difference_in_day_of_year = a->tm_yday - b->tm_yday; - int intervening_leap_days = (((ay >> 2) - (by >> 2)) - - (ac - bc) - + ((ac >> 2) - (bc >> 2))); - time_t difference_in_years = ay - by; - time_t difference_in_days - = (difference_in_years * 365 - + (intervening_leap_days + difference_in_day_of_year)); - return (((((difference_in_days * 24 - + (a->tm_hour - b->tm_hour)) - * 60) - + (a->tm_min - b->tm_min)) - * 60) - + (a->tm_sec - b->tm_sec)); -} - -/* Adjust time T by adding SECONDS. - The absolute value of SECONDS cannot exceed 59 * INT_MAX, - and also cannot exceed one month's worth of seconds; - this is enough to handle any POSIX or real-life daylight-saving offset. - Adjust only T's year, mon, mday, hour, min and sec members; - plus adjust wday if it is defined. */ -void -adjzone (t, seconds) - register struct tm *t; - long seconds; -{ - int days = 0; - - /* This code can be off by a second if SECONDS is not a multiple of 60, - if T is local time, and if a leap second happens during this minute. - But this bug has never occurred, and most likely will not ever occur. - Liberia, the last country for which SECONDS % 60 was nonzero, - switched to UTC in May 1972; the first leap second was in June 1972. */ - int leap_second = t->tm_sec == 60; - long sec = seconds + (t->tm_sec - leap_second); - if (sec < 0) - { - if ((t->tm_min -= (59 - sec) / 60) < 0 - && (t->tm_hour -= (59 - t->tm_min) / 60) < 0) - { - days = - ((23 - t->tm_hour) / 24); - if ((t->tm_mday += days) <= 0) - { - if (--t->tm_mon < 0) - { - --t->tm_year; - t->tm_mon = 11; - } - t->tm_mday += month_days (t); - } - } - } - else - { - if (60 <= (t->tm_min += sec / 60) - && (24 <= (t->tm_hour += t->tm_min / 60))) - { - days = t->tm_hour / 24; - if (month_days (t) < (t->tm_mday += days)) - { - if (11 < ++t->tm_mon) - { - ++t->tm_year; - t->tm_mon = 0; - } - t->tm_mday = 1; - } - } - } - if (TM_DEFINED (t->tm_wday)) - t->tm_wday = MOD (t->tm_wday + days, 7); - t->tm_hour = MOD (t->tm_hour, 24); - t->tm_min = MOD (t->tm_min, 60); - t->tm_sec = (int) MOD (sec, 60) + leap_second; -} - -/* Convert TM to time_t, using localtime if LOCALZONE and gmtime otherwise. - Use only TM's year, mon, mday, hour, min, and sec members. - Ignore TM's old tm_yday and tm_wday, but fill in their correct values. - Yield -1 on failure (e.g. a member out of range). - POSIX 1003.1 doesn't allow leap seconds, but some implementations - have them anyway, so allow them if localtime/gmtime does. */ -time_t -tm2time (tm, localzone) - struct tm *tm; - int localzone; -{ - /* Cache the most recent t,tm pairs; 1 for gmtime, 1 for localtime. */ - static time_t t_cache[2]; - static struct tm tm_cache[2]; - - time_t d, gt; - struct tm const *gtm; - /* The maximum number of iterations should be enough to handle any - combinations of leap seconds, time zone rule changes, and solar time. - 4 is probably enough; we use a bigger number just to be safe. */ - int remaining_tries = 8; - - /* Avoid subscript errors. */ - if (12 <= (unsigned) tm->tm_mon) - return -1; - - tm->tm_yday = month_yday[tm->tm_mon] + tm->tm_mday - - (tm->tm_mon < 2 || !isleap (tm->tm_year + TM_YEAR_ORIGIN)); - - /* Make a first guess. */ - gt = t_cache[localzone]; - gtm = gt ? &tm_cache[localzone] : time2tm (gt, localzone); - - /* Repeatedly use the error from the guess to improve the guess. */ - while ((d = difftm (tm, gtm)) != 0) - { - if (--remaining_tries == 0) - return -1; - gt += d; - gtm = time2tm (gt, localzone); - } - - /* Check that the guess actually matches; - overflow can cause difftm to yield 0 even on differing times, - or tm may have members out of range (e.g. bad leap seconds). */ -#define TM_DIFFER(a,b) \ - ( \ - ((a)->tm_year ^ (b)->tm_year) | \ - ((a)->tm_mon ^ (b)->tm_mon) | \ - ((a)->tm_mday ^ (b)->tm_mday) | \ - ((a)->tm_hour ^ (b)->tm_hour) | \ - ((a)->tm_min ^ (b)->tm_min) | \ - ((a)->tm_sec ^ (b)->tm_sec) \ - ) - if (TM_DIFFER (tm, gtm)) - { - /* If gt is a leap second, try gt+1; if it is one greater than - a leap second, try gt-1; otherwise, it doesn't matter. - Leap seconds always fall at month end. */ - int yd = tm->tm_year - gtm->tm_year; - gt += yd + (yd ? 0 : tm->tm_mon - gtm->tm_mon); - gtm = time2tm (gt, localzone); - if (TM_DIFFER (tm, gtm)) - return -1; - } - t_cache[localzone] = gt; - tm_cache[localzone] = *gtm; - - tm->tm_wday = gtm->tm_wday; - return gt; -} - -/* Check *PT and convert it to time_t. - If it is incompletely specified, use DEFAULT_TIME to fill it out. - Use localtime if PT->zone is the special value TM_LOCAL_ZONE. - Yield -1 on failure. - ISO 8601 day-of-year and week numbers are not yet supported. */ -static time_t -maketime (pt, default_time) - struct partime const *pt; - time_t default_time; -{ - int localzone, wday, year; - struct tm tm; - struct tm *tm0 = 0; - time_t r; - int use_ordinal_day; - - tm0 = 0; /* Keep gcc -Wall happy. */ - localzone = pt->zone == TM_LOCAL_ZONE; - - tm = pt->tm; - year = tm.tm_year; - wday = tm.tm_wday; - use_ordinal_day = (!TM_DEFINED (tm.tm_mday) - && TM_DEFINED (wday) && TM_DEFINED (pt->wday_ordinal)); - - if (use_ordinal_day || TM_DEFINED (pt->ymodulus) || !TM_DEFINED (year)) - { - /* Get tm corresponding to default time. */ - tm0 = time2tm (default_time, localzone); - if (!localzone) - adjzone (tm0, pt->zone); - } - - if (use_ordinal_day) - tm.tm_mday = (tm0->tm_mday - + ((wday - tm0->tm_wday + 7) % 7 - + 7 * (pt->wday_ordinal - (pt->wday_ordinal != 0)))); - - if (TM_DEFINED (pt->ymodulus)) - { - /* Yield a year closest to the default that has the given modulus. */ - int year0 = tm0->tm_year + TM_YEAR_ORIGIN; - int y0 = MOD (year0, pt->ymodulus); - int d = 2 * (year - y0); - year += (((year0 - y0) / pt->ymodulus - + (pt->ymodulus < d ? -1 : d < -pt->ymodulus)) - * pt->ymodulus); - } - else if (!TM_DEFINED (year)) - { - /* Set default year, month, day from current time. */ - year = tm0->tm_year + TM_YEAR_ORIGIN; - if (!TM_DEFINED (tm.tm_mon)) - { - tm.tm_mon = tm0->tm_mon; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = tm0->tm_mday; - } - } - - /* Set remaining default fields to be their minimum values. */ - if (!TM_DEFINED (tm.tm_mon)) - tm.tm_mon = 0; - if (!TM_DEFINED (tm.tm_mday)) - tm.tm_mday = 1; - if (!TM_DEFINED (tm.tm_hour)) - tm.tm_hour = 0; - if (!TM_DEFINED (tm.tm_min)) - tm.tm_min = 0; - if (!TM_DEFINED (tm.tm_sec)) - tm.tm_sec = 0; - - tm.tm_year = year - TM_YEAR_ORIGIN; - if ((year < tm.tm_year) != (TM_YEAR_ORIGIN < 0)) - return -1; - - if (!localzone) - { - adjzone (&tm, -pt->zone); - wday = tm.tm_wday; - } - - /* Convert and fill in the rest of the tm. */ - r = tm2time (&tm, localzone); - if (r == -1) - return r; - - /* Check weekday. */ - if (TM_DEFINED (wday) && wday != tm.tm_wday) - return -1; - - /* Add relative time, except for seconds. - We handle seconds separately, at the end, - so that leap seconds are handled properly. */ - if (pt->tmr.tm_year | pt->tmr.tm_mon | pt->tmr.tm_mday - | pt->tmr.tm_hour | pt->tmr.tm_min) - { - int years = tm.tm_year + pt->tmr.tm_year; - int mons = tm.tm_mon + pt->tmr.tm_mon; - int mdays = tm.tm_mday + pt->tmr.tm_mday; - int hours = tm.tm_hour + pt->tmr.tm_hour; - int mins = tm.tm_min + pt->tmr.tm_min; - - int carried_hours = DIV (mins, 60); - int hours1 = hours + carried_hours; - int carried_days = DIV (hours1, 24); - int mdays1 = mdays + carried_days; - - int mon0 = MOD (mons, 12); - int carried_years0 = DIV (mons, 12); - int year0 = years + carried_years0; - int yday0 = (month_yday[mon0] - - (mon0 < 2 || !isleap (year0 + TM_YEAR_ORIGIN))); - - int yday1 = yday0 + mdays1; - int carried_years1 = DIV (yday1, Y400_DAYS) * 400; - int year1 = year0 + carried_years1; - int yday2 = MOD (yday1, Y400_DAYS); - int leap; - - if (overflow_sum_sign (tm.tm_year, pt->tmr.tm_year, years) - | overflow_sum_sign (tm.tm_mon, pt->tmr.tm_mon, mons) - | overflow_sum_sign (tm.tm_mday, pt->tmr.tm_mday, mdays) - | overflow_sum_sign (tm.tm_hour, pt->tmr.tm_hour, hours) - | overflow_sum_sign (tm.tm_min, pt->tmr.tm_min, mins) - | overflow_sum_sign (hours, carried_hours, hours1) - | overflow_sum_sign (mdays, carried_days, mdays1) - | overflow_sum_sign (years, carried_years0, year0) - | overflow_sum_sign (yday0, mdays1, yday1) - | overflow_sum_sign (year0, carried_years1, year1)) - return -1; - - for (;;) - { - int days_per_year = 365 + (leap = isleap (year1 + TM_YEAR_ORIGIN)); - if (yday2 < days_per_year) - break; - yday2 -= days_per_year; - year1++; - } - - tm.tm_year = year1; - - { - int mon; - for (mon = 11; - (tm.tm_mday = (yday2 - month_yday[mon] + (mon < 2 || !leap))) <= 0; - mon--) - continue; - tm.tm_mon = mon; - } - - tm.tm_hour = MOD (hours1, 24); - tm.tm_min = MOD (mins, 60); - - r = tm2time (&tm, localzone); - if (r == -1) - return r; - } - - /* Add the seconds' part of relative time. */ - { - time_t rs = r + pt->tmr.tm_sec; - if ((pt->tmr.tm_sec < 0) != (rs < r)) - return -1; - return rs; - } -} - -/* Parse a free-format date in *SOURCE, yielding a Unix format time. - Update *SOURCE to point to the first character after the date. - If *SOURCE is missing some information, take defaults from - DEFAULT_TIME and DEFAULT_ZONE. *SOURCE may even be the empty - string or an immediately invalid string, in which case the default - time and zone is used. - Return (time_t) -1 if the time is invalid or cannot be represented. */ -time_t -str2time (source, default_time, default_zone) - char const **source; - time_t default_time; - long default_zone; -{ - struct partime pt; - - *source = partime (*source, &pt); - if (pt.zone == TM_UNDEFINED_ZONE) - pt.zone = default_zone; - return maketime (&pt, default_time); -} - -#ifdef TEST -#include -int -main (argc, argv) - int argc; - char **argv; -{ - time_t default_time = time ((time_t *) 0); - long default_zone = argv[1] ? atol (argv[1]) : TM_LOCAL_ZONE; - char buf[1000]; - while (fgets (buf, sizeof (buf), stdin)) - { - char const *p = buf; - time_t t = str2time (&p, default_time, default_zone); - printf ("`%.*s' -> %s", - (int) (p - buf - (p[0] == '\0' && p[-1] == '\n')), buf, - asctime ((argv[1] ? gmtime : localtime) (&t))); - } - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/dist/maketime.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quote.c =================================================================== --- vendor/misc-GNU/patch/dist/quote.c (revision 358868) +++ vendor/misc-GNU/patch/dist/quote.c (nonexistent) @@ -1,45 +0,0 @@ -/* quote.c - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#if HAVE_STDDEF_H -# include /* For the definition of size_t on windows w/MSVC. */ -#endif -#include -#include "quotearg.h" -#include "quote.h" - -/* Return an unambiguous printable representation of NAME, - allocated in slot N, suitable for diagnostics. */ -char const * -quote_n (int n, char const *name) -{ - return quotearg_n_style (n, locale_quoting_style, name); -} - -/* Return an unambiguous printable representation of NAME, - suitable for diagnostics. */ -char const * -quote (char const *name) -{ - return quote_n (0, name); -} Property changes on: vendor/misc-GNU/patch/dist/quote.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quotesys.h =================================================================== --- vendor/misc-GNU/patch/dist/quotesys.h (revision 358868) +++ vendor/misc-GNU/patch/dist/quotesys.h (nonexistent) @@ -1,9 +0,0 @@ -/* quotesys.h -- declarations for quoting system arguments */ - -#if defined __STDC__ || __GNUC__ -# define __QUOTESYS_P(args) args -#else -# define __QUOTESYS_P(args) () -#endif - -size_t quote_system_arg __QUOTESYS_P ((char *, char const *)); Property changes on: vendor/misc-GNU/patch/dist/quotesys.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/common.h =================================================================== --- vendor/misc-GNU/patch/dist/common.h (revision 358868) +++ vendor/misc-GNU/patch/dist/common.h (nonexistent) @@ -1,297 +0,0 @@ -/* common definitions for `patch' */ - -/* $Id: common.h,v 1.34 2003/05/19 06:57:36 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - - Copyright (C) 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef DEBUGGING -#define DEBUGGING 1 -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#if ! defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if ! defined S_ISREG && defined S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#ifndef S_IXOTH -#define S_IXOTH 1 -#endif -#ifndef S_IWOTH -#define S_IWOTH 2 -#endif -#ifndef S_IROTH -#define S_IROTH 4 -#endif -#ifndef S_IXGRP -#define S_IXGRP (S_IXOTH << 3) -#endif -#ifndef S_IWGRP -#define S_IWGRP (S_IWOTH << 3) -#endif -#ifndef S_IRGRP -#define S_IRGRP (S_IROTH << 3) -#endif -#ifndef S_IXUSR -#define S_IXUSR (S_IXOTH << 6) -#endif -#ifndef S_IWUSR -#define S_IWUSR (S_IWOTH << 6) -#endif -#ifndef S_IRUSR -#define S_IRUSR (S_IROTH << 6) -#endif -#ifdef MKDIR_TAKES_ONE_ARG -# define mkdir(name, mode) ((mkdir) (name)) -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif -/* The extra casts work around common compiler bugs, - e.g. Cray C 5.0.3.0 time_t. */ -#define TYPE_SIGNED(t) ((t) -1 < (t) 0) -#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ - ? (t) (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) \ - : (t) 0)) -#define TYPE_MAXIMUM(t) ((t) ((t) ~ (t) 0 - TYPE_MINIMUM (t))) -#ifndef CHAR_MAX -#define CHAR_MAX TYPE_MAXIMUM (char) -#endif -#ifndef INT_MAX -#define INT_MAX TYPE_MAXIMUM (int) -#endif -#ifndef LONG_MIN -#define LONG_MIN TYPE_MINIMUM (long) -#endif - -#if HAVE_INTTYPES_H -# include -#endif -#ifndef SIZE_MAX -/* On some nonstandard hosts, size_t is signed, - so SIZE_MAX != (size_t) -1. */ -#define SIZE_MAX TYPE_MAXIMUM (size_t) -#endif - -#include -/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to macros like `isspace'. */ -#if STDC_HEADERS -#define CTYPE_DOMAIN(c) 1 -#else -#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#ifndef ISSPACE -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#endif - -#ifndef ISDIGIT -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#endif - - -/* handy definitions */ - -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) - -/* typedefs */ - -typedef off_t LINENUM; /* must be signed */ - -/* globals */ - -XTERN char *program_name; /* The name this program was run with. */ - -XTERN char *buf; /* general purpose buffer */ -XTERN size_t bufsize; /* allocated size of buf */ - -XTERN bool using_plan_a; /* try to keep everything in memory */ - -XTERN char *inname; -XTERN char *outfile; -XTERN int inerrno; -XTERN int invc; -XTERN struct stat instat; -XTERN bool dry_run; -XTERN bool posixly_correct; - -XTERN char const *origprae; -XTERN char const *origbase; - -XTERN char const * volatile TMPINNAME; -XTERN char const * volatile TMPOUTNAME; -XTERN char const * volatile TMPPATNAME; - -XTERN int volatile TMPINNAME_needs_removal; -XTERN int volatile TMPOUTNAME_needs_removal; -XTERN int volatile TMPPATNAME_needs_removal; - -#ifdef DEBUGGING -XTERN int debug; -#else -# define debug 0 -#endif -XTERN bool force; -XTERN bool batch; -XTERN bool noreverse; -XTERN bool reverse; -XTERN enum { DEFAULT_VERBOSITY, SILENT, VERBOSE } verbosity; -XTERN bool skip_rest_of_patch; -XTERN int strippath; -XTERN bool canonicalize; -XTERN int patch_get; -XTERN bool set_time; -XTERN bool set_utc; - -enum diff - { - NO_DIFF, - CONTEXT_DIFF, - NORMAL_DIFF, - ED_DIFF, - NEW_CONTEXT_DIFF, - UNI_DIFF - }; - -XTERN enum diff diff_type; - -XTERN char *revision; /* prerequisite revision, if any */ - -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ -# define __attribute__(x) -#endif - -void fatal_exit (int) __attribute__ ((noreturn)); - -#include -#if !STDC_HEADERS && !defined errno -extern int errno; -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -#else -# if !HAVE_MEMCHR -# define memcmp(s1, s2, n) bcmp (s1, s2, n) -# define memcpy(d, s, n) bcopy (s, d, n) -void *memchr (); -# endif -#endif - -#if STDC_HEADERS -# include -#else -char *getenv (); -void *malloc (); -void *realloc (); -#endif - -#if HAVE_UNISTD_H -# include -#else -# ifndef lseek - off_t lseek (); -# endif -#endif -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif -#if HAVE_FSEEKO - typedef off_t file_offset; -# define file_seek fseeko -# define file_tell ftello -#else - typedef long file_offset; -# define file_seek fseek -# define file_tell ftell -#endif -#if ! (HAVE_GETEUID || defined geteuid) -# if ! (HAVE_GETUID || defined getuid) -# define geteuid() (-1) -# else -# define geteuid() getuid () -# endif -#endif - -#if HAVE_FCNTL_H -# include -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif -#ifndef O_WRONLY -#define O_WRONLY 1 -#endif -#ifndef O_RDWR -#define O_RDWR 2 -#endif -#ifndef _O_BINARY -#define _O_BINARY 0 -#endif -#ifndef O_BINARY -#define O_BINARY _O_BINARY -#endif -#ifndef O_CREAT -#define O_CREAT 0 -#endif -#ifndef O_EXCL -#define O_EXCL 0 -#endif -#ifndef O_TRUNC -#define O_TRUNC 0 -#endif - -#if HAVE_SETMODE_DOS - XTERN int binary_transput; /* O_BINARY if binary i/o is desired */ -#else -# define binary_transput 0 -#endif - -#ifndef NULL_DEVICE -#define NULL_DEVICE "/dev/null" -#endif - -#ifndef TTY_DEVICE -#define TTY_DEVICE "/dev/tty" -#endif Property changes on: vendor/misc-GNU/patch/dist/common.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/error.c =================================================================== --- vendor/misc-GNU/patch/dist/error.c (revision 358868) +++ vendor/misc-GNU/patch/dist/error.c (nonexistent) @@ -1,407 +0,0 @@ -/* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000, 2001, 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef _LIBC -# include -#else -# include "gettext.h" -#endif - -#ifdef _LIBC -# include -# define mbsrtowcs __mbsrtowcs -#endif - -#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC -# if __STDC__ -# include -# define VA_START(args, lastarg) va_start(args, lastarg) -# else -# include -# define VA_START(args, lastarg) va_start(args) -# endif -#else -# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 -# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; -#endif - -#if STDC_HEADERS || _LIBC -# include -# include -#else -void exit (); -#endif - -#include "error.h" - -#if !_LIBC -# include "unlocked-io.h" -#endif - -#ifndef _ -# define _(String) String -#endif - -/* If NULL, error will flush stdout, then print on stderr the program - name, a colon and a space. Otherwise, error will call this - function without parameters instead. */ -void (*error_print_progname) ( -#if __STDC__ - 0 - void -#endif - ); - -/* This variable is incremented each time `error' is called. */ -unsigned int error_message_count; - -#ifdef _LIBC -/* In the GNU C library, there is a predefined variable for this. */ - -# define program_name program_invocation_name -# include -# include - -/* In GNU libc we want do not want to use the common name `error' directly. - Instead make it a weak alias. */ -extern void __error (int status, int errnum, const char *message, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); -extern void __error_at_line (int status, int errnum, const char *file_name, - unsigned int line_number, const char *message, - ...) - __attribute__ ((__format__ (__printf__, 5, 6)));; -# define error __error -# define error_at_line __error_at_line - -# ifdef USE_IN_LIBIO -# include -# define fflush(s) INTUSE(_IO_fflush) (s) -# undef putc -# define putc(c, fp) INTUSE(_IO_putc) (c, fp) -# endif - -#else /* not _LIBC */ - -# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P -# ifndef HAVE_DECL_STRERROR_R -"this configure-time declaration test was not run" -# endif -char *strerror_r (); -# endif - -/* The calling program should define program_name and set it to the - name of the executing program. */ -extern char *program_name; - -# if HAVE_STRERROR_R || defined strerror_r -# define __strerror_r strerror_r -# else -# if HAVE_STRERROR -# ifndef HAVE_DECL_STRERROR -"this configure-time declaration test was not run" -# endif -# if !HAVE_DECL_STRERROR -char *strerror (); -# endif -# else -static char * -private_strerror (int errnum) -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum > 0 && errnum <= sys_nerr) - return _(sys_errlist[errnum]); - return _("Unknown system error"); -} -# define strerror private_strerror -# endif /* HAVE_STRERROR */ -# endif /* HAVE_STRERROR_R || defined strerror_r */ -#endif /* not _LIBC */ - -static void -print_errno_message (int errnum) -{ - char const *s; - -#if defined HAVE_STRERROR_R || _LIBC - char errbuf[1024]; -# if STRERROR_R_CHAR_P || _LIBC - s = __strerror_r (errnum, errbuf, sizeof errbuf); -# else - if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) - s = errbuf; - else - s = 0; -# endif -#else - s = strerror (errnum); -#endif - -#if !_LIBC - if (! s) - s = _("Unknown system error"); -#endif - -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - { - __fwprintf (stderr, L": %s", s); - return; - } -#endif - - fprintf (stderr, ": %s", s); -} - -#ifdef VA_START -static void -error_tail (int status, int errnum, const char *message, va_list args) -{ -# if HAVE_VPRINTF || _LIBC -# if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - { -# define ALLOCA_LIMIT 2000 - size_t len = strlen (message) + 1; - wchar_t *wmessage = NULL; - mbstate_t st; - size_t res; - const char *tmp; - - do - { - if (len < ALLOCA_LIMIT) - wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); - else - { - if (wmessage != NULL && len / 2 < ALLOCA_LIMIT) - wmessage = NULL; - - wmessage = (wchar_t *) realloc (wmessage, - len * sizeof (wchar_t)); - - if (wmessage == NULL) - { - fputws_unlocked (L"out of memory\n", stderr); - return; - } - } - - memset (&st, '\0', sizeof (st)); - tmp =message; - } - while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len); - - if (res == (size_t) -1) - /* The string cannot be converted. */ - wmessage = (wchar_t *) L"???"; - - __vfwprintf (stderr, wmessage, args); - } - else -# endif - vfprintf (stderr, message, args); -# else - _doprnt (message, args, stderr); -# endif - va_end (args); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); -# if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - putwc (L'\n', stderr); - else -# endif - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -} -#endif - - -/* Print the program name and error message MESSAGE, which is a printf-style - format string with optional args. - If ERRNUM is nonzero, print its corresponding system error message. - Exit with status STATUS if it is nonzero. */ -/* VARARGS */ -void -#if defined VA_START && __STDC__ -error (int status, int errnum, const char *message, ...) -#else -error (status, errnum, message, va_alist) - int status; - int errnum; - char *message; - va_dcl -#endif -{ -#ifdef VA_START - va_list args; -#endif - - fflush (stdout); -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif -#endif - if (error_print_progname) - (*error_print_progname) (); - else - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s: ", program_name); - else -#endif - fprintf (stderr, "%s: ", program_name); - } - -#ifdef VA_START - VA_START (args, message); - error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif - -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_funlockfile (stderr); -# else - __funlockfile (stderr); -# endif -#endif -} - -/* Sometimes we want to have at most one error per line. This - variable controls whether this mode is selected or not. */ -int error_one_per_line; - -void -#if defined VA_START && __STDC__ -error_at_line (int status, int errnum, const char *file_name, - unsigned int line_number, const char *message, ...) -#else -error_at_line (status, errnum, file_name, line_number, message, va_alist) - int status; - int errnum; - const char *file_name; - unsigned int line_number; - char *message; - va_dcl -#endif -{ -#ifdef VA_START - va_list args; -#endif - - if (error_one_per_line) - { - static const char *old_file_name; - static unsigned int old_line_number; - - if (old_line_number == line_number - && (file_name == old_file_name - || strcmp (old_file_name, file_name) == 0)) - /* Simply return and print nothing. */ - return; - - old_file_name = file_name; - old_line_number = line_number; - } - - fflush (stdout); -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif -#endif - if (error_print_progname) - (*error_print_progname) (); - else - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s: ", program_name); - else -#endif - fprintf (stderr, "%s:", program_name); - } - - if (file_name != NULL) - { -#if _LIBC && USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s:%d: ", file_name, line_number); - else -#endif - fprintf (stderr, "%s:%d: ", file_name, line_number); - } - -#ifdef VA_START - VA_START (args, message); - error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif - -#ifdef _LIBC -# ifdef USE_IN_LIBIO - _IO_funlockfile (stderr); -# else - __funlockfile (stderr); -# endif -#endif -} - -#ifdef _LIBC -/* Make the weak alias. */ -# undef error -# undef error_at_line -weak_alias (__error, error) -weak_alias (__error_at_line, error_at_line) -#endif Property changes on: vendor/misc-GNU/patch/dist/error.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/memchr.c =================================================================== --- vendor/misc-GNU/patch/dist/memchr.c (revision 358868) +++ vendor/misc-GNU/patch/dist/memchr.c (nonexistent) @@ -1,216 +0,0 @@ -/* Copyright (C) 1991,93,96,97,99,2000 Free Software Foundation, Inc. - Based on strlen implementation by Torbjorn Granlund (tege@sics.se), - with help from Dan Sahlin (dan@sics.se) and - commentary by Jim Blandy (jimb@ai.mit.edu); - adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), - and implemented by Roland McGrath (roland@ai.mit.edu). - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#undef __ptr_t -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -# define __ptr_t void * -#else /* Not C++ or ANSI C. */ -# define __ptr_t char * -#endif /* C++ or ANSI C. */ - -#if defined _LIBC -# include -# include -#else -# define reg_char char -#endif - -#if HAVE_STDLIB_H || defined _LIBC -# include -#endif - -#if HAVE_LIMITS_H || defined _LIBC -# include -#endif - -#define LONG_MAX_32_BITS 2147483647 - -#ifndef LONG_MAX -# define LONG_MAX LONG_MAX_32_BITS -#endif - -#include -#if HAVE_BP_SYM_H || defined _LIBC -# include -#else -# define BP_SYM(sym) sym -#endif - -#undef memchr -#undef __memchr - -/* Search no more than N bytes of S for C. */ -__ptr_t -__memchr (s, c_in, n) - const __ptr_t s; - int c_in; - size_t n; -{ - const unsigned char *char_ptr; - const unsigned long int *longword_ptr; - unsigned long int longword, magic_bits, charmask; - unsigned reg_char c; - - c = (unsigned char) c_in; - - /* Handle the first few characters by reading one character at a time. - Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = (const unsigned char *) s; - n > 0 && ((unsigned long int) char_ptr - & (sizeof (longword) - 1)) != 0; - --n, ++char_ptr) - if (*char_ptr == c) - return (__ptr_t) char_ptr; - - /* All these elucidatory comments refer to 4-byte longwords, - but the theory applies equally well to 8-byte longwords. */ - - longword_ptr = (unsigned long int *) char_ptr; - - /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits - the "holes." Note that there is a hole just to the left of - each byte, with an extra at the end: - - bits: 01111110 11111110 11111110 11111111 - bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD - - The 1-bits make sure that carries propagate to the next 0-bit. - The 0-bits provide holes for carries to fall into. */ - - if (sizeof (longword) != 4 && sizeof (longword) != 8) - abort (); - -#if LONG_MAX <= LONG_MAX_32_BITS - magic_bits = 0x7efefeff; -#else - magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; -#endif - - /* Set up a longword, each of whose bytes is C. */ - charmask = c | (c << 8); - charmask |= charmask << 16; -#if LONG_MAX > LONG_MAX_32_BITS - charmask |= charmask << 32; -#endif - - /* Instead of the traditional loop which tests each character, - we will test a longword at a time. The tricky part is testing - if *any of the four* bytes in the longword in question are zero. */ - while (n >= sizeof (longword)) - { - /* We tentatively exit the loop if adding MAGIC_BITS to - LONGWORD fails to change any of the hole bits of LONGWORD. - - 1) Is this safe? Will it catch all the zero bytes? - Suppose there is a byte with all zeros. Any carry bits - propagating from its left will fall into the hole at its - least significant bit and stop. Since there will be no - carry from its most significant bit, the LSB of the - byte to the left will be unchanged, and the zero will be - detected. - - 2) Is this worthwhile? Will it ignore everything except - zero bytes? Suppose every byte of LONGWORD has a bit set - somewhere. There will be a carry into bit 8. If bit 8 - is set, this will carry into bit 16. If bit 8 is clear, - one of bits 9-15 must be set, so there will be a carry - into bit 16. Similarly, there will be a carry into bit - 24. If one of bits 24-30 is set, there will be a carry - into bit 31, so all of the hole bits will be changed. - - The one misfire occurs when bits 24-30 are clear and bit - 31 is set; in this case, the hole at bit 31 is not - changed. If we had access to the processor carry flag, - we could close this loophole by putting the fourth hole - at bit 32! - - So it ignores everything except 128's, when they're aligned - properly. - - 3) But wait! Aren't we looking for C, not zero? - Good point. So what we do is XOR LONGWORD with a longword, - each of whose bytes is C. This turns each byte that is C - into a zero. */ - - longword = *longword_ptr++ ^ charmask; - - /* Add MAGIC_BITS to LONGWORD. */ - if ((((longword + magic_bits) - - /* Set those bits that were unchanged by the addition. */ - ^ ~longword) - - /* Look at only the hole bits. If any of the hole bits - are unchanged, most likely one of the bytes was a - zero. */ - & ~magic_bits) != 0) - { - /* Which of the bytes was C? If none of them were, it was - a misfire; continue the search. */ - - const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); - - if (cp[0] == c) - return (__ptr_t) cp; - if (cp[1] == c) - return (__ptr_t) &cp[1]; - if (cp[2] == c) - return (__ptr_t) &cp[2]; - if (cp[3] == c) - return (__ptr_t) &cp[3]; -#if LONG_MAX > 2147483647 - if (cp[4] == c) - return (__ptr_t) &cp[4]; - if (cp[5] == c) - return (__ptr_t) &cp[5]; - if (cp[6] == c) - return (__ptr_t) &cp[6]; - if (cp[7] == c) - return (__ptr_t) &cp[7]; -#endif - } - - n -= sizeof (longword); - } - - char_ptr = (const unsigned char *) longword_ptr; - - while (n-- > 0) - { - if (*char_ptr == c) - return (__ptr_t) char_ptr; - else - ++char_ptr; - } - - return 0; -} -#ifdef weak_alias -weak_alias (__memchr, BP_SYM (memchr)) -#endif Property changes on: vendor/misc-GNU/patch/dist/memchr.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/addext.c =================================================================== --- vendor/misc-GNU/patch/dist/addext.c (revision 358868) +++ vendor/misc-GNU/patch/dist/addext.c (nonexistent) @@ -1,120 +0,0 @@ -/* addext.c -- add an extension to a file name - - Copyright (C) 1990, 1997, 1998, 1999, 2001, 2003 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie and Paul Eggert */ - -#if HAVE_CONFIG_H -# include -#endif - -#ifndef HAVE_DOS_FILE_NAMES -# define HAVE_DOS_FILE_NAMES 0 -#endif -#ifndef HAVE_LONG_FILE_NAMES -# define HAVE_LONG_FILE_NAMES 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef _POSIX_NAME_MAX -# define _POSIX_NAME_MAX 14 -#endif - -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - -#include -#ifndef errno -extern int errno; -#endif - -#include "backupfile.h" -#include "dirname.h" - -/* Append to FILENAME the extension EXT, unless the result would be too long, - in which case just append the character E. */ - -void -addext (char *filename, char const *ext, int e) -{ - char *s = base_name (filename); - size_t slen = base_len (s); - size_t extlen = strlen (ext); - size_t slen_max = HAVE_LONG_FILE_NAMES ? 255 : _POSIX_NAME_MAX; - -#if HAVE_PATHCONF && defined _PC_NAME_MAX - if (_POSIX_NAME_MAX < slen + extlen || HAVE_DOS_FILE_NAMES) - { - /* The new base name is long enough to require a pathconf check. */ - long name_max; - errno = 0; - if (s == filename) - name_max = pathconf (".", _PC_NAME_MAX); - else - { - char c = *s; - if (! ISSLASH (c)) - *s = 0; - name_max = pathconf (filename, _PC_NAME_MAX); - *s = c; - } - if (0 <= name_max || errno == 0) - { - long size = slen_max = name_max; - if (name_max != size) - slen_max = -1; - } - } -#endif - - if (HAVE_DOS_FILE_NAMES && slen_max <= 12) - { - /* Live within DOS's 8.3 limit. */ - char *dot = strchr (s, '.'); - if (dot) - { - slen -= dot + 1 - s; - s = dot + 1; - slen_max = 3; - } - else - slen_max = 8; - extlen = 9; /* Don't use EXT. */ - } - - if (slen + extlen <= slen_max) - strcpy (s + slen, ext); - else - { - if (slen_max <= slen) - slen = slen_max - 1; - s[slen] = e; - s[slen + 1] = 0; - } -} Property changes on: vendor/misc-GNU/patch/dist/addext.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/maketime.h =================================================================== --- vendor/misc-GNU/patch/dist/maketime.h (revision 358868) +++ vendor/misc-GNU/patch/dist/maketime.h (nonexistent) @@ -1,39 +0,0 @@ -/* Yield time_t from struct partime yielded by partime. */ - -/* Copyright 1993, 1994, 1995 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if defined __STDC__ || has_prototypes -# define __MAKETIME_P(x) x -#else -# define __MAKETIME_P(x) () -#endif - -struct tm *time2tm __MAKETIME_P ((time_t, int)); -time_t difftm __MAKETIME_P ((struct tm const *, struct tm const *)); -time_t str2time __MAKETIME_P ((char const **, time_t, long)); -time_t tm2time __MAKETIME_P ((struct tm *, int)); -void adjzone __MAKETIME_P ((struct tm *, long)); Property changes on: vendor/misc-GNU/patch/dist/maketime.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/quote.h =================================================================== --- vendor/misc-GNU/patch/dist/quote.h (revision 358868) +++ vendor/misc-GNU/patch/dist/quote.h (nonexistent) @@ -1,28 +0,0 @@ -/* quote.h - prototypes for quote.c - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - -char const *quote_n PARAMS ((int n, char const *name)); -char const *quote PARAMS ((char const *name)); Property changes on: vendor/misc-GNU/patch/dist/quote.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/patch.c =================================================================== --- vendor/misc-GNU/patch/dist/patch.c (revision 358868) +++ vendor/misc-GNU/patch/dist/patch.c (nonexistent) @@ -1,1369 +0,0 @@ -/* patch - a program to apply diffs to original files */ - -/* $Id: patch.c,v 1.44 2003/05/20 13:55:03 eggert Exp $ */ - -/* Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall - - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2002, - 2003 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN -#include -#undef XTERN -#define XTERN extern -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_UTIME_H -# include -#endif -/* Some nonstandard hosts don't declare this structure even in . */ -#if ! HAVE_STRUCT_UTIMBUF -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif - -/* Output stream state. */ -struct outstate -{ - FILE *ofp; - bool after_newline; - bool zero_output; -}; - -/* procedures */ - -static FILE *create_output_file (char const *, int); -static LINENUM locate_hunk (LINENUM); -static bool apply_hunk (struct outstate *, LINENUM); -static bool copy_till (struct outstate *, LINENUM); -static bool patch_match (LINENUM, LINENUM, LINENUM, LINENUM); -static bool similar (char const *, size_t, char const *, size_t); -static bool spew_output (struct outstate *); -static char const *make_temp (char); -static int numeric_string (char const *, bool, char const *); -static void abort_hunk (void); -static void cleanup (void); -static void get_some_switches (void); -static void init_output (char const *, int, struct outstate *); -static void init_reject (void); -static void reinitialize_almost_everything (void); -static void remove_if_needed (char const *, int volatile *); -static void usage (FILE *, int) __attribute__((noreturn)); - -static bool make_backups; -static bool backup_if_mismatch; -static char const *version_control; -static char const *version_control_context; -static bool remove_empty_files; - -/* true if -R was specified on command line. */ -static bool reverse_flag_specified; - -/* how many input lines have been irretractably output */ -static LINENUM last_frozen_line; - -static char const *do_defines; /* symbol to patch using ifdef, ifndef, etc. */ -static char const if_defined[] = "\n#ifdef %s\n"; -static char const not_defined[] = "\n#ifndef %s\n"; -static char const else_defined[] = "\n#else\n"; -static char const end_defined[] = "\n#endif\n"; - -static int Argc; -static char * const *Argv; - -static FILE *rejfp; /* reject file pointer */ - -static char const *patchname; -static char *rejname; -static char const * volatile TMPREJNAME; -static int volatile TMPREJNAME_needs_removal; - -static LINENUM last_offset; -static LINENUM maxfuzz = 2; - -static char serrbuf[BUFSIZ]; - -/* Apply a set of diffs as appropriate. */ - -int -main (int argc, char **argv) -{ - char const *val; - bool somefailed = false; - struct outstate outstate; - char numbuf[LINENUM_LENGTH_BOUND + 1]; - - xalloc_exit_failure = 2; - program_name = argv[0]; - init_time (); - - setbuf(stderr, serrbuf); - - xalloc_fail_func = memory_fatal; - bufsize = 8 * 1024; - buf = xmalloc (bufsize); - - strippath = -1; - - val = getenv ("QUOTING_STYLE"); - { - int i = val ? argmatch (val, quoting_style_args, 0, 0) : -1; - set_quoting_style ((struct quoting_options *) 0, - i < 0 ? shell_quoting_style : (enum quoting_style) i); - } - - posixly_correct = getenv ("POSIXLY_CORRECT") != 0; - backup_if_mismatch = ! posixly_correct; - patch_get = ((val = getenv ("PATCH_GET")) - ? numeric_string (val, true, "PATCH_GET value") - : posixly_correct - 1); - - val = getenv ("SIMPLE_BACKUP_SUFFIX"); - simple_backup_suffix = val && *val ? val : ".orig"; - - if ((version_control = getenv ("PATCH_VERSION_CONTROL"))) - version_control_context = "$PATCH_VERSION_CONTROL"; - else if ((version_control = getenv ("VERSION_CONTROL"))) - version_control_context = "$VERSION_CONTROL"; - - /* Cons up the names of the global temporary files. - Do this before `cleanup' can possibly be called (e.g. by `pfatal'). */ - TMPOUTNAME = make_temp ('o'); - TMPINNAME = make_temp ('i'); - TMPREJNAME = make_temp ('r'); - TMPPATNAME = make_temp ('p'); - - /* parse switches */ - Argc = argc; - Argv = argv; - get_some_switches(); - - if (make_backups | backup_if_mismatch) - backup_type = get_version (version_control_context, version_control); - - init_output (outfile, 0, &outstate); - - /* Make sure we clean up in case of disaster. */ - set_signals (false); - - for ( - open_patch_file (patchname); - there_is_another_patch(); - reinitialize_almost_everything() - ) { /* for each patch in patch file */ - int hunk = 0; - int failed = 0; - bool mismatch = false; - char *outname = outfile ? outfile : inname; - - if (!skip_rest_of_patch) - get_input_file (inname, outname); - - if (diff_type == ED_DIFF) { - outstate.zero_output = false; - somefailed |= skip_rest_of_patch; - do_ed_script (outstate.ofp); - if (! dry_run && ! outfile && ! skip_rest_of_patch) - { - struct stat statbuf; - if (stat (TMPOUTNAME, &statbuf) != 0) - pfatal ("%s", TMPOUTNAME); - outstate.zero_output = statbuf.st_size == 0; - } - } else { - int got_hunk; - bool apply_anyway = false; - - /* initialize the patched file */ - if (! skip_rest_of_patch && ! outfile) - { - int exclusive = TMPOUTNAME_needs_removal ? 0 : O_EXCL; - TMPOUTNAME_needs_removal = 1; - init_output (TMPOUTNAME, exclusive, &outstate); - } - - /* initialize reject file */ - init_reject (); - - /* find out where all the lines are */ - if (!skip_rest_of_patch) - scan_input (inname); - - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ - - /* apply each hunk of patch */ - while (0 < (got_hunk = another_hunk (diff_type, reverse))) { - LINENUM where = 0; /* Pacify `gcc -Wall'. */ - LINENUM newwhere; - LINENUM fuzz = 0; - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM mymaxfuzz = (maxfuzz < context ? maxfuzz : context); - hunk++; - if (!skip_rest_of_patch) { - do { - where = locate_hunk(fuzz); - if (! where || fuzz || last_offset) - mismatch = true; - if (hunk == 1 && ! where && ! (force | apply_anyway) - && reverse == reverse_flag_specified) { - /* dwim for reversed patch? */ - if (!pch_swap()) { - say ( -"Not enough memory to try swapped hunk! Assuming unswapped.\n"); - continue; - } - /* Try again. */ - where = locate_hunk (fuzz); - if (where - && (ok_to_reverse - ("%s patch detected!", - (reverse - ? "Unreversed" - : "Reversed (or previously applied)")))) - reverse = ! reverse; - else - { - /* Put it back to normal. */ - if (! pch_swap ()) - fatal ("lost hunk on alloc error!"); - if (where) - { - apply_anyway = true; - fuzz--; /* Undo `++fuzz' below. */ - where = 0; - } - } - } - } while (!skip_rest_of_patch && !where - && ++fuzz <= mymaxfuzz); - - if (skip_rest_of_patch) { /* just got decided */ - if (outstate.ofp && ! outfile) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - } - } - - newwhere = pch_newfirst() + last_offset; - if (skip_rest_of_patch) { - abort_hunk(); - failed++; - if (verbosity == VERBOSE) - say ("Hunk #%d ignored at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } - else if (!where - || (where == 1 && pch_says_nonexistent (reverse) == 2 - && instat.st_size)) { - - if (where) - say ("Patch attempted to create file %s, which already exists.\n", - quotearg (inname)); - - abort_hunk(); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } - else if (! apply_hunk (&outstate, where)) { - abort_hunk (); - failed++; - if (verbosity != SILENT) - say ("Hunk #%d FAILED at %s.\n", hunk, - format_linenum (numbuf, newwhere)); - } else { - if (verbosity == VERBOSE - || (verbosity != SILENT && (fuzz || last_offset))) { - say ("Hunk #%d succeeded at %s", hunk, - format_linenum (numbuf, newwhere)); - if (fuzz) - say (" with fuzz %s", format_linenum (numbuf, fuzz)); - if (last_offset) - say (" (offset %s line%s)", - format_linenum (numbuf, last_offset), - "s" + (last_offset == 1)); - say (".\n"); - } - } - } - - if (!skip_rest_of_patch) - { - if (got_hunk < 0 && using_plan_a) - { - if (outfile) - fatal ("out of memory using Plan A"); - say ("\n\nRan out of memory using Plan A -- trying again...\n\n"); - if (outstate.ofp) - { - fclose (outstate.ofp); - outstate.ofp = 0; - } - fclose (rejfp); - continue; - } - - /* Finish spewing out the new file. */ - assert (hunk); - if (! spew_output (&outstate)) - { - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - } - } - } - - /* and put the output where desired */ - ignore_signals (); - if (! skip_rest_of_patch && ! outfile) { - if (outstate.zero_output - && (remove_empty_files - || (pch_says_nonexistent (! reverse) == 2 - && ! posixly_correct))) - { - if (verbosity == VERBOSE) - say ("Removing file %s%s\n", quotearg (outname), - dry_run ? " and any empty ancestor directories" : ""); - if (! dry_run) - { - move_file ((char *) 0, (int *) 0, outname, (mode_t) 0, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - removedirs (outname); - } - } - else - { - if (! outstate.zero_output - && pch_says_nonexistent (! reverse)) - { - mismatch = true; - if (verbosity != SILENT) - say ("File %s is not empty after patch, as expected\n", - quotearg (outname)); - } - - if (! dry_run) - { - time_t t; - - move_file (TMPOUTNAME, &TMPOUTNAME_needs_removal, - outname, instat.st_mode, - (make_backups - || (backup_if_mismatch && (mismatch | failed)))); - - if ((set_time | set_utc) - && (t = pch_timestamp (! reverse)) != (time_t) -1) - { - struct utimbuf utimbuf; - utimbuf.actime = utimbuf.modtime = t; - - if (! force && ! inerrno - && pch_says_nonexistent (reverse) != 2 - && (t = pch_timestamp (reverse)) != (time_t) -1 - && t != instat.st_mtime) - say ("Not setting time of file %s (time mismatch)\n", - quotearg (outname)); - else if (! force && (mismatch | failed)) - say ("Not setting time of file %s (contents mismatch)\n", - quotearg (outname)); - else if (utime (outname, &utimbuf) != 0) - pfatal ("Can't set timestamp on file %s", - quotearg (outname)); - } - - if (! inerrno && chmod (outname, instat.st_mode) != 0) - pfatal ("Can't set permissions on file %s", - quotearg (outname)); - } - } - } - if (diff_type != ED_DIFF) { - if (fclose (rejfp) != 0) - write_fatal (); - if (failed) { - somefailed = true; - say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1), - skip_rest_of_patch ? "ignored" : "FAILED"); - if (outname) { - char *rej = rejname; - if (!rejname) { - rej = xmalloc (strlen (outname) + 5); - strcpy (rej, outname); - addext (rej, ".rej", '#'); - } - say (" -- saving rejects to file %s", quotearg (rej)); - if (! dry_run) - { - move_file (TMPREJNAME, &TMPREJNAME_needs_removal, - rej, instat.st_mode, false); - if (! inerrno - && (chmod (rej, (instat.st_mode - & ~(S_IXUSR|S_IXGRP|S_IXOTH))) - != 0)) - pfatal ("can't set permissions on file %s", - quotearg (rej)); - } - if (!rejname) - free (rej); - } - say ("\n"); - } - } - set_signals (true); - } - if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) - write_fatal (); - cleanup (); - if (somefailed) - exit (1); - return 0; -} - -/* Prepare to find the next patch to do in the patch file. */ - -static void -reinitialize_almost_everything (void) -{ - re_patch(); - re_input(); - - input_lines = 0; - last_frozen_line = 0; - - if (inname) { - free (inname); - inname = 0; - } - - last_offset = 0; - - diff_type = NO_DIFF; - - if (revision) { - free(revision); - revision = 0; - } - - reverse = reverse_flag_specified; - skip_rest_of_patch = false; -} - -static char const shortopts[] = "bB:cd:D:eEfF:g:i:lnNo:p:r:RstTuvV:x:Y:z:Z"; -static struct option const longopts[] = -{ - {"backup", no_argument, NULL, 'b'}, - {"prefix", required_argument, NULL, 'B'}, - {"context", no_argument, NULL, 'c'}, - {"directory", required_argument, NULL, 'd'}, - {"ifdef", required_argument, NULL, 'D'}, - {"ed", no_argument, NULL, 'e'}, - {"remove-empty-files", no_argument, NULL, 'E'}, - {"force", no_argument, NULL, 'f'}, - {"fuzz", required_argument, NULL, 'F'}, - {"get", no_argument, NULL, 'g'}, - {"input", required_argument, NULL, 'i'}, - {"ignore-whitespace", no_argument, NULL, 'l'}, - {"normal", no_argument, NULL, 'n'}, - {"forward", no_argument, NULL, 'N'}, - {"output", required_argument, NULL, 'o'}, - {"strip", required_argument, NULL, 'p'}, - {"reject-file", required_argument, NULL, 'r'}, - {"reverse", no_argument, NULL, 'R'}, - {"quiet", no_argument, NULL, 's'}, - {"silent", no_argument, NULL, 's'}, - {"batch", no_argument, NULL, 't'}, - {"set-time", no_argument, NULL, 'T'}, - {"unified", no_argument, NULL, 'u'}, - {"version", no_argument, NULL, 'v'}, - {"version-control", required_argument, NULL, 'V'}, - {"debug", required_argument, NULL, 'x'}, - {"basename-prefix", required_argument, NULL, 'Y'}, - {"suffix", required_argument, NULL, 'z'}, - {"set-utc", no_argument, NULL, 'Z'}, - {"dry-run", no_argument, NULL, CHAR_MAX + 1}, - {"verbose", no_argument, NULL, CHAR_MAX + 2}, - {"binary", no_argument, NULL, CHAR_MAX + 3}, - {"help", no_argument, NULL, CHAR_MAX + 4}, - {"backup-if-mismatch", no_argument, NULL, CHAR_MAX + 5}, - {"no-backup-if-mismatch", no_argument, NULL, CHAR_MAX + 6}, - {"posix", no_argument, NULL, CHAR_MAX + 7}, - {"quoting-style", required_argument, NULL, CHAR_MAX + 8}, - {NULL, no_argument, NULL, 0} -}; - -static char const *const option_help[] = -{ -"Input options:", -"", -" -p NUM --strip=NUM Strip NUM leading components from file names.", -" -F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.", -" -l --ignore-whitespace Ignore white space changes between patch and input.", -"", -" -c --context Interpret the patch as a context difference.", -" -e --ed Interpret the patch as an ed script.", -" -n --normal Interpret the patch as a normal difference.", -" -u --unified Interpret the patch as a unified difference.", -"", -" -N --forward Ignore patches that appear to be reversed or already applied.", -" -R --reverse Assume patches were created with old and new files swapped.", -"", -" -i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.", -"", -"Output options:", -"", -" -o FILE --output=FILE Output patched files to FILE.", -" -r FILE --reject-file=FILE Output rejects to FILE.", -"", -" -D NAME --ifdef=NAME Make merged if-then-else output using NAME.", -" -E --remove-empty-files Remove output files that are empty after patching.", -"", -" -Z --set-utc Set times of patched files, assuming diff uses UTC (GMT).", -" -T --set-time Likewise, assuming local time.", -"", -" --quoting-style=WORD output file names using quoting style WORD.", -" Valid WORDs are: literal, shell, shell-always, c, escape.", -" Default is taken from QUOTING_STYLE env variable, or 'shell' if unset.", -"", -"Backup and version control options:", -"", -" -b --backup Back up the original contents of each file.", -" --backup-if-mismatch Back up if the patch does not match exactly.", -" --no-backup-if-mismatch Back up mismatches only if otherwise requested.", -"", -" -V STYLE --version-control=STYLE Use STYLE version control.", -" STYLE is either 'simple', 'numbered', or 'existing'.", -" -B PREFIX --prefix=PREFIX Prepend PREFIX to backup file names.", -" -Y PREFIX --basename-prefix=PREFIX Prepend PREFIX to backup file basenames.", -" -z SUFFIX --suffix=SUFFIX Append SUFFIX to backup file names.", -"", -" -g NUM --get=NUM Get files from RCS etc. if positive; ask if negative.", -"", -"Miscellaneous options:", -"", -" -t --batch Ask no questions; skip bad-Prereq patches; assume reversed.", -" -f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.", -" -s --quiet --silent Work silently unless an error occurs.", -" --verbose Output extra information about the work being done.", -" --dry-run Do not actually change any files; just print what would happen.", -" --posix Conform to the POSIX standard.", -"", -" -d DIR --directory=DIR Change the working directory to DIR first.", -#if HAVE_SETMODE_DOS -" --binary Read and write data in binary mode.", -#else -" --binary Read and write data in binary mode (no effect on this platform).", -#endif -"", -" -v --version Output version info.", -" --help Output this help.", -"", -"Report bugs to <" PACKAGE_BUGREPORT ">.", -0 -}; - -static void -usage (FILE *stream, int status) -{ - char const * const *p; - - if (status != 0) - { - fprintf (stream, "%s: Try `%s --help' for more information.\n", - program_name, Argv[0]); - } - else - { - fprintf (stream, "Usage: %s [OPTION]... [ORIGFILE [PATCHFILE]]\n\n", - Argv[0]); - for (p = option_help; *p; p++) - fprintf (stream, "%s\n", *p); - } - - exit (status); -} - -/* Process switches and filenames. */ - -static void -get_some_switches (void) -{ - register int optc; - - if (rejname) - free (rejname); - rejname = 0; - if (optind == Argc) - return; - while ((optc = getopt_long (Argc, Argv, shortopts, longopts, (int *) 0)) - != -1) { - switch (optc) { - case 'b': - make_backups = true; - /* Special hack for backward compatibility with CVS 1.9. - If the last 4 args are `-b SUFFIX ORIGFILE PATCHFILE', - treat `-b' as if it were `-b -z'. */ - if (Argc - optind == 3 - && strcmp (Argv[optind - 1], "-b") == 0 - && ! (Argv[optind + 0][0] == '-' && Argv[optind + 0][1]) - && ! (Argv[optind + 1][0] == '-' && Argv[optind + 1][1]) - && ! (Argv[optind + 2][0] == '-' && Argv[optind + 2][1])) - { - optarg = Argv[optind++]; - if (verbosity != SILENT) - say ("warning: the `-b %s' option is obsolete; use `-b -z %s' instead\n", - optarg, optarg); - goto case_z; - } - break; - case 'B': - if (!*optarg) - fatal ("backup prefix is empty"); - origprae = savestr (optarg); - break; - case 'c': - diff_type = CONTEXT_DIFF; - break; - case 'd': - if (chdir(optarg) < 0) - pfatal ("Can't change to directory %s", quotearg (optarg)); - break; - case 'D': - do_defines = savestr (optarg); - break; - case 'e': - diff_type = ED_DIFF; - break; - case 'E': - remove_empty_files = true; - break; - case 'f': - force = true; - break; - case 'F': - maxfuzz = numeric_string (optarg, false, "fuzz factor"); - break; - case 'g': - patch_get = numeric_string (optarg, true, "get option value"); - break; - case 'i': - patchname = savestr (optarg); - break; - case 'l': - canonicalize = true; - break; - case 'n': - diff_type = NORMAL_DIFF; - break; - case 'N': - noreverse = true; - break; - case 'o': - if (strcmp (optarg, "-") == 0) - fatal ("can't output patches to standard output"); - outfile = savestr (optarg); - break; - case 'p': - strippath = numeric_string (optarg, false, "strip count"); - break; - case 'r': - rejname = savestr (optarg); - break; - case 'R': - reverse = true; - reverse_flag_specified = true; - break; - case 's': - verbosity = SILENT; - break; - case 't': - batch = true; - break; - case 'T': - set_time = true; - break; - case 'u': - diff_type = UNI_DIFF; - break; - case 'v': - version(); - exit (0); - break; - case 'V': - version_control = optarg; - version_control_context = "--version-control or -V option"; - break; -#if DEBUGGING - case 'x': - debug = numeric_string (optarg, true, "debugging option"); - break; -#endif - case 'Y': - if (!*optarg) - fatal ("backup basename prefix is empty"); - origbase = savestr (optarg); - break; - case 'z': - case_z: - if (!*optarg) - fatal ("backup suffix is empty"); - simple_backup_suffix = savestr (optarg); - break; - case 'Z': - set_utc = true; - break; - case CHAR_MAX + 1: - dry_run = true; - break; - case CHAR_MAX + 2: - verbosity = VERBOSE; - break; - case CHAR_MAX + 3: -#if HAVE_SETMODE_DOS - binary_transput = O_BINARY; -#endif - break; - case CHAR_MAX + 4: - usage (stdout, 0); - case CHAR_MAX + 5: - backup_if_mismatch = true; - break; - case CHAR_MAX + 6: - backup_if_mismatch = false; - break; - case CHAR_MAX + 7: - posixly_correct = true; - break; - case CHAR_MAX + 8: - { - int i = argmatch (optarg, quoting_style_args, 0, 0); - if (i < 0) - { - invalid_arg ("quoting style", optarg, i); - usage (stderr, 2); - } - set_quoting_style ((struct quoting_options *) 0, - (enum quoting_style) i); - } - break; - default: - usage (stderr, 2); - } - } - - /* Process any filename args. */ - if (optind < Argc) - { - inname = savestr (Argv[optind++]); - invc = -1; - if (optind < Argc) - { - patchname = savestr (Argv[optind++]); - if (optind < Argc) - { - fprintf (stderr, "%s: %s: extra operand\n", - program_name, quotearg (Argv[optind])); - usage (stderr, 2); - } - } - } -} - -/* Handle STRING (possibly negative if NEGATIVE_ALLOWED is nonzero) - of type ARGTYPE_MSGID by converting it to an integer, - returning the result. */ -static int -numeric_string (char const *string, - bool negative_allowed, - char const *argtype_msgid) -{ - int value = 0; - char const *p = string; - int sign = *p == '-' ? -1 : 1; - - p += *p == '-' || *p == '+'; - - do - { - int v10 = value * 10; - int digit = *p - '0'; - int signed_digit = sign * digit; - int next_value = v10 + signed_digit; - - if (9 < (unsigned) digit) - fatal ("%s %s is not a number", argtype_msgid, quotearg (string)); - - if (v10 / 10 != value || (next_value < v10) != (signed_digit < 0)) - fatal ("%s %s is too large", argtype_msgid, quotearg (string)); - - value = next_value; - } - while (*++p); - - if (value < 0 && ! negative_allowed) - fatal ("%s %s is negative", argtype_msgid, quotearg (string)); - - return value; -} - -/* Attempt to find the right place to apply this hunk of patch. */ - -static LINENUM -locate_hunk (LINENUM fuzz) -{ - register LINENUM first_guess = pch_first () + last_offset; - register LINENUM offset; - LINENUM pat_lines = pch_ptrn_lines(); - LINENUM prefix_context = pch_prefix_context (); - LINENUM suffix_context = pch_suffix_context (); - LINENUM context = (prefix_context < suffix_context - ? suffix_context : prefix_context); - LINENUM prefix_fuzz = fuzz + prefix_context - context; - LINENUM suffix_fuzz = fuzz + suffix_context - context; - LINENUM max_where = input_lines - (pat_lines - suffix_fuzz) + 1; - LINENUM min_where = last_frozen_line + 1 - (prefix_context - prefix_fuzz); - LINENUM max_pos_offset = max_where - first_guess; - LINENUM max_neg_offset = first_guess - min_where; - LINENUM max_offset = (max_pos_offset < max_neg_offset - ? max_neg_offset : max_pos_offset); - - if (!pat_lines) /* null range matches always */ - return first_guess; - - /* Do not try lines <= 0. */ - if (first_guess <= max_neg_offset) - max_neg_offset = first_guess - 1; - - if (prefix_fuzz < 0) - { - /* Can only match start of file. */ - - if (suffix_fuzz < 0) - /* Can only match entire file. */ - if (pat_lines != input_lines || prefix_context < last_frozen_line) - return 0; - - offset = 1 - first_guess; - if (last_frozen_line <= prefix_context - && offset <= max_pos_offset - && patch_match (first_guess, offset, (LINENUM) 0, suffix_fuzz)) - { - last_offset += offset; - return first_guess + offset; - } - else - return 0; - } - - if (suffix_fuzz < 0) - { - /* Can only match end of file. */ - offset = first_guess - (input_lines - pat_lines + 1); - if (offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, (LINENUM) 0)) - { - last_offset -= offset; - return first_guess - offset; - } - else - return 0; - } - - for (offset = 0; offset <= max_offset; offset++) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - if (offset <= max_pos_offset - && patch_match (first_guess, offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %s to %s\n", - format_linenum (numbuf0, last_offset), - format_linenum (numbuf1, last_offset + offset)); - last_offset += offset; - return first_guess+offset; - } - if (0 < offset && offset <= max_neg_offset - && patch_match (first_guess, -offset, prefix_fuzz, suffix_fuzz)) { - if (debug & 1) - say ("Offset changing from %s to %s\n", - format_linenum (numbuf0, last_offset), - format_linenum (numbuf1, last_offset - offset)); - last_offset -= offset; - return first_guess-offset; - } - } - return 0; -} - -/* We did not find the pattern, dump out the hunk so they can handle it. */ - -static void -abort_hunk (void) -{ - register LINENUM i; - register LINENUM pat_end = pch_end (); - /* add in last_offset to guess the same as the previous successful hunk */ - LINENUM oldfirst = pch_first() + last_offset; - LINENUM newfirst = pch_newfirst() + last_offset; - LINENUM oldlast = oldfirst + pch_ptrn_lines() - 1; - LINENUM newlast = newfirst + pch_repl_lines() - 1; - char const *stars = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : ""; - char const *minuses = - (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----"; - - fprintf(rejfp, "***************\n"); - for (i=0; i<=pat_end; i++) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - switch (pch_char(i)) { - case '*': - if (oldlast < oldfirst) - fprintf(rejfp, "*** 0%s\n", stars); - else if (oldlast == oldfirst) - fprintf (rejfp, "*** %s%s\n", - format_linenum (numbuf0, oldfirst), stars); - else - fprintf (rejfp, "*** %s,%s%s\n", - format_linenum (numbuf0, oldfirst), - format_linenum (numbuf1, oldlast), stars); - break; - case '=': - if (newlast < newfirst) - fprintf(rejfp, "--- 0%s\n", minuses); - else if (newlast == newfirst) - fprintf (rejfp, "--- %s%s\n", - format_linenum (numbuf0, newfirst), minuses); - else - fprintf (rejfp, "--- %s,%s%s\n", - format_linenum (numbuf0, newfirst), - format_linenum (numbuf1, newlast), minuses); - break; - case ' ': case '-': case '+': case '!': - fprintf (rejfp, "%c ", pch_char (i)); - /* fall into */ - case '\n': - pch_write_line (i, rejfp); - break; - default: - fatal ("fatal internal error in abort_hunk"); - } - if (ferror (rejfp)) - write_fatal (); - } -} - -/* We found where to apply it (we hope), so do it. */ - -static bool -apply_hunk (struct outstate *outstate, LINENUM where) -{ - register LINENUM old = 1; - register LINENUM lastline = pch_ptrn_lines (); - register LINENUM new = lastline+1; - register enum {OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE} def_state = OUTSIDE; - register char const *R_do_defines = do_defines; - register LINENUM pat_end = pch_end (); - register FILE *fp = outstate->ofp; - - where--; - while (pch_char(new) == '=' || pch_char(new) == '\n') - new++; - - while (old <= lastline) { - if (pch_char(old) == '-') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + not_defined, - R_do_defines); - def_state = IN_IFNDEF; - } - else if (def_state == IN_IFDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->after_newline = pch_write_line (old, fp); - outstate->zero_output = false; - } - last_frozen_line++; - old++; - } - else if (new > pat_end) { - break; - } - else if (pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - else if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - if (ferror (fp)) - write_fatal (); - } - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = false; - new++; - } - else if (pch_char(new) != pch_char(old)) { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - if (debug & 1) - say ("oldchar = '%c', newchar = '%c'\n", - pch_char (old), pch_char (new)); - fatal ("Out-of-sync patch, lines %s,%s -- mangled text or line numbers, maybe?", - format_linenum (numbuf0, pch_hunk_beg() + old), - format_linenum (numbuf1, pch_hunk_beg() + new)); - } - else if (pch_char(new) == '!') { - assert (outstate->after_newline); - if (! copy_till (outstate, where + old - 1)) - return false; - assert (outstate->after_newline); - if (R_do_defines) { - fprintf (fp, 1 + not_defined, R_do_defines); - if (ferror (fp)) - write_fatal (); - def_state = IN_IFNDEF; - } - - do - { - if (R_do_defines) { - outstate->after_newline = pch_write_line (old, fp); - } - last_frozen_line++; - old++; - } - while (pch_char (old) == '!'); - - if (R_do_defines) { - fprintf (fp, outstate->after_newline + else_defined); - if (ferror (fp)) - write_fatal (); - def_state = IN_ELSE; - } - - do - { - outstate->after_newline = pch_write_line (new, fp); - new++; - } - while (pch_char (new) == '!'); - outstate->zero_output = false; - } - else { - assert(pch_char(new) == ' '); - old++; - new++; - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = true; - def_state = OUTSIDE; - } - } - } - if (new <= pat_end && pch_char(new) == '+') { - if (! copy_till (outstate, where + old - 1)) - return false; - if (R_do_defines) { - if (def_state == OUTSIDE) { - fprintf (fp, outstate->after_newline + if_defined, - R_do_defines); - def_state = IN_IFDEF; - } - else if (def_state == IN_IFNDEF) { - fprintf (fp, outstate->after_newline + else_defined); - def_state = IN_ELSE; - } - if (ferror (fp)) - write_fatal (); - outstate->zero_output = false; - } - - do - { - if (! outstate->after_newline && putc ('\n', fp) == EOF) - write_fatal (); - outstate->after_newline = pch_write_line (new, fp); - outstate->zero_output = false; - new++; - } - while (new <= pat_end && pch_char (new) == '+'); - } - if (R_do_defines && def_state != OUTSIDE) { - fprintf (fp, outstate->after_newline + end_defined); - if (ferror (fp)) - write_fatal (); - outstate->after_newline = true; - } - return true; -} - -/* Create an output file. */ - -static FILE * -create_output_file (char const *name, int open_flags) -{ - int fd = create_file (name, O_WRONLY | binary_transput | open_flags, - instat.st_mode); - FILE *f = fdopen (fd, binary_transput ? "wb" : "w"); - if (! f) - pfatal ("Can't create file %s", quotearg (name)); - return f; -} - -/* Open the new file. */ - -static void -init_output (char const *name, int open_flags, struct outstate *outstate) -{ - outstate->ofp = name ? create_output_file (name, open_flags) : (FILE *) 0; - outstate->after_newline = true; - outstate->zero_output = true; -} - -/* Open a file to put hunks we can't locate. */ - -static void -init_reject (void) -{ - int exclusive = TMPREJNAME_needs_removal ? 0 : O_EXCL; - TMPREJNAME_needs_removal = 1; - rejfp = create_output_file (TMPREJNAME, exclusive); -} - -/* Copy input file to output, up to wherever hunk is to be applied. */ - -static bool -copy_till (register struct outstate *outstate, register LINENUM lastline) -{ - register LINENUM R_last_frozen_line = last_frozen_line; - register FILE *fp = outstate->ofp; - register char const *s; - size_t size; - - if (R_last_frozen_line > lastline) - { - say ("misordered hunks! output would be garbled\n"); - return false; - } - while (R_last_frozen_line < lastline) - { - s = ifetch (++R_last_frozen_line, false, &size); - if (size) - { - if ((! outstate->after_newline && putc ('\n', fp) == EOF) - || ! fwrite (s, sizeof *s, size, fp)) - write_fatal (); - outstate->after_newline = s[size - 1] == '\n'; - outstate->zero_output = false; - } - } - last_frozen_line = R_last_frozen_line; - return true; -} - -/* Finish copying the input file to the output file. */ - -static bool -spew_output (struct outstate *outstate) -{ - if (debug & 256) - { - char numbuf0[LINENUM_LENGTH_BOUND + 1]; - char numbuf1[LINENUM_LENGTH_BOUND + 1]; - say ("il=%s lfl=%s\n", - format_linenum (numbuf0, input_lines), - format_linenum (numbuf1, last_frozen_line)); - } - - if (last_frozen_line < input_lines) - if (! copy_till (outstate, input_lines)) - return false; - - if (outstate->ofp && ! outfile) - { - if (fclose (outstate->ofp) != 0) - write_fatal (); - outstate->ofp = 0; - } - - return true; -} - -/* Does the patch pattern match at line base+offset? */ - -static bool -patch_match (LINENUM base, LINENUM offset, - LINENUM prefix_fuzz, LINENUM suffix_fuzz) -{ - register LINENUM pline = 1 + prefix_fuzz; - register LINENUM iline; - register LINENUM pat_lines = pch_ptrn_lines () - suffix_fuzz; - size_t size; - register char const *p; - - for (iline=base+offset+prefix_fuzz; pline <= pat_lines; pline++,iline++) { - p = ifetch (iline, offset >= 0, &size); - if (canonicalize) { - if (!similar(p, size, - pfetch(pline), - pch_line_len(pline) )) - return false; - } - else if (size != pch_line_len (pline) - || memcmp (p, pfetch (pline), size) != 0) - return false; - } - return true; -} - -/* Do two lines match with canonicalized white space? */ - -static bool -similar (register char const *a, register size_t alen, - register char const *b, register size_t blen) -{ - /* Ignore presence or absence of trailing newlines. */ - alen -= alen && a[alen - 1] == '\n'; - blen -= blen && b[blen - 1] == '\n'; - - for (;;) - { - if (!blen || (*b == ' ' || *b == '\t')) - { - while (blen && (*b == ' ' || *b == '\t')) - b++, blen--; - if (alen) - { - if (!(*a == ' ' || *a == '\t')) - return false; - do a++, alen--; - while (alen && (*a == ' ' || *a == '\t')); - } - if (!alen || !blen) - return alen == blen; - } - else if (!alen || *a++ != *b++) - return false; - else - alen--, blen--; - } -} - -/* Make a temporary file. */ - -#if HAVE_MKTEMP && ! HAVE_DECL_MKTEMP && ! defined mktemp -char *mktemp (char *); -#endif - -#ifndef TMPDIR -#define TMPDIR "/tmp" -#endif - -static char const * -make_temp (char letter) -{ - char *r; -#if HAVE_MKTEMP - char const *tmpdir = getenv ("TMPDIR"); /* Unix tradition */ - if (!tmpdir) tmpdir = getenv ("TMP"); /* DOS tradition */ - if (!tmpdir) tmpdir = getenv ("TEMP"); /* another DOS tradition */ - if (!tmpdir) tmpdir = TMPDIR; - r = xmalloc (strlen (tmpdir) + 10); - sprintf (r, "%s/p%cXXXXXX", tmpdir, letter); - - /* It is OK to use mktemp here, since the rest of the code always - opens temp files with O_EXCL. It might be better to use mkstemp - to avoid some DoS problems, but simply substituting mkstemp for - mktemp here will not fix the DoS problems; a more extensive - change would be needed. */ - mktemp (r); - - if (!*r) - pfatal ("mktemp"); -#else - r = xmalloc (L_tmpnam); - if (! (tmpnam (r) == r && *r)) - pfatal ("tmpnam"); -#endif - return r; -} - -/* Fatal exit with cleanup. */ - -void -fatal_exit (int sig) -{ - cleanup (); - - if (sig) - exit_with_signal (sig); - - exit (2); -} - -static void -remove_if_needed (char const *name, int volatile *needs_removal) -{ - if (*needs_removal) - { - unlink (name); - *needs_removal = 0; - } -} - -static void -cleanup (void) -{ - remove_if_needed (TMPINNAME, &TMPINNAME_needs_removal); - remove_if_needed (TMPOUTNAME, &TMPOUTNAME_needs_removal); - remove_if_needed (TMPPATNAME, &TMPPATNAME_needs_removal); - remove_if_needed (TMPREJNAME, &TMPREJNAME_needs_removal); -} Property changes on: vendor/misc-GNU/patch/dist/patch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/inp.c =================================================================== --- vendor/misc-GNU/patch/dist/inp.c (revision 358868) +++ vendor/misc-GNU/patch/dist/inp.c (nonexistent) @@ -1,468 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.c,v 1.25 2003/05/20 13:58:02 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - Copyright (C) 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include - -/* Input-file-with-indexable-lines abstract type */ - -static char *i_buffer; /* plan A buffer */ -static char const **i_ptr; /* pointers to lines in plan A buffer */ - -static size_t tibufsize; /* size of plan b buffers */ -#ifndef TIBUFSIZE_MINIMUM -#define TIBUFSIZE_MINIMUM (8 * 1024) /* minimum value for tibufsize */ -#endif -static int tifd = -1; /* plan b virtual string array */ -static char *tibuf[2]; /* plan b buffers */ -static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */ -static LINENUM lines_per_buf; /* how many lines per buffer */ -static size_t tireclen; /* length of records in tmp file */ -static size_t last_line_size; /* size of last input line */ - -static bool plan_a (char const *); /* yield false if memory runs out */ -static void plan_b (char const *); -static void report_revision (bool); -static void too_many_lines (char const *) __attribute__((noreturn)); - -/* New patch--prepare to edit another file. */ - -void -re_input (void) -{ - if (using_plan_a) { - if (i_buffer) - { - free (i_buffer); - i_buffer = 0; - free (i_ptr); - } - } - else { - close (tifd); - tifd = -1; - if (tibuf[0]) - { - free (tibuf[0]); - tibuf[0] = 0; - } - tiline[0] = tiline[1] = -1; - tireclen = 0; - } -} - -/* Construct the line index, somehow or other. */ - -void -scan_input (char *filename) -{ - using_plan_a = ! (debug & 16) && plan_a (filename); - if (!using_plan_a) - plan_b(filename); - - if (verbosity != SILENT) - { - filename = quotearg (filename); - - if (verbosity == VERBOSE) - say ("Patching file %s using Plan %s...\n", - filename, using_plan_a ? "A" : "B"); - else - say ("patching file %s\n", filename); - } -} - -/* Report whether a desired revision was found. */ - -static void -report_revision (bool found_revision) -{ - char const *rev = quotearg (revision); - - if (found_revision) - { - if (verbosity == VERBOSE) - say ("Good. This file appears to be the %s version.\n", rev); - } - else if (force) - { - if (verbosity != SILENT) - say ("Warning: this file doesn't appear to be the %s version -- patching anyway.\n", - rev); - } - else if (batch) - fatal ("This file doesn't appear to be the %s version -- aborting.", - rev); - else - { - ask ("This file doesn't appear to be the %s version -- patch anyway? [n] ", - rev); - if (*buf != 'y') - fatal ("aborted"); - } -} - - -static void -too_many_lines (char const *filename) -{ - fatal ("File %s has too many lines", quotearg (filename)); -} - - -void -get_input_file (char const *filename, char const *outname) -{ - bool elsewhere = strcmp (filename, outname) != 0; - char const *cs; - char *diffbuf; - char *getbuf; - - if (inerrno == -1) - inerrno = stat (inname, &instat) == 0 ? 0 : errno; - - /* Perhaps look for RCS or SCCS versions. */ - if (patch_get - && invc != 0 - && (inerrno - || (! elsewhere - && (/* No one can write to it. */ - (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0 - /* Only the owner (who's not me) can write to it. */ - || ((instat.st_mode & (S_IWGRP|S_IWOTH)) == 0 - && instat.st_uid != geteuid ())))) - && (invc = !! (cs = (version_controller - (filename, elsewhere, - inerrno ? (struct stat *) 0 : &instat, - &getbuf, &diffbuf))))) { - - if (!inerrno) { - if (!elsewhere - && (instat.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) != 0) - /* Somebody can write to it. */ - fatal ("File %s seems to be locked by somebody else under %s", - quotearg (filename), cs); - if (diffbuf) - { - /* It might be checked out unlocked. See if it's safe to - check out the default version locked. */ - - if (verbosity == VERBOSE) - say ("Comparing file %s to default %s version...\n", - quotearg (filename), cs); - - if (systemic (diffbuf) != 0) - { - say ("warning: Patching file %s, which does not match default %s version\n", - quotearg (filename), cs); - cs = 0; - } - } - } - - if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, - &instat)) - inerrno = 0; - - free (getbuf); - if (diffbuf) - free (diffbuf); - - } else if (inerrno && !pch_says_nonexistent (reverse)) - { - errno = inerrno; - pfatal ("Can't find file %s", quotearg (filename)); - } - - if (inerrno) - { - instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; - instat.st_size = 0; - } - else if (! S_ISREG (instat.st_mode)) - fatal ("File %s is not a regular file -- can't patch", - quotearg (filename)); -} - - -/* Try keeping everything in memory. */ - -static bool -plan_a (char const *filename) -{ - register char const *s; - register char const *lim; - register char const **ptr; - register char *buffer; - register LINENUM iline; - size_t size = instat.st_size; - - /* Fail if the file size doesn't fit in a size_t, - or if storage isn't available. */ - if (! (size == instat.st_size - && (buffer = malloc (size ? size : (size_t) 1)))) - return false; - - /* Read the input file, but don't bother reading it if it's empty. - When creating files, the files do not actually exist. */ - if (size) - { - int ifd = open (filename, O_RDONLY|binary_transput); - size_t buffered = 0, n; - if (ifd < 0) - pfatal ("can't open file %s", quotearg (filename)); - - while (size - buffered != 0) - { - n = read (ifd, buffer + buffered, size - buffered); - if (n == 0) - { - /* Some non-POSIX hosts exaggerate st_size in text mode; - or the file may have shrunk! */ - size = buffered; - break; - } - if (n == (size_t) -1) - { - /* Perhaps size is too large for this host. */ - close (ifd); - free (buffer); - return false; - } - buffered += n; - } - - if (close (ifd) != 0) - read_fatal (); - } - - /* Scan the buffer and build array of pointers to lines. */ - lim = buffer + size; - iline = 3; /* 1 unused, 1 for SOF, 1 for EOF if last line is incomplete */ - for (s = buffer; (s = (char *) memchr (s, '\n', lim - s)); s++) - if (++iline < 0) - too_many_lines (filename); - if (! (iline == (size_t) iline - && (size_t) iline * sizeof *ptr / sizeof *ptr == (size_t) iline - && (ptr = (char const **) malloc ((size_t) iline * sizeof *ptr)))) - { - free (buffer); - return false; - } - iline = 0; - for (s = buffer; ; s++) - { - ptr[++iline] = s; - if (! (s = (char *) memchr (s, '\n', lim - s))) - break; - } - if (size && lim[-1] != '\n') - ptr[++iline] = lim; - input_lines = iline - 1; - - if (revision) - { - char const *rev = revision; - int rev0 = rev[0]; - bool found_revision = false; - size_t revlen = strlen (rev); - - if (revlen <= size) - { - char const *limrev = lim - revlen; - - for (s = buffer; (s = (char *) memchr (s, rev0, limrev - s)); s++) - if (memcmp (s, rev, revlen) == 0 - && (s == buffer || ISSPACE ((unsigned char) s[-1])) - && (s + 1 == limrev || ISSPACE ((unsigned char) s[revlen]))) - { - found_revision = true; - break; - } - } - - report_revision (found_revision); - } - - /* Plan A will work. */ - i_buffer = buffer; - i_ptr = ptr; - return true; -} - -/* Keep (virtually) nothing in memory. */ - -static void -plan_b (char const *filename) -{ - register FILE *ifp; - register int c; - register size_t len; - register size_t maxlen; - register bool found_revision; - register size_t i; - register char const *rev; - register size_t revlen; - register LINENUM line = 1; - int exclusive; - - if (instat.st_size == 0) - filename = NULL_DEVICE; - if (! (ifp = fopen (filename, binary_transput ? "rb" : "r"))) - pfatal ("Can't open file %s", quotearg (filename)); - exclusive = TMPINNAME_needs_removal ? 0 : O_EXCL; - TMPINNAME_needs_removal = 1; - tifd = create_file (TMPINNAME, O_RDWR | O_BINARY | exclusive, (mode_t) 0); - i = 0; - len = 0; - maxlen = 1; - rev = revision; - found_revision = !rev; - revlen = rev ? strlen (rev) : 0; - - while ((c = getc (ifp)) != EOF) - { - len++; - - if (c == '\n') - { - if (++line < 0) - too_many_lines (filename); - if (maxlen < len) - maxlen = len; - len = 0; - } - - if (!found_revision) - { - if (i == revlen) - { - found_revision = ISSPACE ((unsigned char) c); - i = (size_t) -1; - } - else if (i != (size_t) -1) - i = rev[i]==c ? i + 1 : (size_t) -1; - - if (i == (size_t) -1 && ISSPACE ((unsigned char) c)) - i = 0; - } - } - - if (revision) - report_revision (found_revision); - Fseek (ifp, (off_t) 0, SEEK_SET); /* rewind file */ - for (tibufsize = TIBUFSIZE_MINIMUM; tibufsize < maxlen; tibufsize <<= 1) - continue; - lines_per_buf = tibufsize / maxlen; - tireclen = maxlen; - tibuf[0] = xmalloc (2 * tibufsize); - tibuf[1] = tibuf[0] + tibufsize; - - for (line = 1; ; line++) - { - char *p = tibuf[0] + maxlen * (line % lines_per_buf); - char const *p0 = p; - if (! (line % lines_per_buf)) /* new block */ - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - if ((c = getc (ifp)) == EOF) - break; - - for (;;) - { - *p++ = c; - if (c == '\n') - { - last_line_size = p - p0; - break; - } - - if ((c = getc (ifp)) == EOF) - { - last_line_size = p - p0; - line++; - goto EOF_reached; - } - } - } - EOF_reached: - if (ferror (ifp) || fclose (ifp) != 0) - read_fatal (); - - if (line % lines_per_buf != 0) - if (write (tifd, tibuf[0], tibufsize) != tibufsize) - write_fatal (); - input_lines = line - 1; -} - -/* Fetch a line from the input file. - WHICHBUF is ignored when the file is in memory. */ - -char const * -ifetch (LINENUM line, bool whichbuf, size_t *psize) -{ - register char const *q; - register char const *p; - - if (line < 1 || line > input_lines) { - *psize = 0; - return ""; - } - if (using_plan_a) { - p = i_ptr[line]; - *psize = i_ptr[line + 1] - p; - return p; - } else { - LINENUM offline = line % lines_per_buf; - LINENUM baseline = line - offline; - - if (tiline[0] == baseline) - whichbuf = false; - else if (tiline[1] == baseline) - whichbuf = true; - else { - tiline[whichbuf] = baseline; - if (lseek (tifd, (off_t) (baseline/lines_per_buf * tibufsize), - SEEK_SET) == -1 - || read (tifd, tibuf[whichbuf], tibufsize) < 0) - read_fatal (); - } - p = tibuf[whichbuf] + (tireclen*offline); - if (line == input_lines) - *psize = last_line_size; - else { - for (q = p; *q++ != '\n'; ) - continue; - *psize = q - p; - } - return p; - } -} Property changes on: vendor/misc-GNU/patch/dist/inp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/README =================================================================== --- vendor/misc-GNU/patch/dist/README (revision 358868) +++ vendor/misc-GNU/patch/dist/README (nonexistent) @@ -1,54 +0,0 @@ -This version of `patch' has many changes made by the Free Software Foundation. -They add support for: - * handling arbitrary binary data and large files - * the unified context diff format that GNU diff can produce - * making GNU Emacs-style backup files - * improved interaction with RCS and SCCS - * the GNU conventions for option parsing and configuring and compilation. - * better POSIX compliance -They also fix some bugs. See the NEWS and ChangeLog files for details. - -Tutorial-style documentation for patch is included in the GNU -Diffutils package; get GNU Diffutils 2.8 or later for up-to-date -documentation for patch. - -For GNU and Unix build and installation instructions, see the file INSTALL. -Use `configure --disable-largefile' to disable large file support; -this is reportedly necessary on Red Hat GNU/Linux 6.0 to avoid a C library bug. -For MS-DOS using DJGPP tools, see the file pc/djgpp/README. -For other systems, copy config.hin to config.h and change -#undef statements in it to #define as appropriate for your system, -and copy Makefile.in to Makefile and set the variables that are -enclosed in @ signs as appropriate for your system. - -Please send bug reports for this version of patch to -. - -The Free Software Foundation is distributing this version of patch -independently because as of this writing, Larry Wall has not released a -new version of patch since mid-1988. We have heard that he has been -too busy working on other things, like Perl. He has graciously agreed -to let GNU `patch' be distributed under the terms of the GNU General -Public License. - ------- - -Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall - -Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1999, 2002 Free -Software Foundation, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this file; see the file COPYING. -If not, write to the Free Software Foundation, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/dist/README ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/error.h =================================================================== --- vendor/misc-GNU/patch/dist/error.h (revision 358868) +++ vendor/misc-GNU/patch/dist/error.h (nonexistent) @@ -1,78 +0,0 @@ -/* Declaration for error-reporting function - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _ERROR_H -#define _ERROR_H 1 - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__STDC__) && __STDC__ - -/* Print a message with `fprintf (stderr, FORMAT, ...)'; - if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). - If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ - -extern void error (int status, int errnum, const char *format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); - -extern void error_at_line (int status, int errnum, const char *fname, - unsigned int lineno, const char *format, ...) - __attribute__ ((__format__ (__printf__, 5, 6))); - -/* If NULL, error will flush stdout, then print on stderr the program - name, a colon and a space. Otherwise, error will call this - function without parameters instead. */ -extern void (*error_print_progname) (void); - -#else -void error (); -void error_at_line (); -extern void (*error_print_progname) (); -#endif - -/* This variable is incremented each time `error' is called. */ -extern unsigned int error_message_count; - -/* Sometimes we want to have at most one error per line. This - variable controls whether this mode is selected or not. */ -extern int error_one_per_line; - -#ifdef __cplusplus -} -#endif - -#endif /* error.h */ Property changes on: vendor/misc-GNU/patch/dist/error.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/stdbool.h.in =================================================================== --- vendor/misc-GNU/patch/dist/stdbool.h.in (revision 358868) +++ vendor/misc-GNU/patch/dist/stdbool.h.in (nonexistent) @@ -1,47 +0,0 @@ -/* Copyright (C) 2001-2002 Free Software Foundation, Inc. - Written by Bruno Haible , 2001. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _STDBOOL_H -#define _STDBOOL_H - -/* ISO C 99 for platforms that lack it. */ - -/* 7.16. Boolean type and values */ - -/* BeOS already #defines false 0, true 1. We use the same - definitions below, but temporarily we have to #undef them. */ -#ifdef __BEOS__ -# undef false -# undef true -#endif - -/* For the sake of symbolic names in gdb, define _Bool as an enum type. */ -#ifndef __cplusplus -# if !@HAVE__BOOL@ -typedef enum { false = 0, true = 1 } _Bool; -# endif -#else -typedef bool _Bool; -#endif -#define bool _Bool - -/* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 -#define __bool_true_false_are_defined 1 - -#endif /* _STDBOOL_H */ Property changes on: vendor/misc-GNU/patch/dist/stdbool.h.in ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/strncasecmp.c =================================================================== --- vendor/misc-GNU/patch/dist/strncasecmp.c (revision 358868) +++ vendor/misc-GNU/patch/dist/strncasecmp.c (nonexistent) @@ -1,2 +0,0 @@ -#define LENGTH_LIMIT -#include "strcasecmp.c" Property changes on: vendor/misc-GNU/patch/dist/strncasecmp.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/ChangeLog =================================================================== --- vendor/misc-GNU/patch/dist/ChangeLog (revision 358868) +++ vendor/misc-GNU/patch/dist/ChangeLog (nonexistent) @@ -1,2291 +0,0 @@ -2003-05-20 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.9 released. - - * Makefile.in (HDRS): Add gettext.h. - - Use bool, not int, for booleans. - - * pch.c (pch_says_nonexistent): Returns int, not bool. - - * configure.ac: Add AM_STDBOOL_H. - - * Makefile.in (MISC): Add stdbool.h.in. - (stdbool.h): New rule. - (ACINCLUDE_INPUTS): Add stdbool.m4. - (mostlyclean): Remove stdbool.h. - (COMMON): New macro; use it instead of common.h for dependencies. - - * common.h: Include . - Remove TRUE, FALSE, bool. All uses changed to standard names. - - * common.h (reverse, set_time, set_utc): - Use bool, not int, for booleans. - * pch.c (p_strip_trailing_cr, p_pass_comments_through, - prefix_components, pget_line, re_patch, - there_is_another_patch, intuit_diff_type, scan_linenum, - another_hunk, pget_line, pch_timestamp): Likewise. - * inp.h (ifetch): Likewise. - * util.c (move_file, version_controller, version_get, ok_to_reverse, - set_signals): Likewise. - * inp.c (report_revision, get_input_file, plan_a, plan_b, ifetch): - Likewise. - * util.h (ok_to_reverse, version_controller, version_get, - move_file, set_signals): Likewise. - * pch.h (another_hunk, pch_says_nonexistent, pch_timestamp): - Likewise. - * patch.c (struct outstate, numeric_string, make_backups, - backup_if_mismatch, remove_empty_files, - reverse_flag_specified, main, reinitialize_almost_everything, - get_some_switches, apply_hunk, init_output, copy_till): - Likewise. - -2003-05-18 Paul Eggert - - * pch.c (p_pass_comments_through): New var. - (pget_line): Accept new arg for pass_comments_through. - All callers changed. - (there_is_another_patch): Do not suggest -p for ed diffs. - (intuit_diff_type): Check ed command for correct syntax. - Do not set p_strip_trailing_cr merely because a -p line contains a CR. - (get_ed_command_letter): New function. - (do_ed_script): Use it. Do not treat '#' data lines as comments in ed - scripts. - - * util.c (move_file): - Don't assume that when 'rename(A,B)' succeeds then A no - longer exists. This is not true of POSIX 1003.1-2001 rename when A - and B are links to the same file. - (fetchname): Fix test for file names with internal spaces. - - * version.c: Don't include patchlevel.h. - (version): Use PACKAGE_NAME and PACKAGE_VERSION instead of obsolete - PROGRAM_NAME and PATCH_VERSION. - (copyright_string): Bump to 2003. - - * common.h (FILESYSTEM_PREFIX_LEN, ISSLASH): - Remove; now done by 'configure'. - (PROGRAM_NAME): Remove; now done by 'configure' as PACKAGE_NAME. - - * patch.c: Do not include . - (main): Set xalloc_exit_failure, not exit_failure. - Add "&& !skip_rest_of_patch" when deciding to continue ed scripts. - (option_help): Use PACKAGE_BUGREPORT rather than hardcoding. - - * configure.ac (AC_PREREQ): Bump to 2.57. - (AC_GNU_SOURCE): Add, early on. - (gl_BACKUPFILE, gl_DIRNAME, gl_ERROR, gl_FUNC_MEMCHR, gl_FUNC_RMDIR, - gl_GETOPT, gl_PREREQ_XMALLOC, gl_QUOTE, gl_QUOTEARG): Add. - (jm_PREREQ_ADDEXT): Add, with definition. - (jm_PREREQ_DIRNAME, jm_PREREQ_ERROR, jm_PREREQ_MEMCHR, - jm_PREREQ_QUOTEARG): Remove. - (AC_REPLACE_FUNCS): Remove memchr, rename, rmdir). - (jm_FUNC_GLIBC_UNLOCKED_IO, jm_AC_DOS): Add. - (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Do not call directly. - (AC_OUTPUT): Use new style, with AC_CONFIG_FILES. - - Update to current CVS gnulib. - - * exitfail.c, exitfail.h, patchlevel.h, rename.c, m4/c-bs-a.m4, - m4/jm-glibc-io.m4, m4/prereq.m4: Remove. - * m4/backupfile.m4, m4/dirname.m4, m4/dos.m4, m4/getopt.m4, - m4/memchr.m4, m4/onceonly.m4, m4/quote.m4, m4/quotearg.m4, - m4/rmdir.m4, m4/unlocked-io.m4, m4/xalloc.m4: New files. - * Makefile.in (LIBSRCS): Move error.c here from SRCS. - Remove rename.c. - (OBJS): Remove error.$(OBJEXT). - (HDRS): Remove exitfail.h, patchlevel.h. - (ACINCLUDE_INPUTS): Remove c-bs-a.m4, jm-glibc-io.m4, prereq.m4. - Add backupfile.m4, dirname.m4, dos.m4, getopt.m4, memchr.m4, - onceonly.m4, quote.m4, quotearg.m4, rmdir.m4, unlocked-io.m4, - xalloc.m4. - (patchlevel.h): Remove. All uses removed. - (argmatch.$(OBJEXT), error.$(OBJEXT), quotesys.$(OBJEXT)), - xmalloc.$(OBJEXT)): Depend on gettext.h. - (dirname.$(OBJEXT), quote.$(OBJEXT), strncasecmp.$(OBJEXT)): New rules. - (patch.$(OBJEXT), xmalloc.$(OBJEXT)): Remove exitfail.h. - (rename.$(OBJEXT)): Remove. - (version.$(OBJEXT)): Remove util.h. - (xmalloc.$(OBJEXT)): Add error.h. - -2002-11-23 Paul Eggert - - * patch.c (main): Don't check for zero-sized file after 'ed' - when skipping patch. From Michael Fedrowitz. - -2002-06-03 Paul Eggert - - * configure.ac (AC_OUTPUT): Use new form, with AC_CONFIG_FILES, - instead of obsolescent form. Patch from Art Haas. - - * pch.c (intuit_diff_type): Do not warn about trailing white space - after Prereq: word. Bug reported by Mike Castle. - -2002-06-02 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.8 released. - - * README: POSIX.2 -> POSIX. - * inp.c (report_revision): Don't modify 'revision', since - it gets freed later. Bug reported by Mike Castle. - -2002-05-30 Paul Eggert - - * NEWS, configure.ac (AC_INIT): Version 2.5.7 released. - - * Makefile.in (MISC): Remove README-alpha. - (patchlevel.h): Depend on configure, not configure.ac. - - * INSTALL: Upgrade to Autoconf 2.53 version. - -2002-05-28 Paul Eggert - - * patch.c (end_defined, apply_hunk): Output #endif without - the comment, as POSIX 1003.1-2001 requires. - - * pch.c (there_is_another_patch): Flush stderr after perror. - - * NEWS, configure.ac (AC_INIT): Version 2.5.6 released. - - * strcasecmp.c, strncasecmp.c: New files, taken from fileutils. - * config.guess, config.sub: Remove. - * Makefile.in (LIBSRCS): Add strcasecmp.c, strncasecmp.c. - (MISC): Remove config.guess, config.sub. - - The code already assumes C89 or better, so remove K&R stuff. - * common.h (volatile): Remove. - (GENERIC_OBJECT): Remove; all uses changed to 'void'. - (PARAMS): Remove; all uses changed to prototypes. - * configure.ac (AC_PROG_CC_STDC): Add. - * util.c (vararg_start): Remove. All uses changed to va_start. - Always include . - - * configure.ac (AC_CANONICAL_HOST): Remove. - (AC_REPLACE_FUNCS): Add strncasecmp. - (AC_CHECK_DECLS): Add mktemp. - - * patch.c (main): Remove useless prototype decl. - (mktemp): Don't declare if HAVE_DECL_MKTEMP || defined mktemp. - (make_temp): Now accepts char, not int. - -2002-05-26 Paul Eggert - - * patch.c (not_defined): Prepend newline. All uses changed. - (apply_hunk): Fix bug: -D was outputting #ifdef when it should - have been outputting #ifndef. Bug report and partial fix by - Jason Short. - - * pch.c (intuit_diff_type): When reading an ed diff, don't use - indent and trailing-CR-ness of "." line; instead, use that of the - command. Bug reported by Anthony Towns; partial fix by Michael - Fedrowitz. - (intuit_diff_type): If the index line exists, don't report a - missing header. Fix by Chip Salzenberg. - -2002-05-26 Alessandro Rubini - - * patch.c (locate_hunk): Fixed updating of last_offset. - -2002-05-25 Paul Eggert - - * NEWS, README: Diffutils doc is up to date now. - Bug reporting address is now . - * README: Describe '--disable-largefile'. - - * NEWS-alpha, dirname.c, dirname.h, exitfail.c, exitfail.h, - quote.c, quote.h, unlocked-io.h: New files, taken from diffutils - and fileutils. - - * argmatch.c: [STDC_HEADERS]: Include stdlib.h, for 'exit'. - - * addext.c, argmatch.c, argmatch.h, backupfile.c, basename.c: - Update from diffutils and fileutils. - - * ansi2knr.1, ansi2knr.c: Remove. - - * common.h: HAVE_SETMODE && O_BINARY -> HAVE_SETMODE_DOS. - * patch.c (usage): Likewise. - * pch.c (open_patch_file): Likewise. - - * configure.ac: Renamed from configure.in. Add copyright notice. - (AC_PREREQ): Bump to 2.53. - (AC_INIT): Use 2.5x style. - (AC_CONFIG_SRCDIR): Add. - (PACKAGE, VERSION): Remove. - (AC_C_PROTOTYPES): Use this instead of AM_C_PROTOTYPES. - (jm_CHECK_TYPE_STRUCT_UTIMBUF): Use this instead of jm_STRUCT_UTIMBUF. - (jm_PREREQ_ADDEXT, jm_PREREQ_DIRNAME, jm_PREREQ_ERROR, - jm_PREREQ_MEMCHR, jm_PREREQ_QUOTEARG): Add. - (AC_CHECK_DECLS): Add free, getenv, malloc. - (AC_CHECK_FUNCS): Remove setmode. - (AC_FUNC_SETMODE_DOS): Add. - (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use this instead of - jm_STRUCT_DIRENT_D_INO. - - * Makefile.in (OBJEXT): New var. - (PACKAGE_NAME): Renamed from PACKAGE. All uses changed. - (PACKAGE_VERSION): Renamed from VERSION. All uses changed. - (U): Remove. All uses of "$U.o" changed to ".$(OBJEXT)". - (LIBSRCS): REmove getopt.c getopt1.c. Add mkdir.c, rmdir.c. - (SRCS): Add dirname.c, exitfail.c, getopt.c, getopt1.c, quote.c. - Remove mkdir.c. - (OBJS): Keep in sync with SRCS. - (HDRS): Remove basename.h. - Add dirname.h, exitfail.h, quote.h, unlocked-io.h. - (MISC, configure, config.hin, patchlevel.h): - configure.ac renamed from configure.in. - (MISC): Add README-alpha. Remove ansi2knr.1, ansi2knr.c. - (.c.$(OBJEXT)): Renamed from .c.o. - (ACINCLUDE_INPUTS): Add c-bs-a.m4, error.m4, jm-glibc-io.m4, - mbstate_t.m4, mkdir.m4, mbrtowc.m4, prereq.m4, setmode.m4. - Remove ccstdc.m4, inttypes_h.m4, largefile.m4, protos.m4. - (mostlyclean): Don't clean ansi2knr. - (ansi2knr.o, ansi2knr): Remove. - Redo dependencies. - - * patch.c: Include . - (main): Initialize exit_failure. - - * patch.man: Update copyright notice. - - * pch.c, util.c: Include , not . - - * version.c (copyright_string): Update copyright notice. - -2002-02-17 Paul Eggert - - * partime.c (parse_pattern_letter): Don't overrun buffer if it - contains only alphanumerics. Bug reported by Winni - . - -2001-07-28 Paul Eggert - - * util.c (fetchname), NEWS: - Allow file names with internal spaces, so long as they - don't contain tabs. - - * pch.c (intuit_diff_type): Do not allow Prereq with multiple words. - - * configure.in (AC_PREREQ): Bump to 2.50. - (AC_CHECK_FUNCS): Remove fseeko. - (AC_FUNC_FSEEKO): Add. - * Makefile.in (ACINCLUDE_INPUTS): - Remove largefile.m4; no longer needed with Autoconf 2.50. - -2001-02-07 "Tony E. Bennett" - - * util.c (PERFORCE_CO): New var. - (version_controller): Support Perforce. - * patch.man: Document this. - -2000-06-30 Paul Eggert - - * patch.man: Ignore comment lines. - - * NEWS, pch.c: Ignore lines beginning with "#". - -1999-10-24 Paul Eggert - - * pch.c (another_hunk): Report a fatal error if a regular - context hunk's pattern has a different number of unchanged - lines than the replacement. - -1999-10-18 Paul Eggert - - * patch.c (main): If we skipped an ed patch, exit with nonzero status. - -1999-10-17 Paul Eggert - - * patch.c (main): Apply do_ed_script even if dry_run, because - we need to make progress on the patch file. - * pch.c (do_ed_script): If skip_rest_of_patch is nonzero, - gobble up the patch without any other side effect. - -1999-10-12 Paul Eggert - - * NEWS, README: New bug reporting address. - * NEWS: Report change in 2.5.4 that we forgot to document. - * README: Document `configure --disable-largefile'. - - * basename.c, COPYING, getopt.c, getopt.h, getopt1.c, m4/largefile.m4: - Update to latest version. - * Makefile.in (basename$U.o): Depend on basename.h. - (config.hin): Depend on $(srcdir)/aclocal.m4. - - * ansi2knr.c, maketime.c, mkinstalldirs, partime.c: Fix $Id. - - FreeBSD has an unrelated setmode function; work around this. - * common.h (binary_transput): Don't declare unless O_BINARY. - * patch.c (option_help, get_some_switches): - Don't use setmode unless O_BINARY. - * pch.c (open_patch_file): Don't invoke setmode unless O_BINARY. - - Fix incompatiblities with error.c. - * common.h (program_name): Now XTERN char *, for compatibility - with error.c. All uses changed. - (PROGRAM_NAME): New macro. - (PARAMS): Use ANSI C version only if defined PROTOTYPES - || (defined __STDC__ && __STDC__), for compatibilty with error.c. - * util.c (vararg_start): Likewise. - * patch.c (program_name): Remove. - (main): Initialize program_name. - * version.c (version): Print PROGRAM_NAME, not program_name. - - Accommodate mingw32 port, which has one-argument mkdir (yuck!) - and no geteuid. - * m4/mkdir.m4: New file. - * Makefile.in (ACINCLUDE_INPUTS): Add $(M4DIR)/mkdir.m4. - * configure.in (AC_CHECK_FUNCS): Add geteuid, getuid. - (PATCH_FUNC_MKDIR_TAKES_ONE_ARG): Add. - * common.h (mkdir): Define if mkdir takes one arg. - (geteuid): New macro, if not already defined. - -1999-10-11 Christopher R. Gabriel - - * patch.c (option_help): Updated bug report address - * configure.in (VERSION): Version 2.5.5 released. - -1999-09-01 Paul Eggert - - * patch.c (main): Default simple_backup_suffix to ".orig". - -1999-10-08 Paul Eggert - - * patch.man: Make it clear that `patch -o F' should not be - used if F is one of the files to be patched. - -1999-08-30 Paul Eggert - - Version 2.5.4 fixes a few minor bugs, converts C sources to - ANSI prototypes, and modernizes auxiliary sources and autoconf - scripts. - - * configure.in (VERSION): Version 2.5.4 released. - (AC_CANONICAL_HOST): Add. - (AC_SYS_LARGEFILE): Add, replacing inline code. - (AC_EXEEXT): Add. - (jm_AC_HEADER_INTTYPES_H): Add, replacing inline code. - (AC_TYPE_PID_T): Add. - (jm_STRUCT_UTIMBUF): Add, replacing inline code. - (HAVE_MEMCHR): Remove obsolescent test; nobody uses NetBSD 1.0 now. - (getopt_long): Append $U to object file basenames. - (AC_CHECK_FUNCS): Add fseeko, setmode. Remove mkdir. - (AC_REPLACE_FUNCS): Add mkdir, rmdir. - (jm_STRUCT_DIRENT_D_INO): Add, replacing inline code. - - * Makefile.in (EXEEXT): New macro. - (mandir): New macro. - (man1dir): Define in terms of mandir. - (SRCS): Add mkdir.c, rmdir.c. - (OBJS): Change .o to $U.o for addext, argmatch, backupfile, basename, - error, inp, patch ,,pch, quotearg, util, version, xmalloc. - (HDRS): Add basename.h, patchlevel.h. - (MISC): Add ansi2knr.1, config.guess, config.sub. - (MISC, config.hin): Remove acconfig.h; no longer needed. - (DISTFILES_M4): New macro. - (all): patch -> patch$(EXEEXT). - (patch$(EXEEXT)): Renamed from patch. All uses changed. - (uninstall): Remove manual page. - (configure): Depend on aclocal.m4. - (M4DIR, ACINCLUDE_INPUTS): New macros. - ($(srcdir)/aclocal.m4): New rule. - (patchlevel.h): Depend on configure.in, not Makefile, - since we now distribute it. - (distclean): Don't remove patchlevel.h. - (dist): Distribute $(DISTFILES_M4). - (addext_.c argmatch_.c backupfile_.c basename_.c error_.c - getopt_.c getopt1_.c inp_.c malloc_.c mkdir_.c patch_.c pch_.c - rename_.c util_.c version_.c xmalloc_.c): Depend on ansi2knr. - Update dependencies to match sources. - - * common.h (_LARGEFILE_SOURCE): Remove; now autoconfigured. - (file_offset): Depend on HAVE_FSEEKO, not _LFS_LARGEFILE. - - * patch.c (version_control_context): New variable. - Convert to ANSI prototypes. - Adjust to new argmatch calling convention. - Similarly for get_version. - Complain about creating an existing file only if - pch_says_nonexistent returns 2 (not merely nonzero). - Similarly for time mismatch check. - (get_some_switches): Adjust to new get_version calling convention. - Similarly for argmatch. - - * pch.c (): Include. - (intuit_diff_type): Improve quality of test for empty file. - (another_hunk): Don't assume off_t is no longer than long. - - * util.h (backup_type): New decl. - * util.c (): Include. - (move_file): Adjust to new find_backup_file_name convention. - (doprogram, mkdir, rmdir): Remove; now in separate files. - (fetchame): Match "/dev/null", not NULL_DEVICE. - Ignore names that don't have enough slashes to strip off. - - * version.c: Update copyright notice. - -1998-03-20 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.3. - * quotearg.h (quotearg_quoting_options): - Remove; it ran afoul of the Borland C compiler. - Its address is now represented by the null pointer. - * quotearg.c (default_quoting_options): - Renamed from quotearg_quoting_options, - and now static instead of extern. - (clone_quoting_options, get_quoting_style, set_quoting_style, - set_char_quoting, quotearg_buffer): - Use default_quoting_options when passed a null pointer. - * patch.c (main, get_some_switches): - Pass a null pointer instead of address of quotearg_quoting_options. - -1998-03-17 Paul Eggert - - * patch.c (option_help): Update bug reporting address to gnu.org. - * patch.man: Fix copyright and bug reporting address. - -1998-03-16 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.2. - (AC_CHECK_FUNCS): Add strerror. - (jm_FUNC_MALLOC, jm_FUNC_REALLOC): Add. - (AM_C_PROTOTYPES): Add. - - * NEWS, patch.c (longopts, get_some_switches), patch.man: - Add --quoting-style, --posix options. - - * Makefile.in (LIBSRCS): Add malloc.c, realloc.c. - (SRCS): Add error.c, quotesys.c, xmalloc.c. - (OBJS): Likewise. - (HDRS): Add error.h, quotesys.h, xalloc.h. - (MISC): Add AUTHORS, aclocal.m4, ansi2knr.c. - (clean): Use mostlyclean rule. - (argmatch.o, inp.o, patch.o, pch.o): Now also depends on quotearg.h. - (inp.o, patch.o, util.o): Now also depends on xalloc.h. - (error.o, quotearg.o, quotesys.o, xmalloc.o, - ansi2knr.o, ansi2knr, quotearg_.c, .c_.c): New rules. - (U): New macro. - (OBJS, quotearg$U.o): Rename quotearg.o to quotearg$U.o. - (mostlyclean): Remove ansi2knr, *_.c. - (.SUFFIXES): Add _.c. - - * acconfig.h (PROTOTYPES): New undef. - - * acconfig.h, configure.in (HAVE_INTTYPES_H, malloc, realloc): - New macros. - - * aclocal.m4, error.c, error.h, malloc.c, - quotearg.h, quotearg.c, realloc.c, xalloc.h, xmalloc.c: New files. - - * argmatch.c: Include before . - Include . - - * argmatch.c (invalid_arg), - inp.c (scan_input, report_revision, too_many_lines, get_input_file, - plan_a), - patch.c (main, get_some_switches, numeric_string), - pch.c (open_patch_file, intuit_diff_type, do_ed_script): - util.c (move_file, create_file, copy_file, version_get, removedirs): - Quote output operands properly. - - * common.h: Include if available. - (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, - CHAR_MAX, INT_MAX, LONG_MIN, SIZE_MAX, O_EXCL): New macros. - (TMPINNAME_needs_removal, TMPOUTNAME_needs_removal, - TMPPATNAME_needs_removal): New variables. - (xmalloc): Remove decl; now in xalloc.h. - - * inp.c: Include , . - - * inp.c (get_input_file), - pch.c (intuit_diff_type), - util.c (version_controller): - Don't do diff operation if diffbuf is null; used by ClearCase support. - - * inp.c (plan_b), - patch.c (init_reject), - pch.c (open_patch_file, do_ed_script): - Create temporary file with O_EXCL to avoid races. - - * patch.c: Include , . - (create_output_file, init_output): New open_flags arg. - All callers changed. - (init_reject): No longer takes filename arg. All callers changed. - (remove_if_needed): New function. - (cleanup): Use it to remove temporary files only if needed. - (TMPREJNAME_needs_removal): New var. - (main): Set xalloc_fail_func to memory_fatal; needed for xalloc. - Initialize quoting style from QUOTING_STYLE. - (longopts, get_some_switches): Offset longarg options by CHAR_MAX, - not 128; this is needed for EBCDIC ports. - - * patch.c (main, locate_hunk, abort_hunk, spew_output), - pch.c (there_is_another_patch, intuit_diff_type, malformed, - another_hunk): - The LINENUM type now might be longer than long, - so print and read line numbers more carefully. - - * patch.c (main), - pch.c (there_is_another_patch): - util.c (fetchname): - strippath now defaults to -1, so that we can distinguish unset - value from largest possible. - - * patch.man: Clarify how file name is chosen from candidates. - - * pch.c: Include . - (p_strip_trailing_cr): New variable. - (scan_linenum): New function. - (pget_line, re_patch, there_is_another_patch, intuit_diff_type, - get_line): Strip trailing CRs from context diffs that need this. - (best_name): Use SIZE_MAX instead of (size_t) -1 for max size_t. - - * quotesys.c, quotearg.h: Renamed from quotearg.c and quotearg.h. - All uses changed. - * quotesys.h (__QUOTESYS_P): Renamed from __QUOTEARG_P. - - * util.c: Include , . - (raise): Don't define if already defined. - (move_file): New arg from_needs_removal. All callers changed. - (copy_file): New arg to_flags. All callers changed. - (CLEARTOOL_CO): New constant. - (version_controller): Add ClearCase support. - (format_linenum): New function. - (fetchname): Allow any POSIX.1 time zone spec, which means - any local time offset in the range -25:00 < offset < +26:00. - Ignore the name if it doesn't have enough slashes to strip off. - (xmalloc): Remove; now in xmalloc.c. - - * util.h (LINENUM_LENGTH_BOUND): New macro. - (format_linenum): New decl. - - * version.c (copyright_string): Update years of copyrights. - -1997-09-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.5.1. - * inp.c (re_input): Don't free buffers twice when input is garbled. - * patch.c (main): If skipping patch and Plan A fails, don't - bother trying Plan B. - -1997-08-31 Paul Eggert - - * configure.in (VERSION): Version 2.5 released. - -1997-07-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.4. - * pch.c (there_is_another_patch), NEWS: Report an error if the patch - input contains garbage but no patches. - - * pch.c (open_patch_file): - Check for patch file too long (i.e., its size - doesn't fit in a `long', and LFS isn't available). - - * inp.c (plan_a): - Cast malloc return value, in case malloc returns char *. - -1997-07-16 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.3. - - * NEWS, patch.man, pch.c (intuit_diff_type, get_line, pget_line): - Now demangles RFC 934 encapsulation. - * pch.c (p_rfc934_nesting): New var. - - * pch.c (intuit_diff_type): Don't bother to check file names carefully - if we're going to return NO_DIFF. - - * inp.c (plan_a): Count the number of lines before allocating - pointer-to-line buffer; this reduces memory requirements - considerably (roughly by a factor of 5 on 32-bit hosts). - Decrease `size' only when read unexpectedly reports EOF. - (i_buffer): New var. - (too_many_lines): New fn. - (re_input): Free i_buffer if using plan A. - Free buffers unconditionally; they can't be zero. - - * inp.c (plan_a, plan_b): Check for overflow of line counter. - - * pch.c (malformed), util.h (memory_fatal, read_fatal, write_fatal): - Declare as noreturn. - -1997-07-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.2. - - * util.c (ok_to_reverse), NEWS: The default answer is now `n'; - this is better for Emacs. - - * Makefile.in (dist): Use cp -p, not ln; - some hosts do the wrong thing with ln if the source is a symbolic link. - - * patch.man: Fix typo: -y -> -Y. - -1997-07-05 Paul Eggert - - * configure.in (VERSION): Bump to 2.4.1. - - * patch.c: (main, get_some_switches), NEWS, patch.man: - Version control is now independent of whether backups are made. - * patch.c (option_help): Put version control options together. - (get_some_switches): With CVS 1.9 hack, treat -b foo like -b -z foo, - not just -z foo. This change is needed due to recent change in -z. - * backupfile.c (find_backup_file_name): - backup_type == none causes undefined behavior; - this undoes the previous change to this file. - - * patch.c (locate_hunk): Fix bug when locating context diff hunks - near end of file with nonzero fuzz. - - * util.c (move_file): Don't assume that ENOENT is reported when both - ENOENT and EXDEV apply; this isn't true with DJGPP, and - Posix doesn't require it. - - * pch.c (there_is_another_patch): - Suggest -p when we can't intuit a file. - -1997-06-19 Paul Eggert - - * configure.in (VERSION): Version 2.4 released. - * NEWS: Patch is now verbose when patches do not match exactly. - -1997-06-17 Paul Eggert - - * pc/djgpp/configure.sed (config.h): Remove redundant $(srcdir). - - * configure.in (VERSION): Bump to 2.3.9. - * patch.c (main): By default, warn about hunks that succeed - with nonzero offset. - * patch.man: Add LC_ALL=C advice for making patches. - * pc/djgpp/configure.sed (config.h): Fix paths to dependent files. - -1997-06-17 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.8. - - * pch.c (open_patch_file): Test stdin for fseekability. - (intuit_diff_type): Missing context diff headers are now warnings, - not errors; some people use patches with them (e.g. when retrying - rejects). - - * patch.c (struct outstate): - New type, collecting together some output state vars. - (apply_hunk, copy_till, spew_output, init_output): Use it. - Keep track of whether some output has been generated. - (backup_if_mismatch): New var. - (ofp): Remove, in favor of local struct outstate vars. - (main): Use struct outstate. Initialize backup_if_mismatch to - be the inverse of posixly_correct. Keep track of whether mismatches - occur, and use this to implement backup_if_mismatch. - Report files that are not empty after patching, but should be. - (longopts, option_help, get_some_switches): New options - --backup-if-mismatch, --no-backup-if-mismatch. - (get_some_switches): -B, -Y, -z no longer set backup_type. - * backupfile.c (find_backup_file_name): - Treat backup_type == none like simple. - - * Makefile.in (CONFIG_HDRS): - Remove var; no longer needed by djgpp port. - (DISTFILES_PC_DJGPP): Rename pc/djgpp/config.sed to - pc/djgpp/configure.sed; remove pc/djgpp/config.h in favor of - new file that edits it, called pc/djgpp/config.sed. - * pc/djgpp/configure.bat: Rename config.sed to configure.sed. - * pc/djgpp/configure.sed (CONFIG_HDRS): Remove. - (config.h): Add rule to build this from config.hin and - pc/djgpp/config.sed. - * pc/djgpp/config.sed: - Convert from .h file to .sed script that generates .h file. - - * NEWS: Describe --backup-if-mismatch, --no-backup-if-mismatch. - * patch.man: - Describe new options --backup-if-mismatch, --no-backup-if-mismatch - and their ramifications. Use unreadable backup to represent - nonexistent file. - -1997-06-12 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.7. - (AC_CHECK_FUNCS): Add `raise'. - - * Makefile.in (inp.o): No longer depends on quotearg.h. - - * common.h (outfile): New decl (was private var named `output'). - (invc): New decl. - (GENERIC_OBJECT): Renamed from VOID. - (NULL_DEVICE, TTY_DEVICE): New macros. - - * patch.c (output): Remove; renamed to `outfile' and moved to common.h. - (main): `failed' is count, not boolean. - Say "Skipping patch." when deciding to skip patch. - (get_some_switches): Set invc when setting inname. - - * inp.c: Do not include . - (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF1, SCCSDIFF2, SCCSDIFF3, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1, RCSDIFF2): - Move to util.c. - (get_input_file): Invoke new functions version_controller and - version_get to simplify this code. - (plan_b): "/dev/tty" -> NULL_DEVICE - - * pch.h (pch_timestamp): New decl. - * pch.c (p_timestamp): New var; takes over from global timestamp array. - (pch_timestamp): New function to export p_timestamp. - (there_is_another_patch): Use blander wording when you can't intuit - the file name. - Say "Skipping patch." when deciding to skip patch. - (intuit_diff_type): Look for version-controlled but nonexistent files - when intuiting file names; set invc accordingly. - Ignore Index: line if either old or new line is present, and if - POSIXLY_CORRECT is not set. - (do_ed_script): Flush stdout before invoking popen, since it may - send output to stdout. - - * util.h (version_controller, version_get): New decls. - * util.c: Include earlier. - (raise): New macro, if ! HAVE_RAISE. - (move_file): Create empty unreadable file when backing up a nonexistent - file. - (DEV_NULL): New constant. - (SCCSPREFIX, GET. GET_LOCKED, SCCSDIFF1, SCCSDIFF2, - RCSSUFFIX, CHECKOUT, CHECKOUT_LOCKED, RCSDIFF1): Moved here from inp.c. - (version_controller, version_get): New functions. - (ask): Look only at /dev/tty for answers; and when standard output is - not a terminal and ! posixly_correct, don't even look there. - Remove unnecessary fflushes of stdout. - (ok_to_reverse): Say "Skipping patch." when deciding to skip patch.. - (sigs): SIGPIPE might not be defined. - (exit_with_signal): Use `raise' instead of `kill'. - (systemic): fflush stdout before invoking subsidiary command. - - * patch.man: Document recent changes. - Add "COMPATIBILITY ISSUES" section. - - * NEWS: New COMPATIBILITY ISSUES for man page. - Changed verbosity when fuzz is found. - File name intuition is changed, again. - Backups are made unreadable when the file did not exist. - - * pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): Define. - (HAVE_RAISE): New macro. - (HAVE_UTIME_H): Define. - (TZ_is_unset): Do not define; it's not a serious problem with `patch' - to have TZ be unset in DOS. - -1997-06-08 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.6. - (AC_CHECK_HEADERS): Add utime.h. - * acconfig.h, configure.in, pc/djgpp/config.h (HAVE_STRUCT_UTIMBUF): - New macro. - * pc/djgpp/config.h (HAVE_UTIME_H, TZ_is_unset): New macros. - - * NEWS, patch.man: Describe new -Z, -T options, new numeric - option for -G, retired -G, and more verbose default behavior - with fuzz. - - * pch.c (intuit_diff_type): Record times reported for files in headers. - Remove head_says_nonexistent[x], since it's now equivalent to - !timestamp[x]. - * util.h (fetchname): Change argument head_says_nonexistent to - timestamp. - * util.c: #include for TM_LOCAL_ZONE. - Don't include since common.h now includes it. - (ok_to_reverse): noreverse and batch cases now output regardless of - verbosity. - (fetchname): Change argument head_says_nonexistent to pstamp, and - store header timestamp into *pstamp. - If -T or -Z option is given, match time stamps more precisely. - (ask): Remove unnecessary close of ttyfd. - When there is no terminal at all, output a newline to make the - output look nicer. After reporting EOF, flush stdout; - when an input error, report the error type. - - * inp.c (get_input_file): - Ask user whether to get file if patch_get is negative. - - * Makefile.in (clean): Don't clean */*.o; clean core* and *core. - -1997-06-04 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.5. - - * util.c (ok_to_reverse): - Be less chatty if verbosity is SILENT and we don't - have to ask the user. If force is nonzero, apply the patch anyway. - - * pch.c (there_is_another_patch): - Before skipping rest of patch, skip to - the patch start, so that another_hunk can skip it properly. - (intuit_diff_type): Slight wording change for missing headers, to - regularize with other diagnostics. Fix off-by-one error when setting - p_input_line when scanning the first hunk to check for deleted files. - -1997-06-03 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.4. - - * NEWS: Now matches more generously against nonexistent or empty files. - - * pch.c (there_is_another_patch): Move warning about not being - able to intuit file names here from skip_to. - (intuit_diff_type): Fatal error if we find a headless unified - or context diff. - - * util.c (ask): Null-terminate buffer properly even if it grew. - (fetchname): No need to test for null first argument. - -1997-06-02 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.3. - * pch.c (p_says_nonexistent, pch_says_nonexistent): Is now 1 for empty, - 2 for nonexistent. - (intuit_diff_type): Set p_says_nonexistent according to new meaning. - Treat empty files like nonexistent files when reversing. - (skip_to): Output better diagnostic when we can't intuit a file name. - * patch.c (main): - Count bytes, not lines, when testing whether a file is empty, - since it may contain only non-newline chars. - pch_says_nonexistent now returns 2 for nonexistent files. - -1997-06-01 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.2. - * pch.c (open_patch_file): - Fix bug when computing size of patch read from a pipe. - -1997-05-30 Paul Eggert - - * configure.in (VERSION): Bump to 2.3.1. - - * Makefile.in (transform, patch_name): New vars, - for proper implementation of AC_ARG_PROGRAM. - (install, uninstall): Use them. - (install-strip): New rule. - * pc/djgpp/config.sed (program_transform_name): Set to empty. - -1997-05-30 Paul Eggert - - * configure.in (VERSION), NEWS: Version 2.3 released. - * patch.man: Fix two font typos. - * util.c (doprogram): Fix misspelled decl. - -1997-05-26 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.93. - - * pch.c (open_patch_file): - Fatal error if binary_transput and stdin is a tty. - - * pc/djgpp/config.sed (chdirsaf.c): - Use sed instead of cp, since cp might not be installed. - * pc/djgpp/configure.bat: - Prepend %srcdir% to pathname of config.sed, for crosscompiles. - -1997-05-25 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.92. - (D_INO_IN_DIRENT): New macro. - * pc/djgpp/config.h, acconfig.h (D_INO_IN_DIRENT): New macro. - * backupfile.c (REAL_DIR_ENTRY): - Depend on D_INO_IN_DIRENT, not _POSIX_VERSION. - - * addext.c (addext): Adjust slen when adjusting s for DOS 8.3 limit. - Do not use xxx.h -> xxxh~ hack. - - * util.c: (move_file): Avoid makedirs test when possible even - if FILESYSTEM_PREFIX_LEN (p) is nonzero. Don't play - case-changing tricks to come up with backup file name; it's - not portable to case-insensitive file systems. - * common.h (ISLOWER): Remove. - - * inp.c (scan_input): Don't use Plan A if (debug & 16). - - * patch.c (shortopts): Add -g, -G. - (longopts): --help now maps to 132, not 'h', to avoid confusion. - (get_some_switches): Likewise. - Don't invoke setmode on input if --binary; wait until needed. - Don't ever invoke setmode on stdout. - * pch.c (open_patch_file): Setmode stdin to binary if binary_transput. - - * patch.man: Fix documentation of backup file name to match behavior. - Add advice for ordering of patches of derived files. - Add /dev/tty to list of files used. - * README: Adjust instructions for building on DOS. - * pc/djgpp/README: Remove tentative wording. - * NEWS: The DOS port is now tested. - Backup file names are no longer computed by switching case. - - * pc/chdirsaf.c (ERANGE): Include to define it. - (restore_wd): chdir unconditionally. - (chdir_safer): Invoke atexit successfully at most once. - * pc/djgpp/config.sed: Use chdirsaf.o, not pc/chdirsaf.o. - Replace CONFIG_HDRS, don't append. - Use $(srcdir) in CONFIG_STATUS. - Don't apply $(SHELL) to $(CONFIG_STATUS). - Append rules for chdirsaf.o, chdirsaf.c; clean chdirsaf.c at the end. - * pc/djgpp/configure.bat: Append CR to each line; DOS needs this. - Don't use | as sed s delimiter; DOS can't handle it. - -1997-05-21 Paul Eggert - - * configure.in (VERSION): Bump to 2.2.91. - - * pch.c (another_hunk): - Fix bug with computing size of prefix and suffix context - with ordinary context diffs. Report malformed patch if a unified diff - has nothing but context. - - * inp.c (get_input_file): - Use patch_get, not backup_type, to decide whether to - get from RCS or SCCS. Use the word `get' in diagnostics. - * patch.c (main): Initialize patch_get from PATCH_GET. - Omit DEFAULT_VERSION_CONTROL hook; it just leads to nonstandarization. - (longopts, option_help, get_some_switches): Add support for -g, -G. - (option_help): Add bug report address. - * common.h (patch_get): New decl. - * patch.man: Add -g and -G options; use `get' instead of `check out'. - Add PATCH_GET. Recommend -Naur instead of -raNU2 for diff. - * NEWS: Describe -g, -G, PATCH_GET. - - * version.c (copyright_string): Use only most recent copyright year, - as per GNU standards. - - * Makefile.in (DISTFILES_PC): Remove pc/quotearg.c. - * pc/djgpp/config.sed: Remove unnecessary hooks for quotearg and SHELL. - -1997-05-18 Paul Eggert - - * configure.in (VERSION): Increase to 2.2.9. - (AC_TYPE_MODE_T): Add. - - * pch.h (another_hunk): New parameter REV. - * pch.c (hunkmax): Now of type LINENUM. - (malformed): Add decl. - (there_is_another_patch): Skip inname-detection if skip_rest_of_patch. - (intuit_diff_type): To determine whether file appears to have been - deleted, look at replacement, not pattern. - If there is a mismatch between existence of file and whether the - patch claims to change whether the file exists, ask whether to - reverse the patch. - (another_hunk): New parameter REV specifying whether to reverse the - hunk. All callers changed. - (do_ed_script): Add assertion to ensure input file exists. - - * util.h (create_file): New function. - (copy_file): Now takes mode, not struct stat. - (makedirs): No longer exported. - (move_file): Now takes mode, not struct stat. - * util.c (makedirs): No longer exported. - (move_file): Accept mode of destination, not struct stat. - All callers changed. - Quote file names in diagnostics. - Create parent dir of destination if necessary. - Don't use ENOTDIR. - Don't unlink source; it will be unlinked later. - Unlink destination if FROM is zero. - (create_file): New function. - (copy_file): Accept mode of destination, not struct stat. - All callers changed. - Use create_file to create file. - (ok_to_reverse): Moved here from patch.c. Now accepts format and args; - all callers changed. - (mkdir): 2nd arg is now mode_t, for better compatibility. - (replace_slashes): Ignore slashes at the end of the filename. - - * common.h (noreverse): New decl. - (ok_to_reverse): Remove decl. - - * patch.c (noreverse): Now extern. - (main): New environment var PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - Don't assert(hunk) if we're skipping the patch; we may not have any hunks. - When removing a file, back it up if backups are desired. - Don't chmod output file if input file did not exist. - chmod rej file to input file's mode minus executable bits. - (locate_hunk): Go back to old way of a single fuzz parameter, but - handle it more precisely: context diffs with partial contexts - can only match file ends, since the partial context can occur - only at the start or end of file. - All callers changed. - (create_output_file): Use create_file to create files. - (ok_to_reverse): Move to util.c. - - * inp.c (scan_input, get_input_file): Quote file names in diagnostics. - (get_input_file): Set inerrno if it's not already set. - Don't create file; it's now the caller's responsibility. - (plan_b): Use /dev/null if input size is zero, since it might not exist. - Use create_file to create temporary file. - - * NEWS: Add PATCH_VERSION_CONTROL; DOS port is untested. - - * pc/djgpp/config.h: Add comment for mode_t. - - * pc/djgpp/README: Note that it's not tested. - - * patch.man: PATCH_VERSION_CONTROL overrides VERSION_CONTROL. - -1997-05-15 Paul Eggert - - * configure.in: Add AC_PREREQ(2.12). - (VERSION): Bump to 2.2.8. - (ed_PROGRAM): Rename from ED_PROGRAM. - - * pch.c (prefix_components): Support DOS file names better. - Fix typo that caused fn to almost always yield 0. - - * util.c (, ): Include. - (move_file, copy_file): Add support for DOS filenames. - Preserve mode of input files when creating temp files. - Add binary file support. - (doprogram, rmdir): New functions. - (mkdir): Use doprogram. - (replace_slashes): Add support for DOS filenames. - (removedirs): New function. - (init_time)): New function. - (initial_time): New var. - (fetchname): Add support for deleted files, DOS filenames. - - * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): - New macros, for DOS port. - (base_name): Use them. - - * addext.c (HAVE_DOS_FILE_NAMES): New macro. - : Include if HAVE_LIMITS_H. - (addext): Handle hosts with DOS file name limits. - - * common.h (LONG_MIN): New macro. - (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. - (ok_to_create_file): Remove. - (reverse): Now int. - (ok_to_reverse): New function decl. - (O_WRONLY, _O_BINARY, O_BINARY, O_CREAT, O_TRUNC): New macros. - (binary_transput): New var decl. - - * Makefile.in (ed_PROGRAM): Renamed from ED_PROGRAM. - (CONFIG_HDRS, CONFIG_STATUS): New vars. - (SRCS): Add maketime.c, partime.c. - (OBJS): Likewise. - (HDRS): Add maketime.h, partime.h. - (DISTFILES_PC, DISTFILES_PC_DJGPP): New vars. - (Makefile, config.status): Use CONFIG_STATUS, not config.status. - (clean): Remove */*.o. - (dist): Add pc and pc/djgpp subdirectories. - ($(OBJS)): Depend on $(CONFIG_HDRS) instead of config.h. - (maketime.o, partime.o): New rules. - (util.o): Depend on maketime.h. - - * patch.c (main): - Call init_time. Add DEFAULT_VERSION_CONTROL hook for people who - prefer the old ways. Build temp file names before we might invoke cleanup. - Add support for deleted files and clean up the patch-swapping code a bit. - Delete empty ancestors of deleted files. - When creating temporaries, use file modes of original files. - (longopts, get_some_switches): New option --binary. - (get_some_switches): Report non-errno errors with `fatal', not `pfatal'. - (create_output_file): New function, which preserves modes of original files - and supports binary transput. - (init_output, init_reject): Use it. - (ok_to_reverse): New function. - (TMPDIR): New macro. - (make_temp): Use $TMPDIR, $TMP, $TEMP, or TMPDIR, whichever comes first. - - * pch.c (p_says_nonexistent): New var. - (open_patch_file): Add binary transput support. - Apply stat to file names retrieved from user. - Reject them if they don't exist. - (intuit_diff_type): Add support for deleting files. - Don't treat trivial directories any differently. - Avoid stating the same file twice in common case of context diffs. - (prefix_components): Don't treat trivial directories any differently. - Add support for DOS filenames. - (pch_says_nonexistent): New function. - (do_ed_script): Preserve mode of input files when creating temp files. - Add support for binary transput. - - * pch.h (pch_says_nonexistent): New decl. - - * util.h (replace_slashes): No longer exported. - (fetchname): Add support for deleted files. - (copy_file, move_file): Add support for preserving file modes. - (init_time, removedirs): New functions. - - * argmatch.c: Converge with fileutils. - - * backupfile.c: Converge with fileutils. - (find_backup_file_name): Treat .~N~ suffix just like any other suffix - when handling file names that are too long. - - * inp.c: - In messages, put quotes around file names and spaces around "--". - (get_input_file): Allow files to be deleted. Do the expense of - makedirs only if we can't create the file. - (plan_a, plan_b): Add support for binary transput. - - * pc/chdirsaf.c, pc/djgpp/README, pc/djgpp/config.h, pc/djgpp/config.sed, pc/djgpp/configure.bat, pc/quotearg.c: - New file. - - * NEWS: - New methods for removing files; adjust file name intuition again. - Add description of MS-DOS and MS-Windows ports. - - * patch.man: - Simplify file name intuition slightly (no distinction for trivial dirs). - Add --binary. Describe how files and directories are deleted. - Suggest diff -a. Include caveats about what context diffs cannot represent. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.7. - (CPPFLAGS, LDFLAGS, LIBS): If the user has not set any of these vars, - prefer support for large files if available. - - * common.h (_LARGEFILE_SOURCE): Define. - (file_offset): New typedef. - (file_seek, file_tell): New macros. - - * patch.c (main): - Remove empty files by default unless POSIXLY_CORRECT is set. - - * util.c, util.h (Fseek): - Use file_offset instead of long, for portability to large-file hosts. - - * pch.c: (p_base, p_start, next_intuit_at, skip_to, open_patch_file, - intuit_diff_type, another_hunk, incomplete_line, do_ed_script): - Use file_offset instead of long, for portability to large-file hosts. - (prefix_components): Renamed from path_name_components; count only - nontrivial prefix components, and take a 2nd EXISTING arg. - (existing_prefix_components): Remove; subsumed by prefix_components. - (intuit_diff_type): When creating files, try for the creation of the - fewest directories. - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: - When creating a file, use a name whose existing directory prefix - contains the most nontrivial path name components. - Add advice for creating patches and applying them. - -1997-05-06 Paul Eggert - - * configure.in (VERSION): Now 2.2.6. - - * pch.c (existing_prefix_components): New function. - (intuit_diff_type): When creating a file, use a name whose existing - directory prefix contains the most nontrivial path name components. - (best_name): Don't check for null 2nd arg. - - * util.h (replace_slashes): New decl. - * util.c (replace_slashes): Now external. - (fetchname): Don't assume chars are nonnegative. - - * patch.man: Describe above change to pch.c. - Add advice for creating patches and applying them. - -1997-05-05 Paul Eggert - - * configure.in (VERSION): Update to 2.2.5. - - * quotearg.h, quotearg.c: New files. - * Makefile.in (SRCS, OBJS, HDRS): Mention new files. - (inp.o, util.o): Now depends on quotearg.h. - (quotearg.o): New makefile rule. - - * common.h (posixly_correct): New var. - * patch.c (main): Initialize it. - If ! posixly_correct, default backup type is now `existing'. - SIMPLE_BACKUP_SUFFIX no longer affects backup type. - (backup): Remove var. - - * util.h: (countdirs): Remove. - (systemic): New decl. - * util.c (move_file): Try making the parent directory of TO - if backup prefix or suffix contain a slash. - (ask): Remove arbitrary limit on size of result. - (systemic): New function. - (mkdir): Work even if arg contains shell metacharacters. - (replace_slashes): Return 0 if none were replaced. - Don't replace slash after . or .. since it's redundant. - (countdirs): Remove. - (makedirs): Ignore mkdir failures. - - * NEWS, patch.man: More POSIXLY_CORRECT adjustments. - Describe new rules for how file names are intuited. - -1997-04-17 Paul Eggert - - * configure.in (VERSION): Version 2.2 released. - - * Makefile.in (config.hin): - Remove before building; we always want the timestamp updated. - - * inp.c (get_input_file): - Look for RCS files only if backup_type == numbered_existing. - - * NEWS, patch.man: - Remove mention of never-implemented -V rcs and -V sccs options. - * patch.man: `pathname' -> `file name' - Correct the description of how file names are found in diff headers. - Clarify the distinction between ordinary and unified context diffs. - -1997-04-13 Paul Eggert - - * configure.in (VERSION): Update to 2.1.7. - - * patch.c (numeric_optarg): New function. - (get_some_switches): Use it. - - * pch.c (intuit_diff_type): When creating a file, prefer a name whose - existing dir prefix is the longest. - - * util.h (countdirs): New function. - * util.c (replace_slashes, countdirs): New functions. - (makedirs): Use replace_slashes, to be more like countdirs. - - * patch.man: Explain -pN vs -p N. Recommend --new-file. - Explain possible incompatibility with strip count. - -1997-04-10 Paul Eggert - - * configure.in (VERSION): Bump to 2.1.6. - (AC_CHECK_HEADERS): Remove stdlib.h (i.e. remove HAVE_STDLIB_H). - - * Makefile.in: (HDRS, patchlevel.h, TAGS, distclean, maintainer-clean): - Don't distribute patchlevel.h; let the user do it. - This works around some obscure (possibly nonexistent?) `make' bugs. - - * common.h (program_name): extern, not XTERN. - (): Include if STDC_HEADERS, not if HAVE_STDLIB_H. - (atol, getenv, malloc, realloc): Don't worry whether they're #defined. - - * patch.c (get_some_switches): - Add special hack for backwards compatibility with CVS 1.9. - (-B, -Y, -z): Now set backup_type = simple. - - * NEWS: Fix misspellings; minor reformatting. - * README: Report POSIX.2 compliance. - -1997-04-06 Paul Eggert - - Move all old RCS $Log entries into ChangeLog. - #include all files with < >, not " ". - - * addext.c, argmatch.c, argmatch.h, memchr.c, install-sh: - New files. - * EXTERN.h, INTERN.h: Removed. - * config.hin: Renamed from config.h.in. - - * acconfig.h (NODIR): Remove. - (HAVE_MEMCHR): Add. - - * configure.in (AC_ARG_PROGRAM, AC_PROG_MAKE_SET, HAVE_MEMCHR): Add. - (AC_CHECK_HEADERS): Replaces obsolescent AC_HAVE_HEADERS. - Add stdlib.h, string.h, unistd.h, varargs.h. - Delete obsolete call to AC_UNISTD_H. - (AC_CONFIG_HEADER): Rename config.h.in to config.hin. - (AC_C_CONST): Replaces obsolescent AC_CONST. - (AC_CHECK_FUNC): Check for getopt_long; define LIBOBJS and substitute - for it accordingly. - (AC_CHECK_FUNCS): Replaces obsolescent AC_HAVE_FUNCS. - Add _doprintf, isascii, mktemp, sigaction, sigprocmask, sigsetmask. - Remove strerror. - (AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VPRINTF): Add. - (AC_HEADER_DIRENT): Replaces obsolescent AC_DIR_HEADER. - (AC_HEADER_STDC): Replaces obsolescent AC_STDC_HEADERS. - (AC_SYS_LONG_FILE_NAMES): Replaces obsolescent AC_LONG_FILE_NAMES. - (AC_TYPE_OFF_T): Replaces obsolescent AC_OFF_T. - (AC_TYPE_SIGNAL): Replaces obsolescent AC_RETSIGTYPE. - (AC_TYPE_SIZE_T): Replaces obsolescent AC_SIZE_T. - (AC_XENIX_DIR): Remove. - (ED_PROGRAM): New var. - (NODIR): Remove. - (PACKAGE, VERSION): New vars; substitute them with AC_SUBST. - - * Makefile.in: Conform to current GNU build standards. - Redo dependencies. Use library getopt_long if available. - Use `&&' instead of `;' inside shell commands where applicable; - GNU make requires this. - Use double-colon rules for actions that do not build files. - (@SET_MAKE@): Added. - (CFLAGS, LDFLAGS, prefix, exec_prefix): Base on @ versions of symbols. - (COMPILE, CPPFLAGS, DEFS, ED_PROGRAM, LIBOBJS, LIBSRCS, PACKAGE, - VERSION): New symbols. - (SRCS, OBJS, HDRS, MISC): Add new files. - (man1dir): Renamed from mandir. - (man1ext): Renamed from manext. - (patch): Put -o first. - (install): Use $(transform) to allow program to be renamed by configure. - (patchlevel.h): Build from $(VERSION). - (dist): Get version number from $(VERSION) and package name from - $(PACKAGE). - (TAGS): Scan $(HDRS). - (maintainer-clean): Renamed from realclean. Remove patchlevel.h. - - * backupfile.h (simple_backup_suffix): Now const *. - (find_backup_file_name, base_name, get_version): Args are now const *. - (base_name): New decl. - * backupfile.c (): Include only if HAVE_CONFIG_H. - (): Include. - (): Include if HAVE_STRING_H, not if STDC_HEADERS. - (): Include if !HAVE_STRING_H. - (): Do not include. - (): Redo include as per current autoconf standards. - (): Include if HAVE_LIMITS_H. Define CHAR_BIT if not defined. - (NLENGTH): Now returns size_t. - (CLOSEDIR, INT_STRLEN_BOUND): New macros. - (ISDIGIT): Use faster method. - (find_backup_file_name): No longer depends on NODIR. - Remove redundant code. - (make_version_name): Remove; do it more portably. - (max_backup_version): Args are now const *. - (version_number): Simplify digit checking. - (basename, concat, dirname): Remove. - (argmatch, invalid_arg): Move to argmatch.c. Simplify test for - ambiguous args. When reporting an error, use program_name not "patch". - (addext): Move to addext.c. Treat all negative values from pathconf - like -1. Always use long extension if it fits, even if the filesystem - does not support long file names. - (backup_types): Now const. - - * common.h, inp.h (XTERN): Renamed from EXT to avoid collision - with errno.h reserved name space. - - * common.h (DEBUGGING): Now an integer; default is 1. - (enum diff): New type. - (diff_type): Use it instead of small integers. - (CONTEXT_DIFF, NORMAL_DIFF, ED_DIFF, NEW_CONTEXT_DIFF, UNI_DIFF): - Now enumerated values instead of macros. - (NO_DIFF): New enumerated value (used instead of 0). - (volatile): Default to the empty string if __STDC__ is not defined. - (): Do not include. - (Chmod, Close, Fclose, Fflush, Fputc, Signal, Sprintf, Strcat, - Strcpy, Unlink, Write): Remove these macros; casts to void are - not needed for GNU coding standards. - (INITHUNKMAX): Move to pch.c. - (malloc, realloc, INT_MIN, MAXLINELEN, strNE, strnNE, - Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7, Reg8, Reg9, Reg10, Reg11, - Reg12, Reg13, Reg14, Reg15, Reg16): Remove these macros. - (S_IXOTH, S_IWOTH, S_IROTH, S_IXGRP, S_IWGRP, - S_IRGRP, S_IXUSR, S_IWUSR, S_IRUSR, O_RDONLY, O_RDWR): - Define these macros, if not defined. - (CTYPE_DOMAIN, ISLOWER, ISSPACE, ISDIGIT, PARAMS): New macros. - (instat): Renamed from filestat; used for input file now. - (bufsize, using_plan_a, debug, strippath): Not statically initialized. - (debug): #define to 0 if not DEBUGGING, so that users of `debug' - no longer need to be surrounded by `#if DEBUGGING'. - (out_of_mem, filec, filearg, outname, toutkeep, trejkeep): Remove. - (inname, inerrno, dry_run, origbase): New variables. - (origprae): Now const*. - (TMPOUTNAME, TMPINNAME, TMPPATNAME): Now const*volatile. - (verbosity): New variable; subsumes `verbose'. - (DEFAULT_VERBOSITY, SILENT, VERBOSE): Values in a new enum. - (verbose): Removed. - (VOID): Use `#ifdef __STDC__' instead of`#if __STDC__', - for consistency elsewhere. - (__attribute__): New macro (empty if not a recent GCC). - (fatal_exit): Renamed from my_exit. - (errno): Don't define if STDC_HEADERS. - (): Include if either STDC_HEADERS or HAVE_STRING_H. - (memcmp, memcpy): Define if !STDC_HEADERS && !HAVE_STRING_H - && !HAVE_MEMCHR. - (): Include if HAVE_STDLIB_H, not if STDC_HEADERS. - (atol, getenv, malloc, realloc, lseek): Declare only if not defined - as a macro. - (popen, strcpy, strcat, mktemp): Do not declare. - (lseek): Declare to yield off_t, not long. - (): Include only if HAVE_FCNTL_H. - - * inp.h (get_input_file): New decl. - * inp.c (SCCSPREFIX, GET, GET_LOCKED, SCCSDIFF, RCSSUFFIX, CHECKOUT, - CHECKOUT_LOCKED, RCSDIFF): Moved here from common.h. - (i_ptr): Now char const **. - (i_size): Remove. - (TIBUFSIZE_MINIMUM): Define only if not already defined. - (plan_a, plan_b): Arg is now const *. - (report_revision): Declare before use. It's now the caller's - responsibility to test whether revision is 0. - (scan_input, report_revision, get_input_file): - Be less chatty unless --verbose. - (get_input_file): New function, split off from plan_a. - Reuse file status gotten by pch if possible. Allow for dry run. - Use POSIX bits for creat, not number. Check for creation and - close failure, and use fstat not stat. Use memcpy not strncpy. - (plan_a): Rewrite for speed. - Caller now assigns result to using_plan_a. - Don't bother reading empty files; during dry runs they might not exist. - Use ISSPACE, not isspace. - (plan_b): Allow for dry runs. Use ISSPACE, and handle sign extension - correctly on arg. Use POSIX symbol for open arg. - - * patch.c (backup, output, patchname, program_name): New vars. - (last_frozen_line): Moved here from inp.h. - (TMPREJNAME): Moved here from common.h. - (optind_last): Removed. - (do_defines, if_defined, not_defined, else_defined, end_defined): - Now char const. Prepend with \n (except for not_defined) to - allow for files ending in non-newline. - (Argv): Now char*const*. - (main, get_some_switches): Exit status 0 means success, - 1 means hunks were rejected, 2 means trouble. - (main, locate_hunk, patch_match): Keep track of patch prefix context - separately from suffix context; this fixes several bugs. - (main): Initialize bufsize, strippath. - Be less chatty unless --verbose. - No more NODIR; always have version control available. - Require environment variables to be nonempty to have effect. - Add support for --dry-run, --output, --verbose. - Invoke get_input_file first, before deciding among do_ed_script, - plan_a, or plan_b. - Clear ofp after closing it, to keep discipline that ofp is either - 0 or open, to avoid file descriptor leaks. Conversely, rejfp doesn't - need this trick since static analysis is enough to show when it - needs to be closed. - Don't allow file-creation patches to be applied to existing files. - Misordered hunks are now not fatal errors; just go on to the next file. - It's a fatal error to fall back on plan B when --output is given, - since the moving hand has writ. - Add support for binary files. - Check for I/O errors. - chmod output file ourselves, rather than letting move_file do it; - this saves global state. - Use better grammar when outputting hunks messages, e.g. avoid - `1 hunks'. - (main, reinitialize_almost_everything): - Remove support for multiple file arguments. - Move get_some_switches call from reinitialize_almost_everything - to main. - (reinitialize_almost_everything): No need to reinitialize things - that are no longer global variables, e.g. outname. - (shortopts): Remove leading "-"; it's no longer important to - return options and arguments in order. '-b' no longer takes operand. - -p's operand is no longer optional. Add -i, -Y, -z. Remove -S. - (longopts): --suffix is now pared with -z, not -b. --backup now - means -b. Add --input, --basename-prefix, --dry-run, --verbose. - Remove --skip. --strip's operand is now required. - (option_help): New variable. Use style of current coding standards. - Change to match current option set. - (usage): Use it. - (get_some_switches): Get all switches, since `+' is defunct. - New options -i, -Y, -z, --verbose, --dry-run. - Option -S removed. - -b now means backup (backup_type == simple), not simple_backup_suffix. - -B now implies backup, and requires nonempty operand. - -D no longer requires first char of argument to be an identifier. - `-o -' is now disallowed (formerly output to regular file named "-"). - -p operand is now required. - -v no longer needs to cleanup (no temp files can exist at that point). - -V now implies backup. - Set inname, patchname from file name arguments, if any; - do not set filearg. It's now an error if extra operands are given. - (abort_junk): Check for write errors in reject file. - (apply_hunk, copy_till): Return error flag, so that failure to apply - out-of-order hunk is no longer fatal. - (apply_hunk): New arg after_newline, - for patching files not ending in newline. - Cache ofp for speed. Check for write errors. - (OUTSIDE, IN_IFNDEF, IN_IFDEF, IN_ELSE): Now part of an enumerated type - instead of being #defined to small integers. - Change while-do to do-while when copying !-part for R_do_defines, - since condition is always true the first time through the loop. - (init_output, init_reject): Arg is now const *. - (copy_till, spew_output): Do not insert ``missing'' newlines; - propagate them via new after_newline argument. - (spew_output): Nothing to copy if last_frozen_line == input lines. - Do not close (ofp) if it's null. - (dump_line): Remove. - (similar): Ignore presence or absence of trailing newlines. - Check for only ' ' or '\t', not isspace (as per POSIX.2). - (make_temp): Use tmpnam if mktemp is not available. - (cleanup): New function. - (fatal_exit): Use it. Renamed from my_exit. - Take signal to exit with, not exit status (which is now always 2). - - * pch.h, pch.c (pch_prefix_context, pch_suffix_context): - New fns replacing pch_context. - (another_hunk): Now yields int, not bool; -1 means out of memory. - Now takes difftype as argument. - (pch_write_line): Now returns boolean indicating whether we're after - a newline just after the write, for supporting non-text files. - * pch.c (isdigit): Remove; use ISDIGIT instead. - (INITHUNKMAX): Moved here from common.h. - (p_context): Removed. We need to keep track of the pre- and post- - context separately, in: - (p_prefix_context, p_suffix_context): New variables. - (bestguess): Remove. - (open_patch_file): Arg is now char const *. - Copy file a buffer at a time, not a char at a time, for speed. - (grow_hunkmax): Now returns success indicator. - (there_is_another_patch, skip_to, another_hunk, do_ed_script): - Be less chatty unless --verbose. - (there_is_another_patch): - Avoid infinite loop if user input keeps yielding EOF. - (intuit_diff_type): New returns enum diff, not int. - Strip paths as they're being fetched. - Set ok_to_create_file correctly even if patch is reversed. - Set up file names correctly with unidiff output. - Use algorithm specified by POSIX 1003.2b/D11 to deduce - name of file to patch, with the exception of patches - that can create files. - (skip_to): Be verbose if !inname, since we're about to ask the - user for a file name and the context will help the user choose. - (another_hunk): Keep context as LINENUM, not int. - If the replacement is missing, calculate its context correctly. - Don't assume input ends in newline. - Keep track of patch prefix context separately from suffix context; - this fixes several bugs. - Don't assume blank lines got chopped if the replacement is missing. - Report poorly-formed hunks instead of aborting. - Do not use strcpy on overlapping strings; it's not portable. - Work even if lines are incomplete. - Fix bugs associated with context-less context hunks, - particularly when patching in reverse. - (pget_line): Now takes just 1 arg; instead of second arg, - just examine using_plan_a global. Return -1 if we ran out - of memory. - (do_ed_script): Now takes output FILE * argument. - Take name of editor from ED_PROGRAM instead of hardwiring /bin/ed. - Don't bother unlinking TMPOUTNAME. - Check for popen failure. - Flush pipe to check for output errors. - If ofp is nonzero, copy result to it, instead of trying to - move the result. - - * util.h, util.c (say1, say2, say3, say4, fatal1, fatal2, fatal3, - fatal4, pfatal1, pfatal2, pfatal3, pfatal4, ask1, ask2, ask3, ask4): - Remove; replaced with following. - (ask, say, fatal, pfatal): New stdarg functions. - (fetchname): Remove last, `assume_exists' parameter. - (savebuf, savestr, move_file, copy_file): Args are now const *. - (exit_with_signal): New function, for proper process status if - a signal is received as per POSIX.2. - (basename): Rename to `base_name' and move to backupfile. - * util.c (): Include here, not in common.h. - (vararg_start): New macro. - (va_dcl, va_start, va_arg, va_end): Define if neither - nor are available. - (SIGCHLD): Define to SIGCLD if SIGCLD is defined and - SIGCHLD isn't. - (private_strerror): Remove. - (move_file): Remove option of moving to stdout. - Add support for -Y, -z. - Don't assume chars in file name are nonnegative. - Use copy_file if rename fails due to EXDEV; - report failure if rename fails for any other reason. - (copy_file, makedirs): Use POSIX symbols for permissions. - (copy_file): Open source before destination. - (remove_prefix): New function. - (vfprintf): New function, if !HAVE_VPRINTF. - (afatal, apfatal, zfatal, zpfatal, errnum): Remove. - (fatal, pfatal, say): New functions that use stdarg. - All callers changed. - (zask): Renamed from `ask'. Now uses stdarg. Output to stdout, - and read from /dev/tty, or if that cannot be opened, from - stderr, stdout, stdin, whichever is first a tty. - Print "EOF" when an EOF is read. Do not echo input. - (sigs): New array. - (sigset_t, sigemptyset, sigmask, sigaddset, sigismember, SIG_BLOCK, - SIG_UNBLOCK, SIG_SETMASK, sigprocmask, sigblock, sigsetmask): - Define substitutes if not available. - (initial_signal_mask, signals_to_block): New vars. - (fatal_exit_handler): New function, if !HAVE_SIGACTION. - (set_signals, ignore_signals): Use sigaction and sigprocmask style - signal-handling if possible; it doesn't lose signals. - (set_signals): Default SIGCHLD to work around SysV fork+wait bug. - (mkdir): First arg is now const *. - (makedirs): Handle multiple adjacent slashes correctly. - (fetchname): Do not worry about whether the file exists - (that is now the caller's responsibility). - Treat a sequence of one or more slashes like one slash. - Do not unstrip leading directories if they all exist and if - no -p option was given; POSIX doesn't allow this. - (memcmp): Remove (now a macro in common.h). - - * version.c (copyright_string, free_software_msgid, authorship_msgid): - New constants. - (version): Use them. Use program_name instead of hardwiring it. - - * patch.man: Generate date from RCS Id. - Rewrite to match the above changes. - -Fri Jul 30 02:02:51 1993 Paul Eggert (eggert@twinsun.com) - - * configure.in (AC_HAVE_FUNCS): Add mkdir. - - * common.h (Chmod, Fputc, Write, VOID): New macros. - (malloc, realloc): Yield `VOID *', not `char *'. - - * util.h (makedirs): Omit `striplast' argument. Remove `aask'. - - * inp.c (plan_a): Remove fixed internal buffer. Remove lint. - - * util.c (set_signals, ignore_signals): Trap SIGTERM, too. - (makedirs): Removed fixed internal buffer. Omit `striplast' argument. - (mkdir): New function, if !HAVE_MKDIR. - (fetchname): Remove fixed internal buffer. - Remove lint from various functions. - - * patch.c, pch.c: Remove lint. - -Thu Jul 29 20:52:07 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * Makefile.in (config.status): Run config.status --recheck, not - configure, to get the right args passed. - -Thu Jul 29 07:46:16 1993 Paul Eggert (eggert@twinsun.com) - - * The following changes remove all remaining fixed limits on memory, - and fix bugs in patch's handling of null bytes and files that do not - end in newline. `Patch' now works on binary files. - - * backupfile.c (find_backup_file_name): Don't dump core if malloc fails. - - * EXTERN.h, INTERN.h (EXITING): New macro. - * backupfile.[ch], patch.c, pch.c: Add PARAMS to function declarations. - - * common.h (bool): Change to int, so ANSI C prototype promotion works. - (CANVARARG): Remove varargs hack; it wasn't portable. - (filearg): Now a pointer, not an array, so that it can be reallocated. - (GET*, SCCSDIFF, CHECKOUT*, RCSDIFF): Quote operands to commands. - (my_exit): Declare here. - (BUFFERSIZE, Ctl, filemode, Fseek, Fstat, Lseek, MAXFILEC, MAXHUNKSIZE, - Mktemp, myuid, Null, Nullch, Nullfp, Nulline, Pclose, VOIDUSED): Remove. - All invokers changed. - (Argc, Argv, *define[sd], last_offset, maxfuzz, noreverse, ofp, - optind_last, rejfp, rejname): No longer externally visible; all - definers changed. - (INT_MAX, INT_MIN, STD*_FILENO, SEEK_SET): Define if the underlying - system doesn't. Include for this. - - * configure.in: Add limits.h, memcmp. Delete getline. - - * inp.c (tibufsize): New variable; buffers grow as needed. - (TIBUFSIZE_MINIMUM): New macro. - (report_revision): New function. - (plan_a): Do not search patch as a big string, since that fails - if it contains null bytes. - Prepend `./' to filenames starting with `-', for RCS and SCCS. - If file does not match default RCS/SCCS version, go ahead and patch - it anyway; warn about the problem but do not report a fatal error. - (plan_b): Do not use a fixed buffer to read lines; read byte by byte - instead, so that the lines can be arbitrarily long. Do not search - lines as strings, since they may contain null bytes. - (plan_a, plan_b): Report I/O errors. - - * inp.c, inp.h (rev_in_string): Remove. - (ifetch): Yield size of line too, since strlen no longer applies. - (plan_a, plan_b): No longer exported. - - * patch.c (abort_hunk, apply_hunk, patch_match, similar): - Lines may contain NUL and need not end in newline. - (copy_till, dump_line): Insert newline if appending after partial line. - All invokers changed. - (main, get_some_switches, apply_hunk): Allocate *_define[ds], filearg, - rejname dynamically. - (make_temp): New function. - (main): Use it. - (main, spew_output, dump_line) Check for I/O errors. - - * pch.c (open_patch_file): Don't copy stdin to a temporary file if - it's a regular file, since we can seek on it directly. - (open_patch_file, skip_to, another_hunk): The patch file may contain - NULs. - (another_hunk): The patch file may contain lines starting with '\', - which means the preceding line lacked a trailing newline. - (pgetline): Rename to pget_line. - (get_line, incomplete_line, pch_write_line): New functions. - (pch_line_len): Return size_t, not short; lines may be very long. - (do_ed_script): Check for I/O errors. Allow scripts to contain - 'i' and 's' commands, too. - - * pch.h (pfp, grow_hunkmax, intuit_diff_type, next_intuit_at, skip_to, - pfetch, pgetline): No longer exported. - (pch_write_line): New declaration. - (getline): Removed. - - * util.c (move_file, fetchname): Use private stat buffer, so that - filestat isn't lost. Check for I/O errors. - (savestr): Use savebuf. - (zask): Use STD*_FILENO instead of 0, 1, 2. - (fetchname): strip_leading defaults to INT_MAX instead of 957 (!). - (memcmp): Define if !HAVE_MEMCMP. - - * util.c, util.h (say*, fatal*, pfatal*, ask*): Delete; these - pseudo-varargs functions weren't ANSI C. Replace by macros - that invoke [fs]printf directly, and invoke new functions - [az]{say,fatal,pfatal,ask} before and after. - (savebuf, read_fatal, write_fatal, memory_fatal, Fseek): New functions. - (fatal*): Output trailing newline after message. All invokers changed. - - * version.c (version): Don't exit. - - * Makefile.in (SRCS): Remove getline.c. - -Thu Jul 22 15:24:24 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * EXTERN.h, INTERN.h (PARAMS): Define. - * backupfile.h, common.h, inp.h, pch.h, util.h: Use. - * backupfile.c: Include EXTERN.h. - -Wed Jul 21 13:14:05 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * getline.c: New file. - * configure.in: Check for getline (GNU libc has it). - * pch.c: Use it instead of fgets. - (pgetline): Renamed from pgets. Change callers. - * pch.h: Change decl. - - * pch.c (pgets): Tab adjusts by 8 - (indent % 8), not % 7. - Be consistent with similar code in pch.c::intuit_diff_type. - - * common.h (MEM): Typedef removed. - inp.c, pch.c, util.c: Use size_t instead of MEM. - inp.c, pch.c: Use off_t. - configure.in: Add AC_SIZE_T and AC_OFF_T. - - * common.h: Make buf a pointer and add a bufsize variable. - * util.c, pch.c, inp.c: Replace sizeof buf with bufsize. - * patch.c: malloc buf to bufsize bytes. - -Tue Jul 20 20:40:03 1993 Paul Eggert (eggert@twinsun.com) - - * common.h (BUFFERSIZE): Grow it to 8k too, just in case. - (buf): Turn `buf' back into an array; making it a pointer broke - things seriously. - * patch.c (main): Likewise. - -Tue Jul 20 20:02:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Move Reg[1-16] and CANVARARG decls from config.h.in to common.h. - * acconfig.h: New file. - * Makefile (HDRS): Add it. - -Tue Jul 20 16:35:27 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in: Remove alloca.[co]; getopt no longer needs it. - * configure.in (AC_ALLOCA): Remove. - - * util.c (set_signals, ignore_signals): Do nothing if SIGHUP - and SIGINT aren't defined. - -Tue Jul 20 17:59:56 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (main): Call xmalloc, not malloc. xmalloc buf. - * common.h: Declare xmalloc. Make buf a pointer, not an array. - - * util.c (xmalloc): Call fatal1, not fatal. - - * common.h [MAXLINELEN]: Bump from 1k to 8k. - -Thu Jul 8 19:56:16 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in (installdirs): New target. - (install): Use it. - (Makefile, config.status, configure): New targets. - -Wed Jul 7 13:25:40 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * patch.c (get_some_switches, longopts): Recognize --help - option, and call usage. - (usage): New function. - -Fri Jun 25 07:49:45 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Don't use .orig if - numbered_existing with no existing numbered backup. - (addext): Don't use ext if !HAVE_LONG_FILE_NAMES, - even if it would fit. This matches patch's historical behavior. - (simple_backup_suffix): Default to ".orig". - * patch.c (main): Just use that default. - -Tue Jun 15 22:32:14 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (HAVE_ALLOCA_H): This #undef was missing. - * Makefile.in (info, check, installcheck): New rules. - -Sun Jun 13 14:31:29 1993 Paul Eggert (eggert@twinsun.com) - - * config.h.in (index, rindex): Remove unused macro - definitions; they get in the way when porting to AIX. - * config.h.in, configure.in (HAVE_STRING_H): Remove unused defn. - -Thu Jun 10 21:13:47 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCH_VERSION 2.1. - (The name `patch-2.0.12g12' is too long for traditional Unix.) - - * patchlevel.h (PATCH_VERSION): Renamed from PATCHLEVEL. - Now contains the entire patch version number. - * version.c (version): Use it. - -Wed Jun 9 21:43:23 1993 Paul Eggert (eggert@twinsun.com) - - * common.h: Remove declarations of index and rindex. - * backupfile.c: Likewise. - (addext, basename, dirname): Avoid rindex. - -Tue Jun 8 15:24:14 1993 Paul Eggert (eggert@twinsun.com) - - * inp.c (plan_a): Check that RCS and working files are not the - same. This check is needed on hosts that do not report file - name length limits and have short limits. - -Sat Jun 5 22:56:07 1993 Paul Eggert (eggert@twinsun.com) - - * Makefile.in (.c.o): Put $(CFLAGS) after other options. - (dist): Switch from .z to .gz. - -Wed Jun 2 10:37:15 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (find_backup_file_name): Initialize copy of - file name properly. - -Mon May 31 21:55:21 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g11. - - * pch.c (p_Char): Renamed from p_char, which is a system type - in Tex XD88's . - - * backupfile.c: Include "config.h" first, so that `const' is - treated consistently in system headers. - -Mon May 31 16:06:23 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: Patch level 12g10. - - * configure.in: Add AC_CONST. - * config.h.in: Add `const'. - * Makefile.in (.c.o): Add -DHAVE_CONFIG_H. - (getopt.o getopt1.o): Depend on config.h. - - * util.c (xmalloc): New function; alloca.c needs this. - -Mon May 31 00:49:40 1993 Paul Eggert (eggert@twinsun.com) - - * patchlevel.h: PATCHLEVEL 12g9. - - * backupfile.c, backupfile.h (addext): New function. - It uses pathconf(), if available, to determine maximum file - name length. - * patch.c (main): Use it for reject file name. - * common.h (ORIGEXT): Moved to patch.c. - * config.h.in (HAVE_PATHCONF): New macro. - * configure.in: Define it. - - * Makefile.in (dist): Use gzip, not compress. - -Sat May 29 09:42:18 1993 Paul Eggert (eggert@twinsun.com) - - * patch.c (main): Use pathconf to decide reject file name. - * common.h (REJEXT): Remove. - - * inp.c (plan_a): Don't lock the checked-out file if `patch -o' - redirected the output elsewhere. - * common.h (CHECKOUT_LOCKED, GET_LOCKED): New macros. GET and - CHECKOUT now just checkout unlocked copies. - -Fri May 28 08:44:50 1993 Paul Eggert (eggert@twinsun.com) - - * backupfile.c (basename): Define even if NODIR isn't defined. - * patch.c (main): Ask just once to apply a reversed patch. - -Tue Nov 24 08:09:04 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * config.h.in, common.h: Use HAVE_FCNTL_H and HAVE_STRING_H - instead of USG. - - * backupfile.c: Use SYSDIR and NDIR instead of USG. - Define direct as dirent, not vice-versa. - -Wed Sep 16 17:11:48 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (get_some_switches): optc should be int, not char. - -Tue Sep 15 00:36:46 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12g8. - -Mon Sep 14 22:01:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * Makefile.in: Add uninstall target. - - * util.c (fatal, pfatal): Add some asterisks to make fatal - messages stand out more. - -Tue Aug 25 22:13:36 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main, get_some_switches), common.h, inp.c (plan_a, - plan_b), pch.c (there_is_another_patch): Add -t --batch - option, similar to -f --force. - -Mon Jul 27 11:27:07 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * common.h: Define SCCSDIFF and RCSDIFF. - * inp.c (plan_a): Use them to make sure it's safe to check out - the default RCS or SCCS version. - From Paul Eggert. - -Mon Jul 20 14:10:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.h: Declare basename. - * inp.c (plan_a), util.c (fetchname): Use it to isolate the - leading path when testing for RCS and SCCS files. - -Fri Jul 10 16:03:23 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (makedirs): Only make the directories that don't exist. - From chip@tct.com (Chip Salzenberg). - -Wed Jul 8 01:20:56 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * patch.c (main): Open ofp after checking for ed script. - Close ofp and rejfp before trying plan B. - From epang@sfu.ca (Eugene Pang). - - * util.c (fatal, pfatal): Print "patch: " before message. - * pch.c, inp.c, patch.c, util.c: Remove "patch: " from the - callers that had it. - - * common.h (myuid): New variable. - * patch.c (main): Initialize it. - * inp.c (myuid): Function removed. - (plan_a): Use the variable, not the function. - - * patch.c: Add back -E --remove-empty-files option. - -Tue Jul 7 23:19:28 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (myuid): New function. - (plan_a): Call it. Optimize stat calls. Be smarter about - detecting checked out RCS and SCCS files. - From Paul Eggert (eggert@twinsun.com). - - * inp.c, util.c, patch.c: Don't bother checking for stat() > 0. - -Mon Jul 6 13:01:52 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (move_file): Use rename instead of link and copying. - - * util.c (pfatal): New function. - * util.h: Declare it and pfatal[1-4] macros. - * various files: Use it instead of fatal where appropriate. - - * common.h, patch.c: Replace Arg[cv]_last with optind_last. - - * patch.c (main, get_some_switches): Use getopt_long. Update - usage message. - (nextarg): Function removed. - - * Rename FLEXFILENAMES to HAVE_LONG_FILE_NAMES, - VOIDSIG to RETSIGTYPE. - - * backupfile.c, common.h: Use STDC header files if available. - backupfile.h: Declare get_version. - - * COPYING, COPYING.LIB, INSTALL, Makefile.in, alloca.c, - config.h.in, configure, configure.in, getopt.[ch], getopt1.c, - rename.c: New files. - * Configure, MANIFEST, Makefile.SH, config.H, config.h.SH, - malloc.c: Files removed. - - * version.c (version): Don't print the RCS stuff, since we're - not updating it regularly. - - * patchlevel.h: PATCHLEVEL 12u7. - - * Makefile.SH (dist): New target. - Makedist: File removed. - - * inp.c (plan_a): Check whether the user can write to the - file, not whether anyone can write to the file. - -Sat Jul 4 00:06:58 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * inp.c (plan_a): Try to check out read-only files from RCS or SCCS. - - * util.c (move_file): If backing up by linking fails, try copying. - From cek@sdc.boeing.com (Conrad Kimball). - - * patch.c (get_some_switches): Eliminate -E option; always - remove empty output files. - - * util.c (fetchname): Only undo slash removal for relative - paths if -p was not given. - - * Makefile.sh: Add mostlyclean target. - -Fri Jul 3 23:48:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) - - * util.c (fetchname): Accept whitespace between `Index:' and filename. - Also plug a small memory leak for diffs against /dev/null. - From eggert@twinsun.com (Paul Eggert). - - * common.h: Don't define TRUE and FALSE if already defined. - From phk@data.fls.dk (Poul-Henning Kamp). - -Wed Apr 29 10:19:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) - - * backupfile.c (get_version): Exit if given a bad backup type. - -Fri Mar 27 09:57:14 1992 Karl Berry (karl at hayley) - - * common.h (S_ISDIR, S_ISREG): define these. - * inp.c (plan_a): use S_ISREG, not S_IFREG. - * util.c (fetchname): use S_ISDIR, not S_IFDIR. - -Mon Mar 16 14:10:42 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u6. - -Sat Mar 14 13:13:29 1992 David J. MacKenzie (djm at frob.eng.umd.edu) - - * Configure, config.h.SH: Check for directory header and unistd.h. - - * patch.c (main): If -E was given and output file is empty after - patching, remove it. - (get_some_switches): Recognize -E option. - - * patch.c (copy_till): Make garbled output an error, not a warning - that doesn't change the exit status. - - * common.h: Protect against system declarations of malloc and realloc. - - * Makedist: Add backupfile.[ch]. - - * Configure: Look for C library where NeXT and SVR4 put it. - Look in /usr/ucb after /bin and /usr/bin for utilities, - and look in /usr/ccs/bin, to make SVR4 happier. - Recognize m68k predefine. - - * util.c (fetchname): Test of stat return value was backward. - From csss@scheme.cs.ubc.ca. - - * version.c (version): Exit with status 0, not 1. - - * Makefile.SH: Add backupfile.[cho]. - * patch.c (main): Initialize backup file generation. - (get_some_switches): Add -V option. - * common.h, util,c, patch.c: Replace origext with simple_backup_suffix. - * util.c (move_file): Use find_backup_file_name. - -Tue Dec 3 11:27:16 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u5. - - * Makefile.SH: Change clean, distclean, and realclean targets a - little so they agree with the GNU coding standards. - Add Makefile to addedbyconf, so distclean removes it. - - * Configure: Recognize Domain/OS C library in /lib/libc. - From mmuegel@mot.com (Michael S. Muegel). - - * pch.c: Fixes from Wayne Davison: - Patch now accepts no-context context diffs that are - specified with an assumed one line hunk (e.g. "*** 10 ****"). - Fixed a bug in both context and unified diff processing that would - put a zero-context hunk in the wrong place (one line too soon). - Fixed a minor problem with p_max in unified diffs where it would - set p_max to hunkmax unnecessarily (the only adverse effect was to - not supply empty lines at eof by assuming they were truncated). - -Tue Jul 2 03:25:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Configure: Check for signal declaration in - /usr/include/sys/signal.h as well as /usr/include/signal.h. - - * Configure, common.h, config.h.SH: Comment out the sprintf - declaration and tests to determine its return value type. It - conflicts with ANSI C systems' prototypes in stdio.h and the - return value of sprintf is never used anyway -- it's always cast - to void. - -Thu Jun 27 13:05:32 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u4. - -Thu Feb 21 15:18:14 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * pch.c (another_hunk): Fix off by 1 error. From - iverson@xstor.com (Tim Iverson). - -Sun Jan 20 20:18:58 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * Makefile.SH (all): Don't make a dummy `all' file. - - * patchlevel.h: PATCHLEVEL 12u3. - - * patch.c (nextarg): New function. - (get_some_switches): Use it, to prevent dereferencing a null - pointer if an option that takes an arg is not given one (is last - on the command line). From Paul Eggert. - - * pch.c (another_hunk): Fix from Wayne Davison to recognize - single-line hunks in unified diffs (with a single line number - instead of a range). - - * inp.c (rev_in_string): Don't use `s' before defining it. From - Wayne Davison. - -Mon Jan 7 06:25:11 1991 David J. MacKenzie (djm at geech.ai.mit.edu) - - * patchlevel.h: PATCHLEVEL 12u2. - - * pch.c (intuit_diff_type): Recognize `+++' in diff headers, for - unified diff format. From unidiff patch 1. - -Mon Dec 3 00:14:25 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * patch.c (get_some_switches): Make the usage message more - informative. - -Sun Dec 2 23:20:18 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * Configure: When checking for C preprocessor, look for 'abc.*xyz' - instead of 'abc.xyz', so ANSI C preprocessors work. - - * Apply fix for -D from ksb@mentor.cc.purdue.edu (Kevin Braunsdorf). - -1990-05-01 Wayne Davison - * patch.c, pch.c: unidiff support added - -Wed Mar 7 23:47:25 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * pch.c: Call malformed instead of goto malformed - (just allows easier debugging). - -Tue Jan 23 21:27:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * common.h (TMP*NAME): Make these char *, not char []. - patch.c (main): Use TMPDIR (if present) to set TMP*NAME. - common.h: Declare getenv. - -Sun Dec 17 17:29:48 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu) - - * patch.c (reverse_flag_specified): New variable. - (get_some_switches, reinitialize_almost_everything): Use it. - -1988-06-22 Larry Wall - patch12: - * common.h: sprintf was declared wrong - * patch.c: rindex() wasn't declared - * patch.man: now avoids Bell System Logo - -1988-06-03 Larry Wall - patch10: - * common.h: support for shorter extensions. - * inp.c: made a little smarter about sccs files - * patch.c: exit code improved. - better support for non-flexfilenames. - * patch.man: -B switch was contributed. - * pch.c: Can now find patches in shar scripts. - Hunks that swapped and then swapped back could core dump. - -1987-06-04 Larry Wall - * pch.c: pch_swap didn't swap p_bfake and p_efake. - -1987-02-16 Larry Wall - * patch.c: Short replacement caused spurious "Out of sync" message. - -1987-01-30 Larry Wall - * patch.c: Improved diagnostic on sync error. - Moved do_ed_script() to pch.c. - * pch.c: Improved responses to mangled patches. - * pch.h: Added do_ed_script(). - -1987-01-05 Larry Wall - * pch.c: New-style context diffs caused double call to free(). - -1986-11-21 Larry Wall - * patch.c: Fuzz factor caused offset of installed lines. - -1986-11-14 Larry Wall - * pch.c: Fixed problem where a long pattern wouldn't grow the hunk. - Also restored p_input_line when backtracking so error messages are - right. - -1986-11-03 Larry Wall - * pch.c: New-style delete triggers spurious assertion error. - -1986-10-29 Larry Wall - * patch.c: Backwards search could terminate prematurely. - * pch.c: Could falsely report new-style context diff. - -1986-09-17 Larry Wall - * common.h, inp.c, inp.h, patch.c, patch.man, pch.c, pch.h, - util.h, version.c, version.h: Baseline for netwide release. - -1986-08-01 Larry Wall - * patch.c: Fixes for machines that can't vararg. - Added fuzz factor. Generalized -p. General cleanup. - Changed some %d's to %ld's. Linted. - * patch.man: Documented -v, -p, -F. - Added notes to patch senders. - -1985-08-15 van%ucbmonet@berkeley - Changes for 4.3bsd diff -c. - -1985-03-26 Larry Wall - * patch.c: Frozen. - * patch.man: Frozen. - -1985-03-12 Larry Wall - * patch.c: Now checks for normalness of file to patch. - Check i_ptr and i_womp to make sure they aren't null before freeing. - Also allow ed output to be suppressed. - Changed pfp->_file to fileno(pfp). - Added -p option from jromine@uci-750a. - Added -D (#ifdef) option from joe@fluke. - * patch.man: Documented -p, -D. - -1984-12-06 Larry Wall - * patch.c: Made smarter about SCCS subdirectories. - -1984-12-05 Larry Wall - * patch.c: Added -l switch to do loose string comparison. - * patch.man: Added -l switch, and noted bistability bug. - -1984-12-04 Larry Wall - Branch for sdcrdcf changes. - * patch.c: Failed hunk count not reset on multiple patch file. - * patch.man: Baseline version. - -1984-11-29 Larry Wall - * patch.c: Linted. Identifiers uniquified. Fixed i_ptr malloc() bug. - Fixed multiple calls to mktemp(). Will now work on machines that can - only read 32767 chars. Added -R option for diffs with new and old - swapped. Various cosmetic changes. - -1984-11-09 Larry Wall - * patch.c: Initial revision - - -Copyright (C) 1984, 1985, 1986, 1987, 1988 Larry Wall. - -Copyright (C) 1989, 1990, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2001, -2002 Free Software Foundation, Inc. - -This file is part of GNU Patch. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that they will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. Index: vendor/misc-GNU/patch/dist/partime.c =================================================================== --- vendor/misc-GNU/patch/dist/partime.c (revision 358868) +++ vendor/misc-GNU/patch/dist/partime.c (nonexistent) @@ -1,956 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright (C) 1993, 1994, 1995, 1997, 2002 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#if has_conf_h -# include -#else -# if HAVE_CONFIG_H -# include -# else -# ifndef __STDC__ -# define const -# endif -# endif -# if HAVE_LIMITS_H -# include -# endif -# ifndef LONG_MIN -# define LONG_MIN (-1-2147483647L) -# endif -# if HAVE_STDDEF_H -# include -# endif -# if STDC_HEADERS -# include -# endif -# include -# ifdef __STDC__ -# define P(x) x -# else -# define P(x) () -# endif -#endif - -#ifndef offsetof -#define offsetof(aggregate, member) ((size_t) &((aggregate *) 0)->member) -#endif - -#include -#if STDC_HEADERS -# define CTYPE_DOMAIN(c) 1 -#else -# define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) -#endif -#define ISALNUM(c) (CTYPE_DOMAIN (c) && isalnum (c)) -#define ISALPHA(c) (CTYPE_DOMAIN (c) && isalpha (c)) -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) -#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c)) -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#include - -char const partime_id[] = - "$Id: partime.c,v 1.2 2002/02/18 07:42:58 eggert Exp $"; - - -/* Lookup tables for names of months, weekdays, time zones. */ - -#define NAME_LENGTH_MAXIMUM 4 - -struct name_val - { - char name[NAME_LENGTH_MAXIMUM]; - int val; - }; - - -static char const *parse_decimal P ((char const *, int, int, int, int, int *, int *)); -static char const *parse_fixed P ((char const *, int, int *)); -static char const *parse_pattern_letter P ((char const *, int, struct partime *)); -static char const *parse_prefix P ((char const *, char const **, struct partime *)); -static char const *parse_ranged P ((char const *, int, int, int, int *)); -static char const *parse_varying P ((char const *, int *)); -static int lookup P ((char const *, struct name_val const[])); -static int merge_partime P ((struct partime *, struct partime const *)); -static void undefine P ((struct partime *)); - - -static struct name_val const month_names[] = -{ - {"jan", 0}, - {"feb", 1}, - {"mar", 2}, - {"apr", 3}, - {"may", 4}, - {"jun", 5}, - {"jul", 6}, - {"aug", 7}, - {"sep", 8}, - {"oct", 9}, - {"nov", 10}, - {"dec", 11}, - {"", TM_UNDEFINED} -}; - -static struct name_val const weekday_names[] = -{ - {"sun", 0}, - {"mon", 1}, - {"tue", 2}, - {"wed", 3}, - {"thu", 4}, - {"fri", 5}, - {"sat", 6}, - {"", TM_UNDEFINED} -}; - -#define RELATIVE_CONS(member, multiplier) \ - (offsetof (struct tm, member) + (multiplier) * sizeof (struct tm)) -#define RELATIVE_OFFSET(c) ((c) % sizeof (struct tm)) -#define RELATIVE_MULTIPLIER(c) ((c) / sizeof (struct tm)) -static struct name_val const relative_units[] = -{ - {"year", RELATIVE_CONS (tm_year, 1) }, - {"mont", RELATIVE_CONS (tm_mon , 1) }, - {"fort", RELATIVE_CONS (tm_mday, 14) }, - {"week", RELATIVE_CONS (tm_mday, 7) }, - {"day" , RELATIVE_CONS (tm_mday, 1) }, - {"hour", RELATIVE_CONS (tm_hour, 1) }, - {"min" , RELATIVE_CONS (tm_min , 1) }, - {"sec" , RELATIVE_CONS (tm_sec , 1) }, - {"", TM_UNDEFINED} -}; - -static struct name_val const ago[] = -{ - {"ago", 0}, - {"", TM_UNDEFINED} -}; - -static struct name_val const dst_names[] = -{ - {"dst", 1}, - {"", 0} -}; - -#define hr60nonnegative(t) ((t)/100 * 60 + (t)%100) -#define hr60(t) ((t) < 0 ? - hr60nonnegative (-(t)) : hr60nonnegative (t)) -#define zs(t, s) {s, hr60 (t)} -#define zd(t, s, d) zs (t, s), zs ((t) + 100, d) - -static struct name_val const zone_names[] = -{ - zs (-1000, "hst"), /* Hawaii */ - zd (-1000, "hast", "hadt"), /* Hawaii-Aleutian */ - zd (- 900, "akst", "akdt"), /* Alaska */ - zd (- 800, "pst" , "pdt" ), /* Pacific */ - zd (- 700, "mst" , "mdt" ), /* Mountain */ - zd (- 600, "cst" , "cdt" ), /* Central */ - zd (- 500, "est" , "edt" ), /* Eastern */ - zd (- 400, "ast" , "adt" ), /* Atlantic */ - zd (- 330, "nst" , "ndt" ), /* Newfoundland */ - zs ( 000, "utc" ), /* Coordinated Universal */ - zs ( 000, "uct" ), /* " */ - zs ( 000, "cut" ), /* " */ - zs ( 000, "ut"), /* Universal */ - zs ( 000, "z"), /* Zulu (required by ISO 8601) */ - zd ( 000, "gmt" , "bst" ), /* Greenwich Mean, British Summer */ - zd ( 000, "wet" , "west"), /* Western European */ - zd ( 100, "cet" , "cest"), /* Central European */ - zd ( 100, "met" , "mest"), /* Middle European (bug in old tz versions) */ - zd ( 100, "mez" , "mesz"), /* Mittel-Europaeische Zeit */ - zd ( 200, "eet" , "eest"), /* Eastern European */ - zs ( 530, "ist" ), /* India */ - zd ( 900, "jst" , "jdt" ), /* Japan */ - zd ( 900, "kst" , "kdt" ), /* Korea */ - zd ( 1200, "nzst", "nzdt"), /* New Zealand */ - {"lt", 1}, -#if 0 - /* The following names are duplicates or are not well attested. - It's not worth keeping a complete list, since alphabetic time zone names - are deprecated and there are lots more where these came from. */ - zs (-1100, "sst" ), /* Samoan */ - zd (- 900, "yst" , "ydt" ), /* Yukon - name is no longer used */ - zd (- 500, "ast" , "adt" ), /* Acre */ - zd (- 400, "wst" , "wdt" ), /* Western Brazil */ - zd (- 400, "cst" , "cdt" ), /* Chile */ - zd (- 200, "fst" , "fdt" ), /* Fernando de Noronha */ - zs ( 000, "wat" ), /* West African */ - zs ( 100, "cat" ), /* Central African */ - zs ( 200, "sat" ), /* South African */ - zd ( 200, "ist" , "idt" ), /* Israel */ - zs ( 300, "eat" ), /* East African */ - zd ( 300, "msk" , "msd" ), /* Moscow */ - zd ( 330, "ist" , "idt" ), /* Iran */ - zs ( 800, "hkt" ), /* Hong Kong */ - zs ( 800, "sgt" ), /* Singapore */ - zd ( 800, "cst" , "cdt" ), /* China */ - zd ( 800, "wst" , "wst" ), /* Western Australia */ - zd ( 930, "cst" , "cst" ), /* Central Australia */ - zs ( 1000, "gst" ), /* Guam */ - zd ( 1000, "est" , "est" ), /* Eastern Australia */ -#endif - {"", -1} -}; - -/* Look for a prefix of S in TABLE, returning val for first matching entry. */ -static int -lookup (s, table) - char const *s; - struct name_val const table[]; -{ - int j; - char buf[NAME_LENGTH_MAXIMUM]; - - for (j = 0; j < NAME_LENGTH_MAXIMUM; j++) - { - unsigned char c = *s; - if (! ISALPHA (c)) - { - buf[j] = '\0'; - break; - } - buf[j] = ISUPPER (c) ? tolower (c) : c; - s++; - s += *s == '.'; - } - - for (;; table++) - for (j = 0; ; j++) - if (j == NAME_LENGTH_MAXIMUM || ! table[0].name[j]) - return table[0].val; - else if (buf[j] != table[0].name[j]) - break; -} - - -/* Set *T to ``undefined'' values. */ -static void -undefine (t) - struct partime *t; -{ - t->tm.tm_sec = t->tm.tm_min = t->tm.tm_hour = t->tm.tm_mday = t->tm.tm_mon - = t->tm.tm_year = t->tm.tm_wday = t->tm.tm_yday - = t->wday_ordinal = t->ymodulus = t->yweek - = TM_UNDEFINED; - t->tmr.tm_sec = t->tmr.tm_min = t->tmr.tm_hour = - t->tmr.tm_mday = t->tmr.tm_mon = t->tmr.tm_year = 0; - t->zone = TM_UNDEFINED_ZONE; -} - -/* Patterns to look for in a time string. - Order is important: we look for the first matching pattern - whose values do not contradict values that we already know about. - See `parse_pattern_letter' below for the meaning of the pattern codes. */ -static char const time_patterns[] = -{ - /* Traditional patterns come first, - to prevent an ISO 8601 format from misinterpreting their prefixes. */ - - /* RFC 822, extended */ - 'E', '_', 'N', '_', 'y', '$', 0, - 'x', 0, - - /* traditional */ - '4', '_', 'M', '_', 'D', '_', 'h', '_', 'm', '_', 's', '$', 0, - 'R', '_', 'M', '_', 'D', '_', 'h', '_', 'm', '_', 's', '$', 0, - 'E', '_', 'N', 0, - 'N', '_', 'E', '_', 'y', ';', 0, - 'N', '_', 'E', ';', 0, - 'N', 0, - 't', ':', 'm', ':', 's', '_', 'A', 0, - 't', ':', 'm', '_', 'A', 0, - 't', '_', 'A', 0, - - /* traditional get_date */ - 'i', '_', 'x', 0, - 'Y', '/', 'n', '/', 'E', ';', 0, - 'n', '/', 'E', '/', 'y', ';', 0, - 'n', '/', 'E', ';', 0, - 'u', 0, - - /* ISO 8601:1988 formats, generalized a bit. */ - 'y', '-', 'M', '-', 'D', '$', 0, - '4', 'M', 'D', '$', 0, - 'Y', '-', 'M', '$', 0, - 'R', 'M', 'D', '$', 0, - '-', 'R', '=', 'M', '$', 0, - '-', 'R', '$', 0, - '-', '-', 'M', '=', 'D', '$', 0, - 'M', '=', 'D', 'T', 0, - '-', '-', 'M', '$', 0, - '-', '-', '-', 'D', '$', 0, - 'D', 'T', 0, - 'Y', '-', 'd', '$', 0, - '4', 'd', '$', 0, - 'R', '=', 'd', '$', 0, - '-', 'd', '$', 0, - 'd', 'T', 0, - 'y', '-', 'W', '-', 'X', 0, - 'y', 'W', 'X', 0, - 'y', '=', 'W', 0, - '-', 'r', '-', 'W', '-', 'X', 0, - 'r', '-', 'W', '-', 'X', 'T', 0, - '-', 'r', 'W', 'X', 0, - 'r', 'W', 'X', 'T', 0, - '-', 'W', '=', 'X', 0, - 'W', '=', 'X', 'T', 0, - '-', 'W', 0, - '-', 'w', '-', 'X', 0, - 'w', '-', 'X', 'T', 0, - '-', '-', '-', 'X', '$', 0, - 'X', 'T', 0, - '4', '$', 0, - 'T', 0, - 'h', ':', 'm', ':', 's', '$', 0, - 'h', 'm', 's', '$', 0, - 'h', ':', 'L', '$', 0, - 'h', 'L', '$', 0, - 'H', '$', 0, - '-', 'm', ':', 's', '$', 0, - '-', 'm', 's', '$', 0, - '-', 'L', '$', 0, - '-', '-', 's', '$', 0, - 'Y', 0, - 'Z', 0, - - 0 -}; - -/* Parse an initial prefix of STR according to *PATTERNS, setting *T. - Return the first character after the prefix, or 0 if it couldn't be parsed. - *PATTERNS is a character array containing one pattern string after another; - it is terminated by an empty string. - If success, set *PATTERNS to the next pattern to try. - Set *PATTERNS to 0 if we know there are no more patterns to try; - if *PATTERNS is initially 0, give up immediately. */ -static char const * -parse_prefix (str, patterns, t) - char const *str; - char const **patterns; - struct partime *t; -{ - char const *pat = *patterns; - unsigned char c; - - if (! pat) - return 0; - - /* Remove initial noise. */ - while (! ISALNUM (c = *str) && c != '-' && c != '+') - { - if (! c) - { - undefine (t); - *patterns = 0; - return str; - } - - str++; - } - - /* Try a pattern until one succeeds. */ - while (*pat) - { - char const *s = str; - undefine (t); - - do - { - if (! (c = *pat++)) - { - *patterns = pat; - return s; - } - } - while ((s = parse_pattern_letter (s, c, t)) != 0); - - while (*pat++) - continue; - } - - return 0; -} - -/* Parse an initial prefix of S of length DIGITS; it must be a number. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_fixed (s, digits, res) - char const *s; - int digits, *res; -{ - int n = 0; - char const *lim = s + digits; - while (s < lim) - { - unsigned d = *s++ - '0'; - if (9 < d) - return 0; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse a possibly empty initial prefix of S. - Store the parsed number into *RES. - Return the first character after the prefix. */ -static char const * -parse_varying (s, res) - char const *s; - int *res; -{ - int n = 0; - for (;;) - { - unsigned d = *s - '0'; - if (9 < d) - break; - s++; - n = 10 * n + d; - } - *res = n; - return s; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI. - Store the parsed number into *RES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_ranged (s, digits, lo, hi, res) - char const *s; - int digits, lo, hi, *res; -{ - s = parse_fixed (s, digits, res); - return s && lo <= *res && *res <= hi ? s : 0; -} - -/* Parse an initial prefix of S of length DIGITS; - it must be a number in the range LO through HI - and it may be followed by a fraction to be computed using RESOLUTION. - Store the parsed number into *RES; store the fraction times RESOLUTION, - rounded to the nearest integer, into *FRES. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_decimal (s, digits, lo, hi, resolution, res, fres) - char const *s; - int digits, lo, hi, resolution, *res, *fres; -{ - s = parse_fixed (s, digits, res); - if (s && lo <= *res && *res <= hi) - { - int f = 0; - if ((s[0] == ',' || s[0] == '.') && ISDIGIT (s[1])) - { - char const *s1 = ++s; - int num10 = 0, denom10 = 10, product; - while (ISDIGIT (*++s)) - { - int d = denom10 * 10; - if (d / 10 != denom10) - return 0; /* overflow */ - denom10 = d; - } - s = parse_fixed (s1, (int) (s - s1), &num10); - product = num10 * resolution; - f = (product + (denom10 >> 1)) / denom10; - f -= f & (product % denom10 == denom10 >> 1); /* round to even */ - if (f < 0 || product/resolution != num10) - return 0; /* overflow */ - } - *fres = f; - return s; - } - return 0; -} - -/* Parse an initial prefix of S; it must denote a time zone. - Set *ZONE to the number of seconds east of GMT, - or to TM_LOCAL_ZONE if it is the local time zone. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -char * -parzone (s, zone) - char const *s; - long *zone; -{ - char const *s1; - char sign; - int hh, mm, ss; - int minutes_east_of_UTC; - int trailing_DST; - long offset, z; - - /* The formats are LT, n, n DST, nDST, no, o - where n is a time zone name - and o is a time zone offset of the form [-+]hh[:mm[:ss]]. */ - switch (*s) - { - case '-': - case '+': - z = 0; - break; - - default: - minutes_east_of_UTC = lookup (s, zone_names); - if (minutes_east_of_UTC == -1) - return 0; - - /* Don't bother to check rest of spelling, - but look for an embedded "DST". */ - trailing_DST = 0; - while (ISALPHA ((unsigned char) *s)) - { - if ((*s == 'D' || *s == 'd') && lookup (s, dst_names)) - trailing_DST = 1; - s++; - s += *s == '.'; - } - - /* Don't modify LT. */ - if (minutes_east_of_UTC == 1) - { - *zone = TM_LOCAL_ZONE; - return (char *) s; - } - - z = minutes_east_of_UTC * 60L; - s1 = s; - - /* Look for trailing "DST" or " DST". */ - while (ISSPACE ((unsigned char) *s)) - s++; - if (lookup (s, dst_names)) - { - while (ISALPHA ((unsigned char) *s)) - { - s++; - s += *s == '.'; - } - trailing_DST = 1; - } - - if (trailing_DST) - { - *zone = z + 60*60; - return (char *) s; - } - - s = s1; - - switch (*s) - { - case '-': - case '+': - break; - - default: - *zone = z; - return (char *) s; - } - - break; - } - - sign = *s++; - - if (! (s = parse_ranged (s, 2, 0, 23, &hh))) - return 0; - mm = ss = 0; - if (*s == ':') - s++; - if (ISDIGIT (*s)) - { - if (! (s = parse_ranged (s, 2, 0, 59, &mm))) - return 0; - if (*s == ':' && s[-3] == ':' && ISDIGIT (s[1]) - && ! (s = parse_ranged (s + 1, 2, 0, 59, &ss))) - return 0; - } - if (ISDIGIT (*s)) - return 0; - offset = (hh * 60 + mm) * 60L + ss; - *zone = z + (sign == '-' ? -offset : offset); - /* ?? Are fractions allowed here? If so, they're not implemented. */ - return (char *) s; -} - -/* Parse an initial prefix of S, matching the pattern whose code is C. - Set *T accordingly. - Return the first character after the prefix, or 0 if it wasn't parsed. */ -static char const * -parse_pattern_letter (s, c, t) - char const *s; - int c; - struct partime *t; -{ - char const *s0 = s; - - switch (c) - { - case '$': /* The next character must be a non-digit. */ - if (ISDIGIT (*s)) - return 0; - break; - - case '-': - case '/': - case ':': - /* These characters stand for themselves. */ - if (*s++ != c) - return 0; - break; - - case '4': /* 4-digit year */ - s = parse_fixed (s, 4, &t->tm.tm_year); - break; - - case ';': /* The next character must be a non-digit, and cannot be ':'. */ - if (ISDIGIT (*s) || *s == ':') - return 0; - break; - - case '=': /* optional '-' */ - s += *s == '-'; - break; - - case 'A': /* AM or PM */ - /* This matches the regular expression [AaPp]\.?([Mm]\.?)?. - It must not be followed by a letter or digit; - otherwise it would match prefixes of strings like "PST". */ - switch (*s) - { - case 'A': - case 'a': - if (t->tm.tm_hour == 12) - t->tm.tm_hour = 0; - break; - - case 'P': - case 'p': - if (t->tm.tm_hour != 12) - t->tm.tm_hour += 12; - break; - - default: - return 0; - } - s++; - s += *s == '.'; - switch (*s) - { - case 'M': - case 'm': - s++; - s += *s == '.'; - break; - } - if (ISALNUM ((unsigned char) *s)) - return 0; - break; - - case 'D': /* day of month [01-31] */ - s = parse_ranged (s, 2, 1, 31, &t->tm.tm_mday); - break; - - case 'd': /* day of year [001-366] */ - s = parse_ranged (s, 3, 1, 366, &t->tm.tm_yday); - t->tm.tm_yday--; - break; - - case 'E': /* traditional day of month [1-9, 01-31] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 31, - &t->tm.tm_mday); - break; - - case 'h': /* hour [00-23] */ - s = parse_ranged (s, 2, 0, 23, &t->tm.tm_hour); - break; - - case 'H': /* hour [00-23 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 23, 60 * 60, &t->tm.tm_hour, &frac); - t->tm.tm_min = frac / 60; - t->tm.tm_sec = frac % 60; - } - break; - - case 'i': /* ordinal day number, e.g. "3rd" */ - s = parse_varying (s, &t->wday_ordinal); - if (s == s0) - return 0; - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'L': /* minute [00-59 followed by optional fraction] */ - s = parse_decimal (s, 2, 0, 59, 60, &t->tm.tm_min, &t->tm.tm_sec); - break; - - case 'm': /* minute [00-59] */ - s = parse_ranged (s, 2, 0, 59, &t->tm.tm_min); - break; - - case 'M': /* month [01-12] */ - s = parse_ranged (s, 2, 1, 12, &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'n': /* traditional month [1-9, 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_mon); - t->tm.tm_mon--; - break; - - case 'N': /* month name [e.g. "Jan"] */ - if (! TM_DEFINED (t->tm.tm_mon = lookup (s, month_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'r': /* year % 10 (remainder in origin-0 decade) [0-9] */ - s = parse_fixed (s, 1, &t->tm.tm_year); - t->ymodulus = 10; - break; - - case_R: - case 'R': /* year % 100 (remainder in origin-0 century) [00-99] */ - s = parse_fixed (s, 2, &t->tm.tm_year); - t->ymodulus = 100; - break; - - case 's': /* second [00-60 followed by optional fraction] */ - { - int frac; - s = parse_decimal (s, 2, 0, 60, 1, &t->tm.tm_sec, &frac); - t->tm.tm_sec += frac; - } - break; - - case 'T': /* 'T' or 't' */ - switch (*s++) - { - case 'T': - case 't': - break; - default: - return 0; - } - break; - - case 't': /* traditional hour [1-9 or 01-12] */ - s = parse_ranged (s, (ISDIGIT (s[0]) && ISDIGIT (s[1])) + 1, 1, 12, - &t->tm.tm_hour); - break; - - case 'u': /* relative unit */ - { - int i; - int n; - int negative = 0; - switch (*s) - { - case '-': negative = 1; - /* Fall through. */ - case '+': s++; - } - if (ISDIGIT (*s)) - s = parse_varying (s, &n); - else if (s == s0) - n = 1; - else - return 0; - if (negative) - n = -n; - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - i = lookup (s, relative_units); - if (!TM_DEFINED (i)) - return 0; - * (int *) ((char *) &t->tmr + RELATIVE_OFFSET (i)) - += n * RELATIVE_MULTIPLIER (i); - while (ISALPHA ((unsigned char) *s)) - s++; - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - if (TM_DEFINED (lookup (s, ago))) - { - t->tmr.tm_sec = - t->tmr.tm_sec; - t->tmr.tm_min = - t->tmr.tm_min; - t->tmr.tm_hour = - t->tmr.tm_hour; - t->tmr.tm_mday = - t->tmr.tm_mday; - t->tmr.tm_mon = - t->tmr.tm_mon; - t->tmr.tm_year = - t->tmr.tm_year; - while (ISALPHA ((unsigned char) *s)) - s++; - } - break; - } - - case 'w': /* 'W' or 'w' only (stands for current week) */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - break; - - case 'W': /* 'W' or 'w', followed by a week of year [00-53] */ - switch (*s++) - { - case 'W': - case 'w': - break; - default: - return 0; - } - s = parse_ranged (s, 2, 0, 53, &t->yweek); - break; - - case 'X': /* weekday (1=Mon ... 7=Sun) [1-7] */ - s = parse_ranged (s, 1, 1, 7, &t->tm.tm_wday); - t->tm.tm_wday--; - break; - - case 'x': /* weekday name [e.g. "Sun"] */ - if (! TM_DEFINED (t->tm.tm_wday = lookup (s, weekday_names))) - return 0; - /* Don't bother to check rest of spelling. */ - while (ISALPHA ((unsigned char) *s)) - s++; - break; - - case 'y': /* either R or Y */ - if (ISDIGIT (s[0]) && ISDIGIT (s[1]) && ! ISDIGIT (s[2])) - goto case_R; - /* fall into */ - case 'Y': /* year in full [4 or more digits] */ - s = parse_varying (s, &t->tm.tm_year); - if (s - s0 < 4) - return 0; - break; - - case 'Z': /* time zone */ - s = parzone (s, &t->zone); - break; - - case '_': /* possibly empty sequence of non-alphanumerics */ - while (! ISALNUM ((unsigned char) *s) && *s) - s++; - break; - - default: /* bad pattern */ - return 0; - } - - return s; -} - -/* If there is no conflict, merge into *T the additional information in *U - and return 0. Otherwise do nothing and return -1. */ -static int -merge_partime (t, u) - struct partime *t; - struct partime const *u; -{ -# define conflict(a,b) ((a) != (b) && TM_DEFINED (a) && TM_DEFINED (b)) - if (conflict (t->tm.tm_sec, u->tm.tm_sec) - || conflict (t->tm.tm_min, u->tm.tm_min) - || conflict (t->tm.tm_hour, u->tm.tm_hour) - || conflict (t->tm.tm_mday, u->tm.tm_mday) - || conflict (t->tm.tm_mon, u->tm.tm_mon) - || conflict (t->tm.tm_year, u->tm.tm_year) - || conflict (t->tm.tm_wday, u->tm.tm_wday) - || conflict (t->tm.tm_yday, u->tm.tm_yday) - || conflict (t->ymodulus, u->ymodulus) - || conflict (t->yweek, u->yweek) - || (t->zone != u->zone - && t->zone != TM_UNDEFINED_ZONE - && u->zone != TM_UNDEFINED_ZONE)) - return -1; -# undef conflict -# define merge_(a,b) if (TM_DEFINED (b)) (a) = (b); - merge_ (t->tm.tm_sec, u->tm.tm_sec) - merge_ (t->tm.tm_min, u->tm.tm_min) - merge_ (t->tm.tm_hour, u->tm.tm_hour) - merge_ (t->tm.tm_mday, u->tm.tm_mday) - merge_ (t->tm.tm_mon, u->tm.tm_mon) - merge_ (t->tm.tm_year, u->tm.tm_year) - merge_ (t->tm.tm_wday, u->tm.tm_wday) - merge_ (t->tm.tm_yday, u->tm.tm_yday) - merge_ (t->ymodulus, u->ymodulus) - merge_ (t->yweek, u->yweek) -# undef merge_ - t->tmr.tm_sec += u->tmr.tm_sec; - t->tmr.tm_min += u->tmr.tm_min; - t->tmr.tm_hour += u->tmr.tm_hour; - t->tmr.tm_mday += u->tmr.tm_mday; - t->tmr.tm_mon += u->tmr.tm_mon; - t->tmr.tm_year += u->tmr.tm_year; - if (u->zone != TM_UNDEFINED_ZONE) - t->zone = u->zone; - return 0; -} - -/* Parse a date/time prefix of S, putting the parsed result into *T. - Return the first character after the prefix. - The prefix may contain no useful information; - in that case, *T will contain only undefined values. */ -char * -partime (s, t) - char const *s; - struct partime *t; -{ - struct partime p; - - undefine (t); - - while (*s) - { - char const *patterns = time_patterns; - char const *s1; - - do - { - if (! (s1 = parse_prefix (s, &patterns, &p))) - return (char *) s; - } - while (merge_partime (t, &p) != 0); - - s = s1; - } - - return (char *) s; -} Property changes on: vendor/misc-GNU/patch/dist/partime.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/rmdir.c =================================================================== --- vendor/misc-GNU/patch/dist/rmdir.c (revision 358868) +++ vendor/misc-GNU/patch/dist/rmdir.c (nonexistent) @@ -1,87 +0,0 @@ -/* BSD compatible remove directory function for System V - Copyright (C) 1988, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#ifndef errno -extern int errno; -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif - -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - -/* rmdir adapted from GNU tar. */ - -/* Remove directory DPATH. - Return 0 if successful, -1 if not. */ - -int -rmdir (dpath) - char *dpath; -{ - pid_t cpid; - int status; - struct stat statbuf; - - if (stat (dpath, &statbuf) != 0) - return -1; /* errno already set */ - - if (!S_ISDIR (statbuf.st_mode)) - { - errno = ENOTDIR; - return -1; - } - - cpid = fork (); - switch (cpid) - { - case -1: /* cannot fork */ - return -1; /* errno already set */ - - case 0: /* child process */ - execl ("/bin/rmdir", "rmdir", dpath, (char *) 0); - _exit (1); - - default: /* parent process */ - - /* Wait for kid to finish. */ - - while (wait (&status) != cpid) - /* Do nothing. */ ; - - if (status) - { - - /* /bin/rmdir failed. */ - - errno = EIO; - return -1; - } - return 0; - } -} Property changes on: vendor/misc-GNU/patch/dist/rmdir.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/gettext.h =================================================================== --- vendor/misc-GNU/patch/dist/gettext.h (revision 358868) +++ vendor/misc-GNU/patch/dist/gettext.h (nonexistent) @@ -1,69 +0,0 @@ -/* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _LIBGETTEXT_H -#define _LIBGETTEXT_H 1 - -/* NLS can be disabled through the configure --disable-nls option. */ -#if ENABLE_NLS - -/* Get declarations of GNU message catalog functions. */ -# include - -#else - -/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which - chokes if dcgettext is defined as a macro. So include it now, to make - later inclusions of a NOP. We don't include - as well because people using "gettext.h" will not include , - and also including would fail on SunOS 4, whereas - is OK. */ -#if defined(__sun) -# include -#endif - -/* Disabled NLS. - The casts to 'const char *' serve the purpose of producing warnings - for invalid uses of the value returned from these functions. - On pre-ANSI systems without 'const', the config.h file is supposed to - contain "#define const". */ -# define gettext(Msgid) ((const char *) (Msgid)) -# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define textdomain(Domainname) ((const char *) (Domainname)) -# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) -# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) - -#endif - -/* A pseudo function call that serves as a marker for the automated - extraction of messages, but does not call gettext(). The run-time - translation is done at a different place in the code. - The argument, String, should be a literal string. Concatenated strings - and other string expressions won't work. - The macro's expansion is not parenthesized, so that it is suitable as - initializer for static 'char[]' or 'const char[]' variables. */ -#define gettext_noop(String) String - -#endif /* _LIBGETTEXT_H */ Property changes on: vendor/misc-GNU/patch/dist/gettext.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/getopt.h =================================================================== --- vendor/misc-GNU/patch/dist/getopt.h (revision 358868) +++ vendor/misc-GNU/patch/dist/getopt.h (nonexistent) @@ -1,180 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if (defined __STDC__ && __STDC__) || defined __cplusplus - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if (defined __STDC__ && __STDC__) || defined __cplusplus -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ Property changes on: vendor/misc-GNU/patch/dist/getopt.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/getopt.c =================================================================== --- vendor/misc-GNU/patch/dist/getopt.c (revision 358868) +++ vendor/misc-GNU/patch/dist/getopt.c (nonexistent) @@ -1,1273 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#ifdef VMS -# include -# if HAVE_STRING_H - 0 -# include -# endif -#endif - -#ifdef _LIBC -# include -#else -/* This is for other GNU distributions with internationalized messages. */ -# include "gettext.h" -#endif -#define _(msgid) gettext (msgid) - -#if defined _LIBC && defined USE_IN_LIBIO -# include -#endif - -#ifndef attribute_hidden -# define attribute_hidden -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized attribute_hidden; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -# if HAVE_STRING_H -# include -# else -# include -# endif - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Stored original parameters. - XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ -extern int __libc_argc; -extern char **__libc_argv; - -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -# ifdef USE_NONOPTION_FLAGS -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; -# endif - -# ifdef USE_NONOPTION_FLAGS -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -# else -# define SWAP_FLAGS(ch1, ch2) -# endif -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#if defined _LIBC && defined USE_NONOPTION_FLAGS - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#if defined _LIBC && defined USE_NONOPTION_FLAGS - if (posixly_correct == NULL - && argc == __libc_argc && argv == __libc_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int print_errors = opterr; - if (optstring[0] == ':') - print_errors = 0; - - if (argc < 1) - return -1; - - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#if defined _LIBC && defined USE_NONOPTION_FLAGS -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else if (long_only - || pfound->has_arg != p->has_arg - || pfound->flag != p->flag - || pfound->val != p->val) - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) - { - - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); -#endif - } - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (argv[optind - 1][1] == '-') - { - /* --option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("\ -%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); -#else - fprintf (stderr, _("\ -%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); -#endif - } - else - { - /* +option or -option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("\ -%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], - pfound->name); -#else - fprintf (stderr, _("\ -%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); -#endif - } - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (argv[optind][1] == '-') - { - /* --option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); -#else - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); -#endif - } - else - { - /* +option or -option */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); -#else - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - int n; -#endif - - if (posixly_correct) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: illegal option -- %c\n"), - argv[0], c); -#else - fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); -#endif - } - else - { -#if defined _LIBC && defined USE_IN_LIBIO - n = __asprintf (&buf, _("%s: invalid option -- %c\n"), - argv[0], c); -#else - fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); -#endif - } - -#if defined _LIBC && defined USE_IN_LIBIO - if (n >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#endif - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, - _("%s: option requires an argument -- %c\n"), - argv[0], c) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); -#endif - } - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); -#endif - } - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - { -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); -#endif - } - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ -#if defined _LIBC && defined USE_IN_LIBIO - char *buf; - - if (__asprintf (&buf, _("\ -%s: option requires an argument -- %c\n"), - argv[0], c) >= 0) - { - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s", buf); - else - fputs (buf, stderr); - - free (buf); - } -#else - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/dist/getopt.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/inp.h =================================================================== --- vendor/misc-GNU/patch/dist/inp.h (revision 358868) +++ vendor/misc-GNU/patch/dist/inp.h (nonexistent) @@ -1,29 +0,0 @@ -/* inputting files to be patched */ - -/* $Id: inp.h,v 1.7 2003/05/20 14:05:22 eggert Exp $ */ - -/* Copyright (C) 1986, 1988 Larry Wall - Copyright (C) 1991, 1992, 1993, 1997, 1998, 1999, 2002, 2003 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -XTERN LINENUM input_lines; /* how long is input file in lines */ - -char const *ifetch (LINENUM, bool, size_t *); -void get_input_file (char const *, char const *); -void re_input (void); -void scan_input (char *); Property changes on: vendor/misc-GNU/patch/dist/inp.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/COPYING =================================================================== --- vendor/misc-GNU/patch/dist/COPYING (revision 358868) +++ vendor/misc-GNU/patch/dist/COPYING (nonexistent) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Property changes on: vendor/misc-GNU/patch/dist/COPYING ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/malloc.c =================================================================== --- vendor/misc-GNU/patch/dist/malloc.c (revision 358868) +++ vendor/misc-GNU/patch/dist/malloc.c (nonexistent) @@ -1,38 +0,0 @@ -/* Work around bug on some systems where malloc (0) fails. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* written by Jim Meyering */ - -#if HAVE_CONFIG_H -# include -#endif -#undef malloc - -#include - -char *malloc (); - -/* Allocate an N-byte block of memory from the heap. - If N is zero, allocate a 1-byte block. */ - -char * -rpl_malloc (size_t n) -{ - if (n == 0) - n = 1; - return malloc (n); -} Property changes on: vendor/misc-GNU/patch/dist/malloc.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/getopt1.c =================================================================== --- vendor/misc-GNU/patch/dist/getopt1.c (revision 358868) +++ vendor/misc-GNU/patch/dist/getopt1.c (nonexistent) @@ -1,195 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _LIBC -# include -#else -# include "getopt.h" -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - -# ifdef _LIBC -libc_hidden_def (getopt_long) -libc_hidden_def (getopt_long_only) -# endif - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ Property changes on: vendor/misc-GNU/patch/dist/getopt1.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/partime.h =================================================================== --- vendor/misc-GNU/patch/dist/partime.h (revision 358868) +++ vendor/misc-GNU/patch/dist/partime.h (nonexistent) @@ -1,77 +0,0 @@ -/* Parse a string, yielding a struct partime that describes it. */ - -/* Copyright 1993, 1994, 1995, 1997 Paul Eggert - Distributed under license by the Free Software Foundation, Inc. - - This file is part of RCS. - - RCS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - RCS is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with RCS; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Report problems and direct all questions to: - - rcs-bugs@cs.purdue.edu - - */ - -#define TM_UNDEFINED (-1) -#define TM_DEFINED(x) (0 <= (x)) - -/* #include if you want to use these symbols. */ -#define TM_LOCAL_ZONE LONG_MIN -#define TM_UNDEFINED_ZONE (LONG_MIN + 1) - -struct partime - { - /* This structure describes the parsed time. - Only the following tm_* members are used: - sec, min, hour, mday, mon, year, wday, yday. - If ! TM_DEFINED (value), the parser never found the value. - The tm_year field is the actual year, not the year - 1900; - but see ymodulus below. */ - struct tm tm; - - /* Like tm, but values are relative to the value in tm, - and values are initialized to 0 rather than to TM_UNDEFINED. - Only the following tm_* members are used: - sec, min, hour, mday, mon, year. */ - struct tm tmr; - - /* If TM_DEFINED (wday_ordinal), - then day number (e.g. 3 in "3rd Sunday"). */ - int wday_ordinal; - - /* If TM_DEFINED (ymodulus), - then tm.tm_year is actually modulo ymodulus. */ - int ymodulus; - - /* Week of year, ISO 8601 style. - If ! TM_DEFINED (yweek), the parser never found yweek. - Weeks start on Mondays. - Week 1 includes Jan 4. */ - int yweek; - - /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */ - long zone; - }; - -#if defined __STDC__ || has_prototypes -# define __PARTIME_P(x) x -#else -# define __PARTIME_P(x) () -#endif - -char *partime __PARTIME_P ((char const *, struct partime *)); -char *parzone __PARTIME_P ((char const *, long *)); Property changes on: vendor/misc-GNU/patch/dist/partime.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/aclocal.m4 =================================================================== --- vendor/misc-GNU/patch/dist/aclocal.m4 (revision 358868) +++ vendor/misc-GNU/patch/dist/aclocal.m4 (nonexistent) @@ -1,667 +0,0 @@ -# backupfile.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_BACKUPFILE], -[ - dnl Prerequisites of lib/backupfile.c. - AC_REQUIRE([AC_HEADER_DIRENT]) - AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h) - AC_CHECK_DECLS_ONCE(getenv malloc) - jm_CHECK_TYPE_STRUCT_DIRENT_D_INO - - dnl Prerequisites of lib/addext.c. - AC_REQUIRE([jm_AC_DOS]) - AC_SYS_LONG_FILE_NAMES - AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h) - AC_CHECK_FUNCS(pathconf) -]) -#serial 5 - -dnl From Jim Meyering. -dnl -dnl Check whether struct dirent has a member named d_ino. -dnl - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO], - [AC_REQUIRE([AC_HEADER_DIRENT])dnl - AC_CACHE_CHECK([for d_ino member in directory struct], - jm_cv_struct_dirent_d_ino, - [AC_TRY_LINK(dnl - [ -#include -#ifdef HAVE_DIRENT_H -# include -#else /* not HAVE_DIRENT_H */ -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* HAVE_SYS_NDIR_H */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* HAVE_SYS_DIR_H */ -# ifdef HAVE_NDIR_H -# include -# endif /* HAVE_NDIR_H */ -#endif /* HAVE_DIRENT_H */ - ], - [struct dirent dp; dp.d_ino = 0;], - - jm_cv_struct_dirent_d_ino=yes, - jm_cv_struct_dirent_d_ino=no) - ] - ) - if test $jm_cv_struct_dirent_d_ino = yes; then - AC_DEFINE(D_INO_IN_DIRENT, 1, - [Define if there is a member named d_ino in the struct describing - directory headers.]) - fi - ] -) -# dirname.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_DIRNAME], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([jm_AC_DOS]) - - dnl Prerequisites of lib/dirname.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/basename.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) - - dnl Prerequisites of lib/stripslash.c. - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) -#serial 5 - -# Define some macros required for proper operation of code in lib/*.c -# on MSDOS/Windows systems. - -# From Jim Meyering. - -AC_DEFUN([jm_AC_DOS], - [ - AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], - [ - AC_TRY_COMPILE([], - [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ -neither MSDOS nor Windows -#endif], - [ac_cv_win_or_dos=yes], - [ac_cv_win_or_dos=no]) - ]) - - if test x"$ac_cv_win_or_dos" = xyes; then - ac_fs_accepts_drive_letter_prefix=1 - ac_fs_backslash_is_file_name_separator=1 - else - ac_fs_accepts_drive_letter_prefix=0 - ac_fs_backslash_is_file_name_separator=0 - fi - - AH_VERBATIM(FILESYSTEM_PREFIX_LEN, - [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX -# define FILESYSTEM_PREFIX_LEN(Filename) \ - ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) -#else -# define FILESYSTEM_PREFIX_LEN(Filename) 0 -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], - $ac_fs_accepts_drive_letter_prefix, - [Define on systems for which file names may have a so-called - `drive letter' prefix, define this to compute the length of that - prefix, including the colon.]) - - AH_VERBATIM(ISSLASH, - [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define ISSLASH(C) ((C) == '/') -#endif]) - - AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], - $ac_fs_backslash_is_file_name_separator, - [Define if the backslash character may also serve as a file name - component separator.]) - ]) -#serial 7 - -AC_DEFUN([gl_ERROR], -[ - AC_FUNC_ERROR_AT_LINE - dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). - jm_PREREQ_ERROR -]) - -# Prerequisites of lib/error.c. -AC_DEFUN([jm_PREREQ_ERROR], -[ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_VPRINTF]) - AC_CHECK_FUNCS(strerror) - AC_CHECK_DECLS([strerror]) - AC_FUNC_STRERROR_R -]) -# getopt.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_GETOPT], -[ - dnl Prerequisites of lib/getopt.c. - AC_CHECK_HEADERS_ONCE(string.h) -]) -# malloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether malloc accepts 0 as its argument. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_MALLOC], -[ - AC_REQUIRE([AC_FUNC_MALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. - if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then - gl_PREREQ_MALLOC - fi -]) - -# Prerequisites of lib/malloc.c. -AC_DEFUN([gl_PREREQ_MALLOC], [ - : -]) -# mbrtowc.m4 serial 5 -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert - -dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with -dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. - -AC_DEFUN([jm_FUNC_MBRTOWC], -[ - AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], - jm_cv_func_mbrtowc, - [AC_TRY_LINK( - [#include ], - [mbstate_t state; return ! (sizeof state && mbrtowc);], - jm_cv_func_mbrtowc=yes, - jm_cv_func_mbrtowc=no)]) - if test $jm_cv_func_mbrtowc = yes; then - AC_DEFINE(HAVE_MBRTOWC, 1, - [Define to 1 if mbrtowc and mbstate_t are properly declared.]) - fi -]) -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# From Paul Eggert. - -# BeOS 5 has but does not define mbstate_t, -# so you can't declare an object of that type. -# Check for this incompatibility with Standard C. - -# AC_TYPE_MBSTATE_T -# ----------------- -AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include ], - [mbstate_t x; return sizeof x;])], - [ac_cv_type_mbstate_t=yes], - [ac_cv_type_mbstate_t=no])]) - if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T], 1, - [Define to 1 if declares mbstate_t.]) - else - AC_DEFINE([mbstate_t], int, - [Define to a type if does not define.]) - fi]) -# memchr.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_MEMCHR], -[ - AC_REPLACE_FUNCS(memchr) - if test $ac_cv_func_memchr = no; then - jm_PREREQ_MEMCHR - fi -]) - -# Prerequisites of lib/memchr.c. -AC_DEFUN([jm_PREREQ_MEMCHR], [ - AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) - AC_CHECK_HEADERS(bp-sym.h) -]) -#serial 1 - -dnl From Mumit Khan and Paul Eggert -dnl Determine whether mkdir accepts only one argument instead of the usual two. - -AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG], - [AC_CHECK_FUNCS(mkdir) - AC_CACHE_CHECK([whether mkdir takes only one argument], - patch_cv_mkdir_takes_one_arg, - [patch_cv_mkdir_takes_one_arg=no - if test $ac_cv_func_mkdir = yes; then - AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".", 0);], - , - [AC_TRY_COMPILE([ -#include -#include - ], - [mkdir (".");], - patch_cv_mkdir_takes_one_arg=yes - )] - ) - fi - ] - ) - if test $patch_cv_mkdir_takes_one_arg = yes; then - AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, - [Define if mkdir takes only one argument.]) - fi - ] -) -# onceonly.m4 serial 3 -dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl This file defines some "once only" variants of standard autoconf macros. -dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS -dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS -dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS -dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC -dnl The advantage is that the check for each of the headers/functions/decls -dnl will be put only once into the 'configure' file. It keeps the size of -dnl the 'configure' file down, and avoids redundant output when 'configure' -dnl is run. -dnl The drawback is that the checks cannot be conditionalized. If you write -dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi -dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to -dnl empty, and the check will be inserted before the body of the AC_DEFUNed -dnl function. - -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) - -# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of -# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). -AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ - : - AC_FOREACH([gl_HEADER_NAME], [$1], [ - AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), - [-./], [___])), [ - AC_CHECK_HEADERS(gl_HEADER_NAME) - ]) - AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, - [-./], [___]))) - ]) -]) - -# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of -# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). -AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ - : - AC_FOREACH([gl_FUNC_NAME], [$1], [ - AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ - AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) - ]) - AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) - ]) -]) - -# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of -# AC_CHECK_DECLS(DECL1, DECL2, ...). -AC_DEFUN([AC_CHECK_DECLS_ONCE], [ - : - AC_FOREACH([gl_DECL_NAME], [$1], [ - AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ - AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) - ]) - AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) - ]) -]) -# quote.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTE], -[ - dnl Prerequisites of lib/quote.c. - AC_CHECK_HEADERS_ONCE(stddef.h) -]) -# quotearg.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_QUOTEARG], -[ - dnl Prerequisites of lib/quotearg.c. - AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) - AC_CHECK_FUNCS_ONCE(iswprint mbsinit) - AC_TYPE_MBSTATE_T - jm_FUNC_MBRTOWC -]) -# realloc.m4 serial 7 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Jim Meyering. -dnl Determine whether realloc works when both arguments are 0. -dnl If it doesn't, arrange to use the replacement function. - -AC_DEFUN([jm_FUNC_REALLOC], -[ - AC_REQUIRE([AC_FUNC_REALLOC]) - dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. - if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then - gl_PREREQ_REALLOC - fi -]) - -# Prerequisites of lib/realloc.c. -AC_DEFUN([gl_PREREQ_REALLOC], [ - : -]) -# rmdir.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_FUNC_RMDIR], -[ - AC_REPLACE_FUNCS(rmdir) - if test $ac_cv_func_rmdir = no; then - gl_PREREQ_RMDIR - fi -]) - -# Prerequisites of lib/rmdir.c. -AC_DEFUN([gl_PREREQ_RMDIR], [ - AC_REQUIRE([AC_HEADER_STAT]) - : -]) - -# Check for setmode, DOS style. - -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AC_FUNC_SETMODE_DOS], - [AC_CHECK_HEADERS(fcntl.h unistd.h) - AC_CACHE_CHECK([for DOS-style setmode], - [ac_cv_func_setmode_dos], - [AC_TRY_LINK( - [#include - #if HAVE_FCNTL_H - # include - #endif - #if HAVE_UNISTD_H - # include - #endif], - [int ret = setmode && setmode (1, O_BINARY);], - [ac_cv_func_setmode_dos=yes], - [ac_cv_func_setmode_dos=no])]) - if test $ac_cv_func_setmode_dos = yes; then - AC_DEFINE(HAVE_SETMODE_DOS, 1, - [Define to 1 if you have the DOS-style `setmode' function.]) - fi]) -# Check for stdbool.h that conforms to C99. - -# Copyright (C) 2002-2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Prepare for substituting if it is not supported. - -AC_DEFUN([AM_STDBOOL_H], -[ - AC_REQUIRE([AC_HEADER_STDBOOL]) - - # Define two additional variables used in the Makefile substitution. - - if test "$ac_cv_header_stdbool_h" = yes; then - STDBOOL_H='' - else - STDBOOL_H='stdbool.h' - fi - AC_SUBST([STDBOOL_H]) - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - AC_SUBST([HAVE__BOOL]) -]) - -# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf -# have this macro built-in. - -AC_DEFUN([AC_HEADER_STDBOOL], - [AC_CACHE_CHECK([for stdbool.h that conforms to C99], - [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: false is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - ], - [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], - [ac_cv_header_stdbool_h=yes], - [ac_cv_header_stdbool_h=no])]) - AC_CHECK_TYPES([_Bool]) - if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) - fi]) -#serial 7 -*- autoconf -*- - -dnl From Jim Meyering. -dnl -dnl See if the glibc *_unlocked I/O macros or functions are available. -dnl Use only those *_unlocked macros or functions that are declared -dnl (because some of them were declared in Solaris 2.5.1 but were removed -dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run -dnl on Solaris 2.6). - -AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], -[ - dnl Persuade glibc to declare fgets_unlocked(), fputs_unlocked() - dnl etc. - AC_REQUIRE([AC_GNU_SOURCE]) - - AC_CHECK_DECLS_ONCE( - [clearerr_unlocked feof_unlocked ferror_unlocked - fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked - fread_unlocked fwrite_unlocked getc_unlocked - getchar_unlocked putc_unlocked putchar_unlocked]) -]) -#serial 5 - -dnl From Jim Meyering - -dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- -dnl usually in . -dnl Some systems have utime.h but don't declare the struct anywhere. - -AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], -[ - AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) - AC_REQUIRE([AC_HEADER_TIME]) - AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf, - [AC_TRY_COMPILE( - [ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UTIME_H -# include -#endif - ], - [static struct utimbuf x; x.actime = x.modtime;], - fu_cv_sys_struct_utimbuf=yes, - fu_cv_sys_struct_utimbuf=no) - ]) - - if test $fu_cv_sys_struct_utimbuf = yes; then - AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, - [Define if struct utimbuf is declared -- usually in . - Some systems have utime.h but don't declare the struct anywhere. ]) - fi -]) -# xalloc.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -AC_DEFUN([gl_XALLOC], -[ - gl_PREREQ_XMALLOC - gl_PREREQ_XSTRDUP -]) - -# Prerequisites of lib/xmalloc.c. -AC_DEFUN([gl_PREREQ_XMALLOC], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([jm_FUNC_MALLOC]) - AC_REQUIRE([jm_FUNC_REALLOC]) -]) - -# Prerequisites of lib/xstrdup.c. -AC_DEFUN([gl_PREREQ_XSTRDUP], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_CHECK_HEADERS_ONCE(string.h) -]) Index: vendor/misc-GNU/patch/dist/install-sh =================================================================== --- vendor/misc-GNU/patch/dist/install-sh (revision 358868) +++ vendor/misc-GNU/patch/dist/install-sh (nonexistent) @@ -1,294 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" - -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift - - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi - - pathcomp=$pathcomp/ -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi - -# Make a couple of temp file names in the proper directory. - - dsttmp=$dstdir/#inst.$$# - rmtmp=$dstdir/#rm.$$# - -# Trap to clean up temp files at exit. - - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 - -# Move or copy the file name to the temp name - - $doit $instcmd "$src" "$dsttmp" && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && - -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. - -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && - -# Now rename the file to the real destination. - - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - -fi && - -# The final little trick to "correctly" pass the exit status to the exit trap. - -{ - (exit 0); exit -} Property changes on: vendor/misc-GNU/patch/dist/install-sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: vendor/misc-GNU/patch/dist/xalloc.h =================================================================== --- vendor/misc-GNU/patch/dist/xalloc.h (revision 358868) +++ vendor/misc-GNU/patch/dist/xalloc.h (nonexistent) @@ -1,87 +0,0 @@ -/* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef XALLOC_H_ -# define XALLOC_H_ - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -# ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ -# define __attribute__(x) -# endif -# endif - -# ifndef ATTRIBUTE_NORETURN -# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) -# endif - -/* Exit value when the requested amount of memory is not available. - It is initialized to EXIT_FAILURE, but the caller may set it to - some other value. */ -extern int xalloc_exit_failure; - -/* If this pointer is non-zero, run the specified function upon each - allocation failure. It is initialized to zero. */ -extern void (*xalloc_fail_func) PARAMS ((void)); - -/* If XALLOC_FAIL_FUNC is undefined or a function that returns, this - message is output. It is translated via gettext. - Its value is "memory exhausted". */ -extern char const xalloc_msg_memory_exhausted[]; - -/* This function is always triggered when memory is exhausted. It is - in charge of honoring the three previous items. This is the - function to call when one wants the program to die because of a - memory allocation failure. */ -extern void xalloc_die PARAMS ((void)) ATTRIBUTE_NORETURN; - -void *xmalloc PARAMS ((size_t n)); -void *xcalloc PARAMS ((size_t n, size_t s)); -void *xrealloc PARAMS ((void *p, size_t n)); -char *xstrdup PARAMS ((const char *str)); - -# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) -# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) -# define XREALLOC(Ptr, Type, N_items) \ - ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) - -/* Declare and alloc memory for VAR of type TYPE. */ -# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) - -/* Free VAR only if non NULL. */ -# define XFREE(Var) \ - do { \ - if (Var) \ - free (Var); \ - } while (0) - -/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ -# define CCLONE(Src, Num) \ - (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) - -/* Return a malloc'ed copy of SRC. */ -# define CLONE(Src) CCLONE (Src, 1) - - -#endif /* !XALLOC_H_ */ Property changes on: vendor/misc-GNU/patch/dist/xalloc.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/patch.man =================================================================== --- vendor/misc-GNU/patch/dist/patch.man (revision 358868) +++ vendor/misc-GNU/patch/dist/patch.man (nonexistent) @@ -1,1160 +0,0 @@ -.\" patch man page -.de Id -.ds Dt \\$4 -.. -.Id $Id: patch.man,v 1.31 2002/05/25 10:36:44 eggert Exp $ -.ds = \-\^\- -.de Sp -.if t .sp .3 -.if n .sp -.. -.TH PATCH 1 \*(Dt GNU -.ta 3n -.SH NAME -patch \- apply a diff file to an original -.SH SYNOPSIS -.B patch -.RI [ options ] -.RI [ originalfile -.RI [ patchfile ]] -.Sp -but usually just -.Sp -.BI "patch \-p" "num" -.BI < patchfile -.SH DESCRIPTION -.B patch -takes a patch file -.I patchfile -containing a difference listing produced by the -.B diff -program and applies those differences to one or more original files, -producing patched versions. -Normally the patched versions are put in place of the originals. -Backups can be made; see the -.B \-b -or -.B \*=backup -option. -The names of the files to be patched are usually taken from the patch file, -but if there's just one file to be patched it can specified on the -command line as -.IR originalfile . -.PP -Upon startup, patch attempts to determine the type of the diff listing, -unless overruled by a -\fB\-c\fP (\fB\*=context\fP), -\fB\-e\fP (\fB\*=ed\fP), -\fB\-n\fP (\fB\*=normal\fP), -or -\fB\-u\fP (\fB\*=unified\fP) -option. -Context diffs (old-style, new-style, and unified) and -normal diffs are applied by the -.B patch -program itself, while -.B ed -diffs are simply fed to the -.BR ed (1) -editor via a pipe. -.PP -.B patch -tries to skip any leading garbage, apply the diff, -and then skip any trailing garbage. -Thus you could feed an article or message containing a -diff listing to -.BR patch , -and it should work. -If the entire diff is indented by a consistent amount, -or if a context diff contains lines ending in \s-1CRLF\s0 -or is encapsulated one or more times by prepending -"\fB\- \fP" to lines starting with "\fB\-\fP" as specified by Internet RFC 934, -this is taken into account. -After removing indenting or encapsulation, -lines beginning with -.B # -are ignored, as they are considered to be comments. -.PP -With context diffs, and to a lesser extent with normal diffs, -.B patch -can detect when the line numbers mentioned in the patch are incorrect, -and attempts to find the correct place to apply each hunk of the patch. -As a first guess, it takes the line number mentioned for the hunk, plus or -minus any offset used in applying the previous hunk. -If that is not the correct place, -.B patch -scans both forwards and backwards for a set of lines matching the context -given in the hunk. -First -.B patch -looks for a place where all lines of the context match. -If no such place is found, and it's a context diff, and the maximum fuzz factor -is set to 1 or more, then another scan takes place ignoring the first and last -line of context. -If that fails, and the maximum fuzz factor is set to 2 or more, -the first two and last two lines of context are ignored, -and another scan is made. -(The default maximum fuzz factor is 2.) -If -.B patch -cannot find a place to install that hunk of the patch, it puts the -hunk out to a reject file, which normally is the name of the output file -plus a -.B \&.rej -suffix, or -.B # -if -.B \&.rej -would generate a file name that is too long -(if even appending the single character -.B # -makes the file name too long, then -.B # -replaces the file name's last character). -(The rejected hunk comes out in ordinary context diff form regardless of -the input patch's form. -If the input was a normal diff, many of the contexts are simply null.) -The line numbers on the hunks in the reject file may be different than -in the patch file: they reflect the approximate location patch thinks the -failed hunks belong in the new file rather than the old one. -.PP -As each hunk is completed, you are told if the hunk -failed, and if so which line (in the new file) -.B patch -thought the hunk should go on. -If the hunk is installed at a different line -from the line number specified in the diff you -are told the offset. -A single large offset -.I may -indicate that a hunk was installed in the -wrong place. -You are also told if a fuzz factor was used to make the match, in which -case you should also be slightly suspicious. -If the -.B \*=verbose -option is given, you are also told about hunks that match exactly. -.PP -If no original file -.I origfile -is specified on the command line, -.B patch -tries to figure out from the leading garbage what the name of the file -to edit is, using the following rules. -.LP -First, -.B patch -takes an ordered list of candidate file names as follows: -.TP 3 -.B " \(bu" -If the header is that of a context diff, -.B patch -takes the old and new file names in the header. -A name is ignored if it does not have enough slashes to satisfy the -.BI \-p num -or -.BI \*=strip= num -option. -The name -.B /dev/null -is also ignored. -.TP -.B " \(bu" -If there is an -.B Index:\& -line in the leading garbage -and if either the old and new names are both absent or if -.B patch -is conforming to \s-1POSIX\s0, -.B patch -takes the name in the -.B Index:\& -line. -.TP -.B " \(bu" -For the purpose of the following rules, -the candidate file names are considered to be in the order (old, new, index), -regardless of the order that they appear in the header. -.LP -Then -.B patch -selects a file name from the candidate list as follows: -.TP 3 -.B " \(bu" -If some of the named files exist, -.B patch -selects the first name if conforming to \s-1POSIX\s0, -and the best name otherwise. -.TP -.B " \(bu" -If -.B patch -is not ignoring \s-1RCS\s0, ClearCase, Perforce, and \s-1SCCS\s0 (see the -.BI "\-g\ " num -or -.BI \*=get= num -option), and no named files exist -but an \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master is found, -.B patch -selects the first named file -with an \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master. -.TP -.B " \(bu" -If no named files exist, -no \s-1RCS\s0, ClearCase, Perforce, or \s-1SCCS\s0 master was found, -some names are given, -.B patch -is not conforming to \s-1POSIX\s0, -and the patch appears to create a file, -.B patch -selects the best name requiring the creation of the fewest directories. -.TP -.B " \(bu" -If no file name results from the above heuristics, you are asked -for the name of the file to patch, and -.B patch -selects that name. -.LP -To determine the -.I best -of a nonempty list of file names, -.B patch -first takes all the names with the fewest path name components; -of those, it then takes all the names with the shortest basename; -of those, it then takes all the shortest names; -finally, it takes the first remaining name. -.PP -Additionally, if the leading garbage contains a -.B Prereq:\& -line, -.B patch -takes the first word from the prerequisites line (normally a version -number) and checks the original file to see if that word can be found. -If not, -.B patch -asks for confirmation before proceeding. -.PP -The upshot of all this is that you should be able to say, while in a news -interface, something like the following: -.Sp - \fB| patch \-d /usr/src/local/blurfl\fP -.Sp -and patch a file in the -.B blurfl -directory directly from the article containing -the patch. -.PP -If the patch file contains more than one patch, -.B patch -tries to apply each of them as if they came from separate patch files. -This means, among other things, that it is assumed that the name of the file -to patch must be determined for each diff listing, -and that the garbage before each diff listing -contains interesting things such as file names and revision level, as -mentioned previously. -.SH OPTIONS -.TP 3 -\fB\-b\fP or \fB\*=backup\fP -Make backup files. -That is, when patching a file, -rename or copy the original instead of removing it. -When backing up a file that does not exist, -an empty, unreadable backup file is created -as a placeholder to represent the nonexistent file. -See the -.B \-V -or -.B \*=version\-control -option for details about how backup file names are determined. -.TP -.B \*=backup\-if\-mismatch -Back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default unless -.B patch -is conforming to \s-1POSIX\s0. -.TP -.B \*=no\-backup\-if\-mismatch -Do not back up a file if the patch does not match the file exactly -and if backups are not otherwise requested. -This is the default if -.B patch -is conforming to \s-1POSIX\s0. -.TP -\fB\-B\fP \fIpref\fP or \fB\*=prefix=\fP\fIpref\fP -Prefix -.I pref -to a file name when generating its simple backup file name. -For example, with -.B "\-B\ /junk/" -the simple backup file name for -.B src/patch/util.c -is -.BR /junk/src/patch/util.c . -.TP -\fB\*=binary\fP -Read and write all files in binary mode, -except for standard output and -.BR /dev/tty . -This option has no effect on \s-1POSIX\s0-conforming systems. -On systems like \s-1DOS\s0 where this option makes a difference, -the patch should be generated by -.BR "diff\ \-a\ \*=binary" . -.TP -\fB\-c\fP or \fB\*=context\fP -Interpret the patch file as a ordinary context diff. -.TP -\fB\-d\fP \fIdir\fP or \fB\*=directory=\fP\fIdir\fP -Change to the directory -.I dir -immediately, before doing -anything else. -.TP -\fB\-D\fP \fIdefine\fP or \fB\*=ifdef=\fP\fIdefine\fP -Use the -.BR #ifdef " .\|.\|. " #endif -construct to mark changes, with -.I define -as the differentiating symbol. -.TP -.B "\*=dry\-run" -Print the results of applying the patches without actually changing any files. -.TP -\fB\-e\fP or \fB\*=ed\fP -Interpret the patch file as an -.B ed -script. -.TP -\fB\-E\fP or \fB\*=remove\-empty\-files\fP -Remove output files that are empty after the patches have been applied. -Normally this option is unnecessary, since -.B patch -can examine the time stamps on the header to determine whether a file -should exist after patching. -However, if the input is not a context diff or if -.B patch -is conforming to \s-1POSIX\s0, -.B patch -does not remove empty patched files unless this option is given. -When -.B patch -removes a file, it also attempts to remove any empty ancestor directories. -.TP -\fB\-f\fP or \fB\*=force\fP -Assume that the user knows exactly what he or she is doing, and do not -ask any questions. Skip patches whose headers -do not say which file is to be patched; patch files even though they have the -wrong version for the -.B Prereq:\& -line in the patch; and assume that -patches are not reversed even if they look like they are. -This option does not suppress commentary; use -.B \-s -for that. -.TP -\fB\-F\fP \fInum\fP or \fB\*=fuzz=\fP\fInum\fP -Set the maximum fuzz factor. -This option only applies to diffs that have context, and causes -.B patch -to ignore up to that many lines in looking for places to install a hunk. -Note that a larger fuzz factor increases the odds of a faulty patch. -The default fuzz factor is 2, and it may not be set to more than -the number of lines of context in the context diff, ordinarily 3. -.TP -\fB\-g\fP \fInum\fP or \fB\*=get=\fP\fInum\fP -This option controls -.BR patch 's -actions when a file is under \s-1RCS\s0 or \s-1SCCS\s0 control, -and does not exist or is read-only and matches the default version, -or when a file is under ClearCase or Perforce control and does not exist. -If -.I num -is positive, -.B patch -gets (or checks out) the file from the revision control system; if zero, -.B patch -ignores \s-1RCS\s0, ClearCase, Perforce, and \s-1SCCS\s0 -and does not get the file; and if negative, -.B patch -asks the user whether to get the file. -The default value of this option is given by the value of the -.B PATCH_GET -environment variable if it is set; if not, the default value is zero if -.B patch -is conforming to \s-1POSIX\s0, negative otherwise. -.TP -.B "\*=help" -Print a summary of options and exit. -.TP -\fB\-i\fP \fIpatchfile\fP or \fB\*=input=\fP\fIpatchfile\fP -Read the patch from -.IR patchfile . -If -.I patchfile -is -.BR \- , -read from standard input, the default. -.TP -\fB\-l\fP or \fB\*=ignore\-whitespace\fP -Match patterns loosely, in case tabs or spaces -have been munged in your files. -Any sequence of one or more blanks in the patch file matches any sequence -in the original file, and sequences of blanks at the ends of lines are ignored. -Normal characters must still match exactly. -Each line of the context must still match a line in the original file. -.TP -\fB\-n\fP or \fB\*=normal\fP -Interpret the patch file as a normal diff. -.TP -\fB\-N\fP or \fB\*=forward\fP -Ignore patches that seem to be reversed or already applied. -See also -.BR \-R . -.TP -\fB\-o\fP \fIoutfile\fP or \fB\*=output=\fP\fIoutfile\fP -Send output to -.I outfile -instead of patching files in place. -Do not use this option if -.I outfile -is one of the files to be patched. -.TP -\fB\-p\fP\fInum\fP or \fB\*=strip\fP\fB=\fP\fInum\fP -Strip the smallest prefix containing -.I num -leading slashes from each file name found in the patch file. -A sequence of one or more adjacent slashes is counted as a single slash. -This controls how file names found in the patch file are treated, in case -you keep your files in a different directory than the person who sent -out the patch. -For example, supposing the file name in the patch file was -.Sp - \fB/u/howard/src/blurfl/blurfl.c\fP -.Sp -setting -.B \-p0 -gives the entire file name unmodified, -.B \-p1 -gives -.Sp - \fBu/howard/src/blurfl/blurfl.c\fP -.Sp -without the leading slash, -.B \-p4 -gives -.Sp - \fBblurfl/blurfl.c\fP -.Sp -and not specifying -.B \-p -at all just gives you \fBblurfl.c\fP. -Whatever you end up with is looked for either in the current directory, -or the directory specified by the -.B \-d -option. -.TP -.B \*=posix -Conform more strictly to the \s-1POSIX\s0 standard, as follows. -.RS -.TP 3 -.B " \(bu" -Take the first existing file from the list (old, new, index) -when intuiting file names from diff headers. -.TP -.B " \(bu" -Do not remove files that are empty after patching. -.TP -.B " \(bu" -Do not ask whether to get files from \s-1RCS\s0, ClearCase, Perforce, -or \s-1SCCS\s0. -.TP -.B " \(bu" -Require that all options precede the files in the command line. -.TP -.B " \(bu" -Do not backup files when there is a mismatch. -.RE -.TP -.BI \*=quoting\-style= word -Use style -.I word -to quote output names. -The -.I word -should be one of the following: -.RS -.TP -.B literal -Output names as-is. -.TP -.B shell -Quote names for the shell if they contain shell metacharacters or would -cause ambiguous output. -.TP -.B shell-always -Quote names for the shell, even if they would normally not require quoting. -.TP -.B c -Quote names as for a C language string. -.TP -.B escape -Quote as with -.B c -except omit the surrounding double-quote characters. -.LP -You can specify the default value of the -.B \*=quoting\-style -option with the environment variable -.BR QUOTING_STYLE . -If that environment variable is not set, the default value is -.BR shell . -.RE -.TP -\fB\-r\fP \fIrejectfile\fP or \fB\*=reject\-file=\fP\fIrejectfile\fP -Put rejects into -.I rejectfile -instead of the default -.B \&.rej -file. -.TP -\fB\-R\fP or \fB\*=reverse\fP -Assume that this patch was created with the old and new files swapped. -(Yes, I'm afraid that does happen occasionally, human nature being what it -is.) -.B patch -attempts to swap each hunk around before applying it. -Rejects come out in the swapped format. -The -.B \-R -option does not work with -.B ed -diff scripts because there is too little -information to reconstruct the reverse operation. -.Sp -If the first hunk of a patch fails, -.B patch -reverses the hunk to see if it can be applied that way. -If it can, you are asked if you want to have the -.B \-R -option set. -If it can't, the patch continues to be applied normally. -(Note: this method cannot detect a reversed patch if it is a normal diff -and if the first command is an append (i.e. it should have been a delete) -since appends always succeed, due to the fact that a null context matches -anywhere. -Luckily, most patches add or change lines rather than delete them, so most -reversed normal diffs begin with a delete, which fails, triggering -the heuristic.) -.TP -\fB\-s\fP or \fB\*=silent\fP or \fB\*=quiet\fP -Work silently, unless an error occurs. -.TP -\fB\-t\fP or \fB\*=batch\fP -Suppress questions like -.BR \-f , -but make some different assumptions: -skip patches whose headers do not contain file names (the same as \fB\-f\fP); -skip patches for which the file has the wrong version for the -.B Prereq:\& -line -in the patch; and assume that patches are reversed if they look like -they are. -.TP -\fB\-T\fP or \fB\*=set\-time\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use local time. This option is not recommended, because patches using -local time cannot easily be used by people in other time zones, and -because local time stamps are ambiguous when local clocks move backwards -during daylight-saving time adjustments. Instead of using this option, -generate patches with \s-1UTC\s0 and use the -.B \-Z -or -.B \*=set\-utc -option instead. -.TP -\fB\-u\fP or \fB\*=unified\fP -Interpret the patch file as a unified context diff. -.TP -\fB\-v\fP or \fB\*=version\fP -Print out -.BR patch 's -revision header and patch level, and exit. -.TP -\fB\-V\fP \fImethod\fP or \fB\*=version\-control=\fP\fImethod\fP -Use -.I method -to determine -backup file names. The method can also be given by the -.B PATCH_VERSION_CONTROL -(or, if that's not set, the -.BR VERSION_CONTROL ) -environment variable, which is overridden by this option. -The method does not affect whether backup files are made; -it affects only the names of any backup files that are made. -.Sp -The value of -.I method -is like the \s-1GNU\s0 -Emacs `version-control' variable; -.B patch -also recognizes synonyms that -are more descriptive. The valid values for -.I method -are (unique abbreviations are -accepted): -.RS -.TP 3 -\fBexisting\fP or \fBnil\fP -Make numbered backups of files that already have them, -otherwise simple backups. -This is the default. -.TP -\fBnumbered\fP or \fBt\fP -Make numbered backups. The numbered backup file name for -.I F -is -.IB F .~ N ~ -where -.I N -is the version number. -.TP -\fBsimple\fP or \fBnever\fP -Make simple backups. -The -.B \-B -or -.BR \*=prefix , -.B \-Y -or -.BR \*=basename\-prefix , -and -.B \-z -or -.BR \*=suffix -options specify the simple backup file name. -If none of these options are given, then a simple backup suffix is used; -it is the value of the -.B SIMPLE_BACKUP_SUFFIX -environment variable if set, and is -.B \&.orig -otherwise. -.PP -With numbered or simple backups, -if the backup file name is too long, the backup suffix -.B ~ -is used instead; if even appending -.B ~ -would make the name too long, then -.B ~ -replaces the last character of the file name. -.RE -.TP -\fB\*=verbose\fP -Output extra information about the work being done. -.TP -\fB\-x\fP \fInum\fP or \fB\*=debug=\fP\fInum\fP -Set internal debugging flags of interest only to -.B patch -patchers. -.TP -\fB\-Y\fP \fIpref\fP or \fB\*=basename\-prefix=\fP\fIpref\fP -Prefix -.I pref -to the basename of a file name when generating its simple backup file name. -For example, with -.B "\-Y\ .del/" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/.del/util.c . -.TP -\fB\-z\fP \fIsuffix\fP or \fB\*=suffix=\fP\fIsuffix\fP -Use -.I suffix -as the simple backup suffix. -For example, with -.B "\-z\ -" -the simple backup file name for -.B src/patch/util.c -is -.BR src/patch/util.c- . -The backup suffix may also be specified by the -.B SIMPLE_BACKUP_SUFFIX -environment variable, which is overridden by this option. -.TP -\fB\-Z\fP or \fB\*=set\-utc\fP -Set the modification and access times of patched files from time stamps -given in context diff headers, assuming that the context diff headers -use Coordinated Universal Time (\s-1UTC\s0, often known as \s-1GMT\s0). -Also see the -.B \-T -or -.B \*=set\-time -option. -.Sp -The -.B \-Z -or -.B \*=set\-utc -and -.B \-T -or -.B \*=set\-time -options normally refrain from setting a file's time if the file's original time -does not match the time given in the patch header, or if its -contents do not match the patch exactly. However, if the -.B \-f -or -.B \*=force -option is given, the file time is set regardless. -.Sp -Due to the limitations of -.B diff -output format, these options cannot update the times of files whose -contents have not changed. Also, if you use these options, you should remove -(e.g. with -.BR "make\ clean" ) -all files that depend on the patched files, so that later invocations of -.B make -do not get confused by the patched files' times. -.SH ENVIRONMENT -.TP 3 -.B PATCH_GET -This specifies whether -.B patch -gets missing or read-only files from \s-1RCS\s0, ClearCase, Perforce, -or \s-1SCCS\s0 -by default; see the -.B \-g -or -.B \*=get -option. -.TP -.B POSIXLY_CORRECT -If set, -.B patch -conforms more strictly to the \s-1POSIX\s0 standard by default: -see the -.B \*=posix -option. -.TP -.B QUOTING_STYLE -Default value of the -.B \*=quoting\-style -option. -.TP -.B SIMPLE_BACKUP_SUFFIX -Extension to use for simple backup file names instead of -.BR \&.orig . -.TP -\fBTMPDIR\fP, \fBTMP\fP, \fBTEMP\fP -Directory to put temporary files in; -.B patch -uses the first environment variable in this list that is set. -If none are set, the default is system-dependent; -it is normally -.B /tmp -on Unix hosts. -.TP -\fBVERSION_CONTROL\fP or \fBPATCH_VERSION_CONTROL\fP -Selects version control style; see the -.B \-v -or -.B \*=version\-control -option. -.SH FILES -.TP 3 -.IB $TMPDIR "/p\(**" -temporary files -.TP -.B /dev/tty -controlling terminal; used to get answers to questions asked of the user -.SH "SEE ALSO" -.BR diff (1), -.BR ed (1) -.Sp -Marshall T. Rose and Einar A. Stefferud, -Proposed Standard for Message Encapsulation, -Internet RFC 934 (1985-01). -.SH "NOTES FOR PATCH SENDERS" -There are several things you should bear in mind if you are going to -be sending out patches. -.PP -Create your patch systematically. -A good method is the command -.BI "diff\ \-Naur\ " "old\ new" -where -.I old -and -.I new -identify the old and new directories. -The names -.I old -and -.I new -should not contain any slashes. -The -.B diff -command's headers should have dates -and times in Universal Time using traditional Unix format, -so that patch recipients can use the -.B \-Z -or -.B \*=set\-utc -option. -Here is an example command, using Bourne shell syntax: -.Sp - \fBLC_ALL=C TZ=UTC0 diff \-Naur gcc\-2.7 gcc\-2.8\fP -.PP -Tell your recipients how to apply the patch -by telling them which directory to -.B cd -to, and which -.B patch -options to use. The option string -.B "\-Np1" -is recommended. -Test your procedure by pretending to be a recipient and applying -your patch to a copy of the original files. -.PP -You can save people a lot of grief by keeping a -.B patchlevel.h -file which is patched to increment the patch level -as the first diff in the patch file you send out. -If you put a -.B Prereq:\& -line in with the patch, it won't let them apply -patches out of order without some warning. -.PP -You can create a file by sending out a diff that compares -.B /dev/null -or an empty file dated the Epoch (1970-01-01 00:00:00 \s-1UTC\s0) -to the file you want to create. -This only works if the file you want to create doesn't exist already in -the target directory. -Conversely, you can remove a file by sending out a context diff that compares -the file to be deleted with an empty file dated the Epoch. -The file will be removed unless -.B patch -is conforming to \s-1POSIX\s0 and the -.B \-E -or -.B \*=remove\-empty\-files -option is not given. -An easy way to generate patches that create and remove files -is to use \s-1GNU\s0 -.BR diff 's -.B \-N -or -.B \*=new\-file -option. -.PP -If the recipient is supposed to use the -.BI \-p N -option, do not send output that looks like this: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -because the two file names have different numbers of slashes, -and different versions of -.B patch -interpret the file names differently. -To avoid confusion, send output that looks like this instead: -.Sp -.ft B -.ne 3 - diff \-Naur v2.0.29/prog/README v2.0.30/prog/README -.br - \-\^\-\^\- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 -.br - +\^+\^+ v2.0.30/prog/README Mon Mar 17 14:58:22 1997 -.ft -.Sp -.PP -Avoid sending patches that compare backup file names like -.BR README.orig , -since this might confuse -.B patch -into patching a backup file instead of the real file. -Instead, send patches that compare the same base file names -in different directories, e.g.\& -.B old/README -and -.BR new/README . -.PP -Take care not to send out reversed patches, since it makes people wonder -whether they already applied the patch. -.PP -Try not to have your patch modify derived files -(e.g. the file -.B configure -where there is a line -.B "configure: configure.in" -in your makefile), since the recipient should be -able to regenerate the derived files anyway. -If you must send diffs of derived files, -generate the diffs using \s-1UTC\s0, -have the recipients apply the patch with the -.B \-Z -or -.B \*=set\-utc -option, and have them remove any unpatched files that depend on patched files -(e.g. with -.BR "make\ clean" ). -.PP -While you may be able to get away with putting 582 diff listings into -one file, it may be wiser to group related patches into separate files in -case something goes haywire. -.SH DIAGNOSTICS -Diagnostics generally indicate that -.B patch -couldn't parse your patch file. -.PP -If the -.B \*=verbose -option is given, the message -.B Hmm.\|.\|.\& -indicates that there is unprocessed text in -the patch file and that -.B patch -is attempting to intuit whether there is a patch in that text and, if so, -what kind of patch it is. -.PP -.BR patch 's -exit status is -0 if all hunks are applied successfully, -1 if some hunks cannot be applied, -and 2 if there is more serious trouble. -When applying a set of patches in a loop it behooves you to check this -exit status so you don't apply a later patch to a partially patched file. -.SH CAVEATS -Context diffs cannot reliably represent the creation or deletion of -empty files, empty directories, or special files such as symbolic links. -Nor can they represent changes to file metadata like ownership, permissions, -or whether one file is a hard link to another. -If changes like these are also required, separate instructions -(e.g. a shell script) to accomplish them should accompany the patch. -.PP -.B patch -cannot tell if the line numbers are off in an -.B ed -script, and can detect -bad line numbers in a normal diff only when it finds a change or deletion. -A context diff using fuzz factor 3 may have the same problem. -Until a suitable interactive interface is added, you should probably do -a context diff in these cases to see if the changes made sense. -Of course, compiling without errors is a pretty good indication that the patch -worked, but not always. -.PP -.B patch -usually produces the correct results, even when it has to do a lot of -guessing. -However, the results are guaranteed to be correct only when the patch is -applied to exactly the same version of the file that the patch was -generated from. -.SH "COMPATIBILITY ISSUES" -The \s-1POSIX\s0 standard specifies behavior that differs from -.BR patch 's -traditional behavior. -You should be aware of these differences if you must interoperate with -.B patch -versions 2.1 and earlier, which do not conform to \s-1POSIX\s0. -.TP 3 -.B " \(bu" -In traditional -.BR patch , -the -.B \-p -option's operand was optional, and a bare -.B \-p -was equivalent to -.BR \-p0. -The -.B \-p -option now requires an operand, and -.B "\-p\ 0" -is now equivalent to -.BR \-p0 . -For maximum compatibility, use options like -.B \-p0 -and -.BR \-p1 . -.Sp -Also, -traditional -.B patch -simply counted slashes when stripping path prefixes; -.B patch -now counts pathname components. -That is, a sequence of one or more adjacent slashes -now counts as a single slash. -For maximum portability, avoid sending patches containing -.B // -in file names. -.TP -.B " \(bu" -In traditional -.BR patch , -backups were enabled by default. -This behavior is now enabled with the -.B \-b -or -.B \*=backup -option. -.Sp -Conversely, in \s-1POSIX\s0 -.BR patch , -backups are never made, even when there is a mismatch. -In \s-1GNU\s0 -.BR patch , -this behavior is enabled with the -.B \*=no\-backup\-if\-mismatch -option, or by conforming to \s-1POSIX\s0 with the -.B \*=posix -option or by setting the -.B POSIXLY_CORRECT -environment variable. -.Sp -The -.BI \-b "\ suffix" -option -of traditional -.B patch -is equivalent to the -.BI "\-b\ \-z" "\ suffix" -options of \s-1GNU\s0 -.BR patch . -.TP -.B " \(bu" -Traditional -.B patch -used a complicated (and incompletely documented) method -to intuit the name of the file to be patched from the patch header. -This method did not conform to \s-1POSIX\s0, and had a few gotchas. -Now -.B patch -uses a different, equally complicated (but better documented) method -that is optionally \s-1POSIX\s0-conforming; we hope it has -fewer gotchas. The two methods are compatible if the -file names in the context diff header and the -.B Index:\& -line are all identical after prefix-stripping. -Your patch is normally compatible if each header's file names -all contain the same number of slashes. -.TP -.B " \(bu" -When traditional -.B patch -asked the user a question, it sent the question to standard error -and looked for an answer from -the first file in the following list that was a terminal: -standard error, standard output, -.BR /dev/tty , -and standard input. -Now -.B patch -sends questions to standard output and gets answers from -.BR /dev/tty . -Defaults for some answers have been changed so that -.B patch -never goes into an infinite loop when using default answers. -.TP -.B " \(bu" -Traditional -.B patch -exited with a status value that counted the number of bad hunks, -or with status 1 if there was real trouble. -Now -.B patch -exits with status 1 if some hunks failed, -or with 2 if there was real trouble. -.TP -.B " \(bu" -Limit yourself to the following options when sending instructions -meant to be executed by anyone running \s-1GNU\s0 -.BR patch , -traditional -.BR patch , -or a -.B patch -that conforms to \s-1POSIX\s0. -Spaces are significant in the following list, and operands are required. -.Sp -.nf -.in +3 -.ne 11 -.B \-c -.BI \-d " dir" -.BI \-D " define" -.B \-e -.B \-l -.B \-n -.B \-N -.BI \-o " outfile" -.BI \-p num -.B \-R -.BI \-r " rejectfile" -.in -.fi -.SH BUGS -Please report bugs via email to -.BR . -.PP -.B patch -could be smarter about partial matches, excessively deviant offsets and -swapped code, but that would take an extra pass. -.PP -If code has been duplicated (for instance with -\fB#ifdef OLDCODE\fP .\|.\|. \fB#else .\|.\|. #endif\fP), -.B patch -is incapable of patching both versions, and, if it works at all, will likely -patch the wrong one, and tell you that it succeeded to boot. -.PP -If you apply a patch you've already applied, -.B patch -thinks it is a reversed patch, and offers to un-apply the patch. -This could be construed as a feature. -.SH COPYING -Copyright -.ie t \(co -.el (C) -1984, 1985, 1986, 1988 Larry Wall. -.br -Copyright -.ie t \(co -.el (C) -1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -2000, 2001, 2002 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the copyright holders instead of in -the original English. -.SH AUTHORS -Larry Wall wrote the original version of -.BR patch . -Paul Eggert removed -.BR patch 's -arbitrary limits; added support for binary files, -setting file times, and deleting files; -and made it conform better to \s-1POSIX\s0. -Other contributors include Wayne Davison, who added unidiff support, -and David MacKenzie, who added configuration and backup support. Index: vendor/misc-GNU/patch/dist/argmatch.c =================================================================== --- vendor/misc-GNU/patch/dist/argmatch.c (revision 358868) +++ vendor/misc-GNU/patch/dist/argmatch.c (nonexistent) @@ -1,280 +0,0 @@ -/* argmatch.c -- find a match for a string in an array - - Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie - Modified by Akim Demaille */ - -#if HAVE_CONFIG_H -# include -#endif - -/* Specification. */ -#include "argmatch.h" - -#include -#include -#include - -#include "gettext.h" -#define _(msgid) gettext (msgid) - -#include "error.h" -#include "quotearg.h" -#include "quote.h" -#include "unlocked-io.h" - -/* When reporting an invalid argument, show nonprinting characters - by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use - literal_quoting_style. */ -#ifndef ARGMATCH_QUOTING_STYLE -# define ARGMATCH_QUOTING_STYLE locale_quoting_style -#endif - -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -/* Non failing version of argmatch call this function after failing. */ -#ifndef ARGMATCH_DIE -# define ARGMATCH_DIE exit (EXIT_FAILURE) -#endif - -#ifdef ARGMATCH_DIE_DECL -ARGMATCH_DIE_DECL; -#endif - -static void -__argmatch_die (void) -{ - ARGMATCH_DIE; -} - -/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h. - Default to __argmatch_die, but allow caller to change this at run-time. */ -argmatch_exit_fn argmatch_die = __argmatch_die; - - -/* If ARG is an unambiguous match for an element of the - null-terminated array ARGLIST, return the index in ARGLIST - of the matched element, else -1 if it does not match any element - or -2 if it is ambiguous (is a prefix of more than one element). - - If VALLIST is none null, use it to resolve ambiguities limited to - synonyms, i.e., for - "yes", "yop" -> 0 - "no", "nope" -> 1 - "y" is a valid argument, for `0', and "n" for `1'. */ - -int -argmatch (const char *arg, const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; /* Temporary index in ARGLIST. */ - size_t arglen; /* Length of ARG. */ - int matchind = -1; /* Index of first nonexact match. */ - int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */ - - arglen = strlen (arg); - - /* Test all elements for either exact match or abbreviated matches. */ - for (i = 0; arglist[i]; i++) - { - if (!strncmp (arglist[i], arg, arglen)) - { - if (strlen (arglist[i]) == arglen) - /* Exact match found. */ - return i; - else if (matchind == -1) - /* First nonexact match found. */ - matchind = i; - else - { - /* Second nonexact match found. */ - if (vallist == NULL - || memcmp (vallist + valsize * matchind, - vallist + valsize * i, valsize)) - { - /* There is a real ambiguity, or we could not - disambiguate. */ - ambiguous = 1; - } - } - } - } - if (ambiguous) - return -2; - else - return matchind; -} - -/* Error reporting for argmatch. - CONTEXT is a description of the type of entity that was being matched. - VALUE is the invalid value that was given. - PROBLEM is the return value from argmatch. */ - -void -argmatch_invalid (const char *context, const char *value, int problem) -{ - char const *format = (problem == -1 - ? _("invalid argument %s for %s") - : _("ambiguous argument %s for %s")); - - error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value), - quote_n (1, context)); -} - -/* List the valid arguments for argmatch. - ARGLIST is the same as in argmatch. - VALLIST is a pointer to an array of values. - VALSIZE is the size of the elements of VALLIST */ -void -argmatch_valid (const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; - const char *last_val = NULL; - - /* We try to put synonyms on the same line. The assumption is that - synonyms follow each other */ - fprintf (stderr, _("Valid arguments are:")); - for (i = 0; arglist[i]; i++) - if ((i == 0) - || memcmp (last_val, vallist + valsize * i, valsize)) - { - fprintf (stderr, "\n - `%s'", arglist[i]); - last_val = vallist + valsize * i; - } - else - { - fprintf (stderr, ", `%s'", arglist[i]); - } - putc ('\n', stderr); -} - -/* Never failing versions of the previous functions. - - CONTEXT is the context for which argmatch is called (e.g., - "--version-control", or "$VERSION_CONTROL" etc.). Upon failure, - calls the (supposed never to return) function EXIT_FN. */ - -int -__xargmatch_internal (const char *context, - const char *arg, const char *const *arglist, - const char *vallist, size_t valsize, - argmatch_exit_fn exit_fn) -{ - int res = argmatch (arg, arglist, vallist, valsize); - if (res >= 0) - /* Success. */ - return res; - - /* We failed. Explain why. */ - argmatch_invalid (context, arg, res); - argmatch_valid (arglist, vallist, valsize); - (*exit_fn) (); - - return -1; /* To please the compilers. */ -} - -/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and - return the first corresponding argument in ARGLIST */ -const char * -argmatch_to_argument (const char *value, - const char *const *arglist, - const char *vallist, size_t valsize) -{ - int i; - - for (i = 0; arglist[i]; i++) - if (!memcmp (value, vallist + valsize * i, valsize)) - return arglist[i]; - return NULL; -} - -#ifdef TEST -/* - * Based on "getversion.c" by David MacKenzie - */ -char *program_name; -extern const char *getenv (); - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -/* Two tables describing arguments (keys) and their corresponding - values */ -static const char *const backup_args[] = -{ - "no", "none", "off", - "simple", "never", - "existing", "nil", - "numbered", "t", - 0 -}; - -static const enum backup_type backup_vals[] = -{ - none, none, none, - simple, simple, - numbered_existing, numbered_existing, - numbered, numbered -}; - -int -main (int argc, const char *const *argv) -{ - const char *cp; - enum backup_type backup_type = none; - - program_name = (char *) argv[0]; - - if (argc > 2) - { - fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name); - exit (1); - } - - if ((cp = getenv ("VERSION_CONTROL"))) - backup_type = XARGMATCH ("$VERSION_CONTROL", cp, - backup_args, backup_vals); - - if (argc == 2) - backup_type = XARGMATCH (program_name, argv[1], - backup_args, backup_vals); - - printf ("The version control is `%s'\n", - ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals)); - - return 0; -} -#endif Property changes on: vendor/misc-GNU/patch/dist/argmatch.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/NEWS =================================================================== --- vendor/misc-GNU/patch/dist/NEWS (revision 358868) +++ vendor/misc-GNU/patch/dist/NEWS (nonexistent) @@ -1,237 +0,0 @@ -Changes in versions 2.5.8 and 2.5.9: bug fixes only. - -Changes in version 2.5.7: - -* patch -D now outputs preprocessor lines without comments, as required - by POSIX 1003.1-2001. - -Changes in version 2.5.6: - -* File names in context patches may now contain spaces, so long - as the context patch headers use a tab to separate the file name - from the time stamp. -* Perforce is now supported. -* Patch lines beginning with "#" are comments and are ignored. - -Changes in version 2.5.5: - -* The bug reporting address is now . - -Changes in version 2.5.4: - -* A security hole has been closed. - It involved race conditions with temporary files. - -* The default quoting style is 'shell', which causes `patch' to quote - file names with funny characters like `$'. This prevents their - misinterpretation if you cut them from its output and paste them into - the shell. - -* `patch' now works correctly with large files on Large File Summit - hosts like Solaris 2.6. - -* `patch' now ignores trailing carriage returns in lines of context diffs - if the context diff headers end in carriage return. - -* `patch' now ignores context diff header file names that have fewer slashes - than the count specified by the -p or --strip option. - -* New options: - --posix - --quoting-style=WORD - -* New environment variables: - QUOTING_STYLE - -* `patch' now supports ClearCase version management. - -Changes in version 2.5: - -* Version control is now independent of whether backups are made. - The -V or --version-control option and the VERSION_CONTROL and - PATCH_VERSION_CONTROL environment variables no longer affect whether - backups are made; they affect only the names of the backup files. - -* When asking the user whether to reverse a patch, - the default answer is now `no' instead of `yes'. - -* `patch' can now recognize context diffs that have been encapsulated - by prepending "- " to lines beginning with "-" (as per Internet RFC 934). - -* `patch' now reports an error if the input contains garbage and no patches. - -Changes in version 2.4: - -* New options: - -Z or --set-utc sets times of patched files, assuming diff uses UTC (GMT). - -T or --set-time is similar, assuming local time (not recommended). - --backup-if-mismatch makes a backup if the patch does not match exactly - --no-backup-if-mismatch makes a backup only if otherwise requested - -* The default is now --backup-if-mismatch unless POSIXLY_CORRECT is set. - -* The -B or --prefix, -Y or --basename-prefix, and -z or --suffix options - no longer affect whether backups are made (as they did in patch 2.2 and 2.3); - they now merely specify the file names used when simple backups are made. - -* When patching a nonexistent file and making backups, an empty backup file - is now made (just as with traditional patch); but the backup file is - unreadable, as a way of indicating that it represents a nonexistent file. - -* `patch' now matches against empty and nonexistent files more generously. - A patch against an empty file applies to a nonexistent file, and vice versa. - -* -g or --get and PATCH_GET now have a numeric value that specifies - whether `patch' is getting files. - If the value is positive, working files are gotten from RCS or SCCS files; - if zero, `patch' ignores RCS and SCCS and working files are not gotten; - and if negative, `patch' asks the user whether to get each file. - The default is normally negative, but it is zero if POSIXLY_CORRECT is set. - -* The -G or --no-get option introduced in GNU patch 2.3 has been removed; - use -g0 instead. - -* The method used to intuit names of files to be patched is changed again: - `Index:' lines are normally ignored for context diffs, - and RCS and SCCS files are normally looked for when files do not exist. - The complete new method is described in the man page. - -* By default, `patch' is now more verbose when patches do not match exactly. - -* The manual page has a new COMPATIBILITY ISSUES section. - -Changes in version 2.3: - -* Unless the POSIXLY_CORRECT environment variable is set: - - - `patch' now distinguishes more accurately between empty and - nonexistent files if the input is a context diff. - A file is assumed to not exist if its context diff header - suggests that it is empty, and if the header timestamp - looks like it might be equivalent to 1970-01-01 00:00:00 UTC. - - Files that ``become nonexistent'' after patching are now removed. - When a file is removed, any empty ancestor directories are also removed. - -* Files are now automatically gotten from RCS and SCCS - if the -g or --get option is specified. - (The -G or --no-get option, also introduced in 2.3, was withdrawn in 2.4.) - -* If the PATCH_VERSION_CONTROL environment variable is set, - it overrides the VERSION_CONTROL environment variable. - -* The method used to intuit names of files to be patched is changed. - (It was further revised in 2.4; see above.) - -* The new --binary option makes `patch' read and write files in binary mode. - This option has no effect on POSIX-compliant hosts; - it is useful only in on operating systems like DOS - that distinguish between text and binary I/O. - -* The environment variables TMP and TEMP are consulted for the name of - the temporary directory if TMPDIR is not set. - -* A port to MS-DOS and MS-Windows is available; see the `pc' directory. - -* Backup file names are no longer ever computed by uppercasing characters, - since this isn't portable to systems with case-insensitive file names. - -Changes in version 2.2: - -* Arbitrary limits removed (e.g. line length, file name length). - -* On POSIX.1-compliant hosts, you can now patch binary files using the output - of GNU `diff -a'. - -* New options: - --dry-run - --help - --verbose - -i FILE or --input=FILE - -Y PREF or --basename-prefix=PREF - -* patch is now quieter by default; use --verbose for the old chatty behavior. - -* Patch now complies better with POSIX.2 if your host complies with POSIX.1. - - Therefore: - - By default, no backups are made. - (But this was changed again in patch 2.4; see above.) - - The simple backup file name for F defaults to F.orig - regardless of whether the file system supports long file names, - and F~ is used only if F.orig is too long for that particular file. - - Similarly for the reject file names F.rej and F#. - - Also: - - The pseudo-option `+' has been withdrawn. - - -b is equivalent to --version-control=simple; - `-z SUFF' has the meaning that `-b SUFF' used to. - - Names of files to be patched are taken first from *** line and then from - --- line of context diffs; then from Index: line; /dev/tty is - consulted if none of the above files exist. However, if the patch - appears to create a file, the file does not have to exist: instead, - the first name with the longest existing directory prefix is taken. - (These rules were changed again in patch 2.3 and 2.4; see above.) - - Exit status 0 means success, 1 means hunks were rejected, 2 means trouble. - - `-l' ignores changes only in spaces and tabs, not in other white space. - - If no `-p' option is given, `-pINFINITY' is assumed, instead of trying - to guess the proper value. - - `-p' now requires an operand; use `-p 0' to get the effect of the old plain - `-p' option. - - `-p' treats two or more adjacent slashes as if it were one slash. - - The TERM signal is caught. - - New option `-i F' reads patch from F instead of stdin. - -* The `patch' options and build procedure conform to current GNU standards. - For example, the `--version' option now outputs copyright information. - -* When the patch is creating a file, but a nonempty file of that name already - exists, `patch' now asks for confirmation before patching. - -* RCS is used only if the version control method is `existing' - and there is already an RCS file. Similarly for SCCS. - (But this was changed again in patch 2.3 and 2.4; see above.) - -* Copyright notices have been clarified. Every file in this version of `patch' - can be distributed under the GNU General Public License. See README for - details. - -Changes in version 2.1: - -* A few more portability bugs have been fixed. The version number has - been changed from 2.0.12g11 to 2.1, because the name - `patch-2.0.12g10' was too long for traditional Unix file systems. - -Versions 2.0.12g9 through 2.0.12g11 fix various portability bugs. - -Changes in version 2.0.12g8: - -* Start of the 12g series, with a GNU-style configure script and - long-named options. -* Added the -t --batch option, similar to -f. -* Improved detection of files that are locked under RCS or SCCS. -* Reinstate the -E option to remove output files that are empty after - being patched. -* Print the system error message when system calls fail. -* Fixed various bugs and portability problems. - - - -Copyright (C) 1992, 1993, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -Free Software Foundation, Inc. - -This file is part of GNU Patch. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that they will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. Property changes on: vendor/misc-GNU/patch/dist/NEWS ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/util.c =================================================================== --- vendor/misc-GNU/patch/dist/util.c (revision 358868) +++ vendor/misc-GNU/patch/dist/util.c (nonexistent) @@ -1,1013 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.c,v 1.36 2003/05/20 14:04:53 eggert Exp $ */ - -/* Copyright (C) 1986 Larry Wall - - Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define XTERN extern -#include -#include -#include -#include -#include -#include -#undef XTERN -#define XTERN -#include -#include - -#include -#include - -#include -#if !defined SIGCHLD && defined SIGCLD -#define SIGCHLD SIGCLD -#endif -#if ! HAVE_RAISE && ! defined raise -# define raise(sig) kill (getpid (), sig) -#endif - -#include - -static void makedirs (char *); - -/* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM - needs removal when cleaning up at the end of execution) - to TO, renaming it if possible and copying it if necessary. - If we must create TO, use MODE to create it. - If FROM is null, remove TO (ignoring FROMSTAT). - FROM_NEEDS_REMOVAL must be nonnull if FROM is nonnull. - Back up TO if BACKUP is true. */ - -void -move_file (char const *from, int volatile *from_needs_removal, - char *to, mode_t mode, bool backup) -{ - struct stat to_st; - int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno; - - if (backup) - { - int try_makedirs_errno = 0; - char *bakname; - - if (origprae || origbase) - { - char const *p = origprae ? origprae : ""; - char const *b = origbase ? origbase : ""; - char const *o = base_name (to); - size_t plen = strlen (p); - size_t tlen = o - to; - size_t blen = strlen (b); - size_t osize = strlen (o) + 1; - bakname = xmalloc (plen + tlen + blen + osize); - memcpy (bakname, p, plen); - memcpy (bakname + plen, to, tlen); - memcpy (bakname + plen + tlen, b, blen); - memcpy (bakname + plen + tlen + blen, o, osize); - for (p += FILESYSTEM_PREFIX_LEN (p); *p; p++) - if (ISSLASH (*p)) - { - try_makedirs_errno = ENOENT; - break; - } - } - else - { - bakname = find_backup_file_name (to, backup_type); - if (!bakname) - memory_fatal (); - } - - if (to_errno) - { - int fd; - - if (debug & 4) - say ("Creating empty unreadable file %s\n", quotearg (bakname)); - - try_makedirs_errno = ENOENT; - unlink (bakname); - while ((fd = creat (bakname, 0)) < 0) - { - if (errno != try_makedirs_errno) - pfatal ("Can't create file %s", quotearg (bakname)); - makedirs (bakname); - try_makedirs_errno = 0; - } - if (close (fd) != 0) - pfatal ("Can't close file %s", quotearg (bakname)); - } - else - { - if (debug & 4) - say ("Renaming file %s to %s\n", - quotearg_n (0, to), quotearg_n (1, bakname)); - while (rename (to, bakname) != 0) - { - if (errno != try_makedirs_errno) - pfatal ("Can't rename file %s to %s", - quotearg_n (0, to), quotearg_n (1, bakname)); - makedirs (bakname); - try_makedirs_errno = 0; - } - } - - free (bakname); - } - - if (from) - { - if (debug & 4) - say ("Renaming file %s to %s\n", - quotearg_n (0, from), quotearg_n (1, to)); - - if (rename (from, to) != 0) - { - bool to_dir_known_to_exist = false; - - if (errno == ENOENT - && (to_errno == -1 || to_errno == ENOENT)) - { - makedirs (to); - to_dir_known_to_exist = 1; - if (rename (from, to) == 0) - goto rename_succeeded; - } - - if (errno == EXDEV) - { - if (! backup) - { - if (unlink (to) == 0) - to_dir_known_to_exist = true; - else if (errno != ENOENT) - pfatal ("Can't remove file %s", quotearg (to)); - } - if (! to_dir_known_to_exist) - makedirs (to); - copy_file (from, to, 0, mode); - return; - } - - pfatal ("Can't rename file %s to %s", - quotearg_n (0, from), quotearg_n (1, to)); - } - - rename_succeeded: - /* Do not clear *FROM_NEEDS_REMOVAL if it's possible that the - rename returned zero because FROM and TO are hard links to - the same file. */ - if (0 < to_errno - || (to_errno == 0 && to_st.st_nlink <= 1)) - *from_needs_removal = 0; - } - else if (! backup) - { - if (debug & 4) - say ("Removing file %s\n", quotearg (to)); - if (unlink (to) != 0) - pfatal ("Can't remove file %s", quotearg (to)); - } -} - -/* Create FILE with OPEN_FLAGS, and with MODE adjusted so that - we can read and write the file and that the file is not executable. - Return the file descriptor. */ -int -create_file (char const *file, int open_flags, mode_t mode) -{ - int fd; - mode |= S_IRUSR | S_IWUSR; - mode &= ~ (S_IXUSR | S_IXGRP | S_IXOTH); - if (! (O_CREAT && O_TRUNC)) - close (creat (file, mode)); - fd = open (file, O_CREAT | O_TRUNC | open_flags, mode); - if (fd < 0) - pfatal ("Can't create file %s", quotearg (file)); - return fd; -} - -/* Copy a file. */ - -void -copy_file (char const *from, char const *to, int to_flags, mode_t mode) -{ - int tofd; - int fromfd; - size_t i; - - if ((fromfd = open (from, O_RDONLY | O_BINARY)) < 0) - pfatal ("Can't reopen file %s", quotearg (from)); - tofd = create_file (to, O_WRONLY | O_BINARY | to_flags, mode); - while ((i = read (fromfd, buf, bufsize)) != 0) - { - if (i == (size_t) -1) - read_fatal (); - if (write (tofd, buf, i) != i) - write_fatal (); - } - if (close (fromfd) != 0) - read_fatal (); - if (close (tofd) != 0) - write_fatal (); -} - -static char const DEV_NULL[] = NULL_DEVICE; - -static char const RCSSUFFIX[] = ",v"; -static char const CHECKOUT[] = "co %s"; -static char const CHECKOUT_LOCKED[] = "co -l %s"; -static char const RCSDIFF1[] = "rcsdiff %s"; - -static char const SCCSPREFIX[] = "s."; -static char const GET[] = "get "; -static char const GET_LOCKED[] = "get -e "; -static char const SCCSDIFF1[] = "get -p "; -static char const SCCSDIFF2[] = "|diff - %s"; - -static char const CLEARTOOL_CO[] = "cleartool co -unr -nc "; - -static char const PERFORCE_CO[] = "p4 edit "; - -/* Return "RCS" if FILENAME is controlled by RCS, - "SCCS" if it is controlled by SCCS, - "ClearCase" if it is controlled by Clearcase, - "Perforce" if it is controlled by Perforce, - and 0 otherwise. - READONLY is true if we desire only readonly access to FILENAME. - FILESTAT describes FILENAME's status or is 0 if FILENAME does not exist. - If successful and if GETBUF is nonzero, set *GETBUF to a command - that gets the file; similarly for DIFFBUF and a command to diff the file - (but set *DIFFBUF to 0 if the diff operation is meaningless). - *GETBUF and *DIFFBUF must be freed by the caller. */ -char const * -version_controller (char const *filename, bool readonly, - struct stat const *filestat, char **getbuf, char **diffbuf) -{ - struct stat cstat; - char const *filebase = base_name (filename); - char const *dotslash = *filename == '-' ? "./" : ""; - size_t dirlen = filebase - filename; - size_t filenamelen = strlen (filename); - size_t maxfixlen = sizeof "SCCS/" - 1 + sizeof SCCSPREFIX - 1; - size_t maxtrysize = filenamelen + maxfixlen + 1; - size_t quotelen = quote_system_arg (0, filename); - size_t maxgetsize = sizeof CLEARTOOL_CO + quotelen + maxfixlen; - size_t maxdiffsize = - (sizeof SCCSDIFF1 + sizeof SCCSDIFF2 + sizeof DEV_NULL - 1 - + 2 * quotelen + maxfixlen); - char *trybuf = xmalloc (maxtrysize); - char const *r = 0; - - strcpy (trybuf, filename); - -#define try1(f,a1) (sprintf (trybuf + dirlen, f, a1), stat (trybuf, &cstat) == 0) -#define try2(f,a1,a2) (sprintf (trybuf + dirlen, f, a1,a2), stat (trybuf, &cstat) == 0) - - /* Check that RCS file is not working file. - Some hosts don't report file name length errors. */ - - if ((try2 ("RCS/%s%s", filebase, RCSSUFFIX) - || try1 ("RCS/%s", filebase) - || try2 ("%s%s", filebase, RCSSUFFIX)) - && ! (filestat - && filestat->st_dev == cstat.st_dev - && filestat->st_ino == cstat.st_ino)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? CHECKOUT : CHECKOUT_LOCKED, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - sprintf (p, RCSDIFF1, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "RCS"; - } - else if (try2 ("SCCS/%s%s", SCCSPREFIX, filebase) - || try2 ("%s%s", SCCSPREFIX, filebase)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - sprintf (p, readonly ? GET : GET_LOCKED); - p += strlen (p); - p += quote_system_arg (p, trybuf); - *p = '\0'; - } - - if (diffbuf) - { - char *p = *diffbuf = xmalloc (maxdiffsize); - strcpy (p, SCCSDIFF1); - p += sizeof SCCSDIFF1 - 1; - p += quote_system_arg (p, trybuf); - sprintf (p, SCCSDIFF2, dotslash); - p += strlen (p); - p += quote_system_arg (p, filename); - *p++ = '>'; - strcpy (p, DEV_NULL); - } - - r = "SCCS"; - } - else if (!readonly && filestat - && try1 ("%s@@", filebase) && S_ISDIR (cstat.st_mode)) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - strcpy (p, CLEARTOOL_CO); - p += sizeof CLEARTOOL_CO - 1; - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - *diffbuf = 0; - - r = "ClearCase"; - } - else if (!readonly && filestat && - (getenv("P4PORT") || getenv("P4USER") || getenv("P4CONFIG"))) - { - if (getbuf) - { - char *p = *getbuf = xmalloc (maxgetsize); - strcpy (p, PERFORCE_CO); - p += sizeof PERFORCE_CO - 1; - p += quote_system_arg (p, filename); - *p = '\0'; - } - - if (diffbuf) - *diffbuf = 0; - - r = "Perforce"; - } - - free (trybuf); - return r; -} - -/* Get FILENAME from version control system CS. The file already exists if - EXISTS. Only readonly access is needed if READONLY. - Use the command GETBUF to actually get the named file. - Store the resulting file status into *FILESTAT. - Return true if successful. */ -bool -version_get (char const *filename, char const *cs, bool exists, bool readonly, - char const *getbuf, struct stat *filestat) -{ - if (patch_get < 0) - { - ask ("Get file %s from %s%s? [y] ", - quotearg (filename), cs, readonly ? "" : " with lock"); - if (*buf == 'n') - return 0; - } - - if (dry_run) - { - if (! exists) - fatal ("can't do dry run on nonexistent version-controlled file %s; invoke `%s' and try again", - quotearg (filename), getbuf); - } - else - { - if (verbosity == VERBOSE) - say ("Getting file %s from %s%s...\n", quotearg (filename), - cs, readonly ? "" : " with lock"); - if (systemic (getbuf) != 0) - fatal ("Can't get file %s from %s", quotearg (filename), cs); - if (stat (filename, filestat) != 0) - pfatal ("%s", quotearg (filename)); - } - - return 1; -} - -/* Allocate a unique area for a string. */ - -char * -savebuf (register char const *s, register size_t size) -{ - register char *rv; - - assert (s && size); - rv = malloc (size); - - if (! rv) - { - if (! using_plan_a) - memory_fatal (); - } - else - memcpy (rv, s, size); - - return rv; -} - -char * -savestr (char const *s) -{ - return savebuf (s, strlen (s) + 1); -} - -void -remove_prefix (char *p, size_t prefixlen) -{ - char const *s = p + prefixlen; - while ((*p++ = *s++)) - continue; -} - -char * -format_linenum (char numbuf[LINENUM_LENGTH_BOUND + 1], LINENUM n) -{ - char *p = numbuf + LINENUM_LENGTH_BOUND; - *p = '\0'; - - if (n < 0) - { - do - *--p = '0' - (int) (n % 10); - while ((n /= 10) != 0); - - *--p = '-'; - } - else - { - do - *--p = '0' + (int) (n % 10); - while ((n /= 10) != 0); - } - - return p; -} - -#if !HAVE_VPRINTF -#define vfprintf my_vfprintf -static int -vfprintf (FILE *stream, char const *format, va_list args) -{ -#if !HAVE_DOPRNT && HAVE__DOPRINTF -# define _doprnt _doprintf -#endif -#if HAVE_DOPRNT || HAVE__DOPRINTF - _doprnt (format, args, stream); - return ferror (stream) ? -1 : 0; -#else - int *a = (int *) args; - return fprintf (stream, format, - a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); -#endif -} -#endif /* !HAVE_VPRINTF */ - -/* Terminal output, pun intended. */ - -void -fatal (char const *format, ...) -{ - va_list args; - fprintf (stderr, "%s: **** ", program_name); - va_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - putc ('\n', stderr); - fflush (stderr); - fatal_exit (0); -} - -void -memory_fatal (void) -{ - fatal ("out of memory"); -} - -void -read_fatal (void) -{ - pfatal ("read error"); -} - -void -write_fatal (void) -{ - pfatal ("write error"); -} - -/* Say something from patch, something from the system, then silence . . . */ - -void -pfatal (char const *format, ...) -{ - int errnum = errno; - va_list args; - fprintf (stderr, "%s: **** ", program_name); - va_start (args, format); - vfprintf (stderr, format, args); - va_end (args); - fflush (stderr); /* perror bypasses stdio on some hosts. */ - errno = errnum; - perror (" "); - fflush (stderr); - fatal_exit (0); -} - -/* Tell the user something. */ - -void -say (char const *format, ...) -{ - va_list args; - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); -} - -/* Get a response from the user, somehow or other. */ - -void -ask (char const *format, ...) -{ - static int ttyfd = -2; - int r; - va_list args; - - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - fflush (stdout); - - if (ttyfd == -2) - { - /* If standard output is not a tty, don't bother opening /dev/tty, - since it's unlikely that stdout will be seen by the tty user. - The isatty test also works around a bug in GNU Emacs 19.34 under Linux - which makes a call-process `patch' hang when it reads from /dev/tty. - POSIX.1-2001 XCU line 26599 requires that we read /dev/tty, - though. */ - ttyfd = (posixly_correct || isatty (STDOUT_FILENO) - ? open (TTY_DEVICE, O_RDONLY) - : -1); - } - - if (ttyfd < 0) - { - /* No terminal at all -- default it. */ - printf ("\n"); - buf[0] = '\n'; - buf[1] = '\0'; - } - else - { - size_t s = 0; - while ((r = read (ttyfd, buf + s, bufsize - 1 - s)) == bufsize - 1 - s - && buf[bufsize - 2] != '\n') - { - s = bufsize - 1; - bufsize *= 2; - buf = realloc (buf, bufsize); - if (!buf) - memory_fatal (); - } - if (r == 0) - printf ("EOF\n"); - else if (r < 0) - { - perror ("tty read"); - fflush (stderr); - close (ttyfd); - ttyfd = -1; - r = 0; - } - buf[s + r] = '\0'; - } -} - -/* Return nonzero if it OK to reverse a patch. */ - -bool -ok_to_reverse (char const *format, ...) -{ - bool r = false; - - if (noreverse || ! (force && verbosity == SILENT)) - { - va_list args; - va_start (args, format); - vfprintf (stdout, format, args); - va_end (args); - } - - if (noreverse) - { - printf (" Skipping patch.\n"); - skip_rest_of_patch = true; - } - else if (force) - { - if (verbosity != SILENT) - printf (" Applying it anyway.\n"); - } - else if (batch) - { - say (reverse ? " Ignoring -R.\n" : " Assuming -R.\n"); - r = true; - } - else - { - ask (reverse ? " Ignore -R? [n] " : " Assume -R? [n] "); - r = *buf == 'y'; - if (! r) - { - ask ("Apply anyway? [n] "); - if (*buf != 'y') - { - if (verbosity != SILENT) - say ("Skipping patch.\n"); - skip_rest_of_patch = true; - } - } - } - - return r; -} - -/* How to handle certain events when not in a critical region. */ - -#define NUM_SIGS (sizeof (sigs) / sizeof (*sigs)) -static int const sigs[] = { -#ifdef SIGHUP - SIGHUP, -#endif -#ifdef SIGPIPE - SIGPIPE, -#endif -#ifdef SIGTERM - SIGTERM, -#endif -#ifdef SIGXCPU - SIGXCPU, -#endif -#ifdef SIGXFSZ - SIGXFSZ, -#endif - SIGINT -}; - -#if !HAVE_SIGPROCMASK -#define sigset_t int -#define sigemptyset(s) (*(s) = 0) -#ifndef sigmask -#define sigmask(sig) (1 << ((sig) - 1)) -#endif -#define sigaddset(s, sig) (*(s) |= sigmask (sig)) -#define sigismember(s, sig) ((*(s) & sigmask (sig)) != 0) -#ifndef SIG_BLOCK -#define SIG_BLOCK 0 -#endif -#ifndef SIG_UNBLOCK -#define SIG_UNBLOCK (SIG_BLOCK + 1) -#endif -#ifndef SIG_SETMASK -#define SIG_SETMASK (SIG_BLOCK + 2) -#endif -#define sigprocmask(how, n, o) \ - ((how) == SIG_BLOCK \ - ? ((o) ? *(o) = sigblock (*(n)) : sigblock (*(n))) \ - : (how) == SIG_UNBLOCK \ - ? sigsetmask (((o) ? *(o) = sigblock (0) : sigblock (0)) & ~*(n)) \ - : (o ? *(o) = sigsetmask (*(n)) : sigsetmask (*(n)))) -#if !HAVE_SIGSETMASK -#define sigblock(mask) 0 -#define sigsetmask(mask) 0 -#endif -#endif - -static sigset_t initial_signal_mask; -static sigset_t signals_to_block; - -#if ! HAVE_SIGACTION -static RETSIGTYPE fatal_exit_handler (int) __attribute__ ((noreturn)); -static RETSIGTYPE -fatal_exit_handler (int sig) -{ - signal (sig, SIG_IGN); - fatal_exit (sig); -} -#endif - -void -set_signals (bool reset) -{ - int i; -#if HAVE_SIGACTION - struct sigaction initial_act, fatal_act; - fatal_act.sa_handler = fatal_exit; - sigemptyset (&fatal_act.sa_mask); - fatal_act.sa_flags = 0; -#define setup_handler(sig) sigaction (sig, &fatal_act, (struct sigaction *) 0) -#else -#define setup_handler(sig) signal (sig, fatal_exit_handler) -#endif - - if (!reset) - { -#ifdef SIGCHLD - /* System V fork+wait does not work if SIGCHLD is ignored. */ - signal (SIGCHLD, SIG_DFL); -#endif - sigemptyset (&signals_to_block); - for (i = 0; i < NUM_SIGS; i++) - { - bool ignoring_signal; -#if HAVE_SIGACTION - if (sigaction (sigs[i], (struct sigaction *) 0, &initial_act) != 0) - continue; - ignoring_signal = initial_act.sa_handler == SIG_IGN; -#else - ignoring_signal = signal (sigs[i], SIG_IGN) == SIG_IGN; -#endif - if (! ignoring_signal) - { - sigaddset (&signals_to_block, sigs[i]); - setup_handler (sigs[i]); - } - } - } - else - { - /* Undo the effect of ignore_signals. */ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_SETMASK, &initial_signal_mask, (sigset_t *) 0); -#else - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - setup_handler (sigs[i]); -#endif - } -} - -/* How to handle certain events when in a critical region. */ - -void -ignore_signals (void) -{ -#if HAVE_SIGPROCMASK || HAVE_SIGSETMASK - sigprocmask (SIG_BLOCK, &signals_to_block, &initial_signal_mask); -#else - int i; - for (i = 0; i < NUM_SIGS; i++) - if (sigismember (&signals_to_block, sigs[i])) - signal (sigs[i], SIG_IGN); -#endif -} - -void -exit_with_signal (int sig) -{ - sigset_t s; - signal (sig, SIG_DFL); - sigemptyset (&s); - sigaddset (&s, sig); - sigprocmask (SIG_UNBLOCK, &s, (sigset_t *) 0); - raise (sig); - exit (2); -} - -int -systemic (char const *command) -{ - if (debug & 8) - say ("+ %s\n", command); - fflush (stdout); - return system (command); -} - -/* Replace '/' with '\0' in FILENAME if it marks a place that - needs testing for the existence of directory. Return the address - of the last location replaced, or 0 if none were replaced. */ -static char * -replace_slashes (char *filename) -{ - char *f; - char *last_location_replaced = 0; - char const *component_start; - - for (f = filename + FILESYSTEM_PREFIX_LEN (filename); ISSLASH (*f); f++) - continue; - - component_start = f; - - for (; *f; f++) - if (ISSLASH (*f)) - { - char *slash = f; - - /* Treat multiple slashes as if they were one slash. */ - while (ISSLASH (f[1])) - f++; - - /* Ignore slashes at the end of the path. */ - if (! f[1]) - break; - - /* "." and ".." need not be tested. */ - if (! (slash - component_start <= 2 - && component_start[0] == '.' && slash[-1] == '.')) - { - *slash = '\0'; - last_location_replaced = slash; - } - - component_start = f + 1; - } - - return last_location_replaced; -} - -/* Make sure we'll have the directories to create a file. - Ignore the last element of `filename'. */ - -static void -makedirs (register char *filename) -{ - register char *f; - register char *flim = replace_slashes (filename); - - if (flim) - { - /* Create any missing directories, replacing NULs by '/'s. - Ignore errors. We may have to keep going even after an EEXIST, - since the path may contain ".."s; and when there is an EEXIST - failure the system may return some other error number. - Any problems will eventually be reported when we create the file. */ - for (f = filename; f <= flim; f++) - if (!*f) - { - mkdir (filename, - S_IRUSR|S_IWUSR|S_IXUSR - |S_IRGRP|S_IWGRP|S_IXGRP - |S_IROTH|S_IWOTH|S_IXOTH); - *f = '/'; - } - } -} - -/* Remove empty ancestor directories of FILENAME. - Ignore errors, since the path may contain ".."s, and when there - is an EEXIST failure the system may return some other error number. */ -void -removedirs (char *filename) -{ - size_t i; - - for (i = strlen (filename); i != 0; i--) - if (ISSLASH (filename[i]) - && ! (ISSLASH (filename[i - 1]) - || (filename[i - 1] == '.' - && (i == 1 - || ISSLASH (filename[i - 2]) - || (filename[i - 2] == '.' - && (i == 2 - || ISSLASH (filename[i - 3]))))))) - { - filename[i] = '\0'; - if (rmdir (filename) == 0 && verbosity == VERBOSE) - say ("Removed empty directory %s\n", quotearg (filename)); - filename[i] = '/'; - } -} - -static time_t initial_time; - -void -init_time (void) -{ - time (&initial_time); -} - -/* Make filenames more reasonable. */ - -char * -fetchname (char *at, int strip_leading, time_t *pstamp) -{ - char *name; - register char *t; - int sleading = strip_leading; - time_t stamp = (time_t) -1; - - while (ISSPACE ((unsigned char) *at)) - at++; - if (debug & 128) - say ("fetchname %s %d\n", at, strip_leading); - - name = at; - /* Strip up to `strip_leading' leading slashes and null terminate. - If `strip_leading' is negative, strip all leading slashes. */ - for (t = at; *t; t++) - { - if (ISSLASH (*t)) - { - while (ISSLASH (t[1])) - t++; - if (strip_leading < 0 || --sleading >= 0) - name = t+1; - } - else if (ISSPACE ((unsigned char) *t)) - { - /* Allow file names with internal spaces, - but only if a tab separates the file name from the date. */ - char const *u = t; - while (*u != '\t' && ISSPACE ((unsigned char) u[1])) - u++; - if (*u != '\t' && strchr (u + 1, '\t')) - continue; - - if (set_time | set_utc) - stamp = str2time (&u, initial_time, - set_utc ? 0L : TM_LOCAL_ZONE); - else - { - /* The head says the file is nonexistent if the timestamp - is the epoch; but the listed time is local time, not UTC, - and POSIX.1 allows local time offset anywhere in the range - -25:00 < offset < +26:00. Match any time in that - range by assuming local time is -25:00 and then matching - any ``local'' time T in the range 0 < T < 25+26 hours. */ - stamp = str2time (&u, initial_time, -25L * 60 * 60); - if (0 < stamp && stamp < (25 + 26) * 60L * 60) - stamp = 0; - } - - if (*u && ! ISSPACE ((unsigned char) *u)) - stamp = (time_t) -1; - - *t = '\0'; - break; - } - } - - if (!*name) - return 0; - - /* If the name is "/dev/null", ignore the name and mark the file - as being nonexistent. The name "/dev/null" appears in patches - regardless of how NULL_DEVICE is spelled. */ - if (strcmp (at, "/dev/null") == 0) - { - if (pstamp) - *pstamp = 0; - return 0; - } - - /* Ignore the name if it doesn't have enough slashes to strip off. */ - if (0 < sleading) - return 0; - - if (pstamp) - *pstamp = stamp; - - return savestr (name); -} - -void -Fseek (FILE *stream, file_offset offset, int ptrname) -{ - if (file_seek (stream, offset, ptrname) != 0) - pfatal ("fseek"); -} Property changes on: vendor/misc-GNU/patch/dist/util.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/argmatch.h =================================================================== --- vendor/misc-GNU/patch/dist/argmatch.h (revision 358868) +++ vendor/misc-GNU/patch/dist/argmatch.h (nonexistent) @@ -1,109 +0,0 @@ -/* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie - Modified by Akim Demaille */ - -#ifndef ARGMATCH_H_ -# define ARGMATCH_H_ 1 - -# include - -# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) - -# define ARGMATCH_CONSTRAINT(Arglist, Vallist) \ - (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) - -/* Assert there are as many real arguments as there are values - (argument list ends with a NULL guard). ARGMATCH_VERIFY is - preferred, since it is guaranteed to be checked at compile-time. - ARGMATCH_ASSERT is for backward compatibility only. */ - -# define ARGMATCH_VERIFY(Arglist, Vallist) \ - struct argmatch_verify \ - { \ - char argmatch_verify[ARGMATCH_CONSTRAINT(Arglist, Vallist) ? 1 : -1]; \ - } - -# define ARGMATCH_ASSERT(Arglist, Vallist) \ - assert (ARGMATCH_CONSTRAINT (Arglist, Vallist)) - -/* Return the index of the element of ARGLIST (NULL terminated) that - matches with ARG. If VALLIST is not NULL, then use it to resolve - false ambiguities (i.e., different matches of ARG but corresponding - to the same values in VALLIST). */ - -int argmatch (char const *arg, char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH(Arg, Arglist, Vallist) \ - argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) - -/* xargmatch calls this function when it fails. This function should not - return. By default, this is a function that calls ARGMATCH_DIE which - in turn defaults to `exit (EXIT_FAILURE)'. */ -typedef void (*argmatch_exit_fn) (void); -extern argmatch_exit_fn argmatch_die; - -/* Report on stderr why argmatch failed. Report correct values. */ - -void argmatch_invalid (char const *context, char const *value, int problem); - -/* Left for compatibility with the old name invalid_arg */ - -# define invalid_arg(Context, Value, Problem) \ - argmatch_invalid (Context, Value, Problem) - - - -/* Report on stderr the list of possible arguments. */ - -void argmatch_valid (char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH_VALID(Arglist, Vallist) \ - argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist)) - - - -/* Same as argmatch, but upon failure, reports a explanation on the - failure, and exits using the function EXIT_FN. */ - -int __xargmatch_internal (char const *context, - char const *arg, char const *const *arglist, - char const *vallist, size_t valsize, - argmatch_exit_fn exit_fn); - -/* Programmer friendly interface to __xargmatch_internal. */ - -# define XARGMATCH(Context, Arg, Arglist, Vallist) \ - ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ - (char const *) (Vallist), \ - sizeof *(Vallist), \ - argmatch_die)]) - -/* Convert a value into a corresponding argument. */ - -char const *argmatch_to_argument (char const *value, - char const *const *arglist, - char const *vallist, size_t valsize); - -# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ - argmatch_to_argument (Value, Arglist, \ - (char const *) (Vallist), sizeof *(Vallist)) - -#endif /* ARGMATCH_H_ */ Property changes on: vendor/misc-GNU/patch/dist/argmatch.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/backupfile.c =================================================================== --- vendor/misc-GNU/patch/dist/backupfile.c (revision 358868) +++ vendor/misc-GNU/patch/dist/backupfile.c (nonexistent) @@ -1,277 +0,0 @@ -/* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990,91,92,93,94,95,96,97,98,99,2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by David MacKenzie . - Some algorithms adapted from GNU Emacs. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include -#if HAVE_STRING_H -# include -#else -# include -#endif - -#if HAVE_DIRENT_H -# include -# define NLENGTH(direct) strlen ((direct)->d_name) -#else -# define dirent direct -# define NLENGTH(direct) ((size_t) (direct)->d_namlen) -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - -#if CLOSEDIR_VOID -/* Fake a return value. */ -# define CLOSEDIR(d) (closedir (d), 0) -#else -# define CLOSEDIR(d) closedir (d) -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#ifndef HAVE_DECL_GETENV -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_GETENV -char *getenv (); -#endif - -#ifndef HAVE_DECL_MALLOC -"this configure-time declaration test was not run" -#endif -#if !HAVE_DECL_MALLOC -char *malloc (); -#endif - -#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H -# define HAVE_DIR 1 -#else -# define HAVE_DIR 0 -#endif - -#if HAVE_LIMITS_H -# include -#endif -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif -/* Upper bound on the string length of an integer converted to string. - 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; - add 1 for integer division truncation; add 1 more for a minus sign. */ -#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2) - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - - It's typically faster. - POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to - ISDIGIT_LOCALE unless it's important to use the locale's definition - of `digit' even when the host does not conform to POSIX. */ -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -#if D_INO_IN_DIRENT -# define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0) -#else -# define REAL_DIR_ENTRY(dp) 1 -#endif - -#include "argmatch.h" -#include "backupfile.h" -#include "dirname.h" - -/* The extension added to file names to produce a simple (as opposed - to numbered) backup file name. */ -const char *simple_backup_suffix = "~"; - -static int max_backup_version PARAMS ((const char *, const char *)); -static int version_number PARAMS ((const char *, const char *, size_t)); - -/* Return the name of the new backup file for file FILE, - allocated with malloc. Return 0 if out of memory. - FILE must not end with a '/' unless it is the root directory. - Do not call this function if backup_type == none. */ - -char * -find_backup_file_name (const char *file, enum backup_type backup_type) -{ - size_t backup_suffix_size_max; - size_t file_len = strlen (file); - size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4; - char *s; - const char *suffix = simple_backup_suffix; - - /* Allow room for simple or `.~N~' backups. */ - backup_suffix_size_max = strlen (simple_backup_suffix) + 1; - if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max) - backup_suffix_size_max = numbered_suffix_size_max; - - s = malloc (file_len + 1 - + backup_suffix_size_max + numbered_suffix_size_max); - if (s) - { -#if HAVE_DIR - if (backup_type != simple) - { - int highest_backup; - size_t dirlen = dir_len (file); - - memcpy (s, file, dirlen); - if (dirlen == FILESYSTEM_PREFIX_LEN (file)) - s[dirlen++] = '.'; - s[dirlen] = '\0'; - highest_backup = max_backup_version (base_name (file), s); - if (! (backup_type == numbered_existing && highest_backup == 0)) - { - char *numbered_suffix = s + (file_len + backup_suffix_size_max); - sprintf (numbered_suffix, ".~%d~", highest_backup + 1); - suffix = numbered_suffix; - } - } -#endif /* HAVE_DIR */ - - strcpy (s, file); - addext (s, suffix, '~'); - } - return s; -} - -#if HAVE_DIR - -/* Return the number of the highest-numbered backup file for file - FILE in directory DIR. If there are no numbered backups - of FILE in DIR, or an error occurs reading DIR, return 0. - */ - -static int -max_backup_version (const char *file, const char *dir) -{ - DIR *dirp; - struct dirent *dp; - int highest_version; - int this_version; - size_t file_name_length; - - dirp = opendir (dir); - if (!dirp) - return 0; - - highest_version = 0; - file_name_length = base_len (file); - - while ((dp = readdir (dirp)) != 0) - { - if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) < file_name_length + 4) - continue; - - this_version = version_number (file, dp->d_name, file_name_length); - if (this_version > highest_version) - highest_version = this_version; - } - if (CLOSEDIR (dirp)) - return 0; - return highest_version; -} - -/* If BACKUP is a numbered backup of BASE, return its version number; - otherwise return 0. BASE_LENGTH is the length of BASE. - */ - -static int -version_number (const char *base, const char *backup, size_t base_length) -{ - int version; - const char *p; - - version = 0; - if (strncmp (base, backup, base_length) == 0 - && backup[base_length] == '.' - && backup[base_length + 1] == '~') - { - for (p = &backup[base_length + 2]; ISDIGIT (*p); ++p) - version = version * 10 + *p - '0'; - if (p[0] != '~' || p[1]) - version = 0; - } - return version; -} -#endif /* HAVE_DIR */ - -static const char * const backup_args[] = -{ - /* In a series of synonyms, present the most meaning full first, so - that argmatch_valid be more readable. */ - "none", "off", - "simple", "never", - "existing", "nil", - "numbered", "t", - 0 -}; - -static const enum backup_type backup_types[] = -{ - none, none, - simple, simple, - numbered_existing, numbered_existing, - numbered, numbered -}; - -/* Return the type of backup specified by VERSION. - If VERSION is NULL or the empty string, return numbered_existing. - If VERSION is invalid or ambiguous, fail with a diagnostic appropriate - for the specified CONTEXT. Unambiguous abbreviations are accepted. */ - -enum backup_type -get_version (const char *context, const char *version) -{ - if (version == 0 || *version == 0) - return numbered_existing; - else - return XARGMATCH (context, version, backup_args, backup_types); -} - - -/* Return the type of backup specified by VERSION. - If VERSION is NULL, use the value of the envvar VERSION_CONTROL. - If the specified string is invalid or ambiguous, fail with a diagnostic - appropriate for the specified CONTEXT. - Unambiguous abbreviations are accepted. */ - -enum backup_type -xget_version (const char *context, const char *version) -{ - if (version && *version) - return get_version (context, version); - else - return get_version ("$VERSION_CONTROL", getenv ("VERSION_CONTROL")); -} Property changes on: vendor/misc-GNU/patch/dist/backupfile.c ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/backupfile.h =================================================================== --- vendor/misc-GNU/patch/dist/backupfile.h (revision 358868) +++ vendor/misc-GNU/patch/dist/backupfile.h (nonexistent) @@ -1,60 +0,0 @@ -/* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990-1992, 1997-1999 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef BACKUPFILE_H_ -# define BACKUPFILE_H_ - -/* When to make backup files. */ -enum backup_type -{ - /* Never make backups. */ - none, - - /* Make simple backups of every file. */ - simple, - - /* Make numbered backups of files that already have numbered backups, - and simple backups of the others. */ - numbered_existing, - - /* Make numbered backups of every file. */ - numbered -}; - -# define VALID_BACKUP_TYPE(Type) \ - ((Type) == none \ - || (Type) == simple \ - || (Type) == numbered_existing \ - || (Type) == numbered) - -extern char const *simple_backup_suffix; - -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -char *find_backup_file_name PARAMS ((char const *, enum backup_type)); -enum backup_type get_version PARAMS ((char const *context, char const *arg)); -enum backup_type xget_version PARAMS ((char const *context, char const *arg)); -void addext PARAMS ((char *, char const *, int)); - -#endif /* ! BACKUPFILE_H_ */ Property changes on: vendor/misc-GNU/patch/dist/backupfile.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch/dist/AUTHORS =================================================================== --- vendor/misc-GNU/patch/dist/AUTHORS (revision 358868) +++ vendor/misc-GNU/patch/dist/AUTHORS (nonexistent) @@ -1,9 +0,0 @@ -Larry Wall wrote the original version of `patch'. - -Paul Eggert removed arbitrary limits; added support for binary -files, setting file times, and deleting files; and made it conform -better to POSIX. - -Wayne Davison added unidiff support. - -David MacKenzie added configuration and backup support. Index: vendor/misc-GNU/patch/dist/util.h =================================================================== --- vendor/misc-GNU/patch/dist/util.h (revision 358868) +++ vendor/misc-GNU/patch/dist/util.h (nonexistent) @@ -1,59 +0,0 @@ -/* utility functions for `patch' */ - -/* $Id: util.h,v 1.20 2003/05/20 13:56:48 eggert Exp $ */ - -/* Copyright (C) 1986 Larry Wall - - Copyright (C) 1992, 1993, 1997, 1998, 1999, 2001, 2002, 2003 Free - Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* An upper bound on the print length of a signed decimal line number. - Add one for the sign. */ -#define LINENUM_LENGTH_BOUND (sizeof (LINENUM) * CHAR_BIT / 3 + 1) - -XTERN enum backup_type backup_type; - -bool ok_to_reverse (char const *, ...) __attribute__ ((format (printf, 1, 2))); -void ask (char const *, ...) __attribute__ ((format (printf, 1, 2))); -void say (char const *, ...) __attribute__ ((format (printf, 1, 2))); - -void fatal (char const *, ...) - __attribute__ ((noreturn, format (printf, 1, 2))); -void pfatal (char const *, ...) - __attribute__ ((noreturn, format (printf, 1, 2))); - -char *fetchname (char *, int, time_t *); -char *savebuf (char const *, size_t); -char *savestr (char const *); -char const *version_controller (char const *, bool, struct stat const *, char **, char **); -bool version_get (char const *, char const *, bool, bool, char const *, struct stat *); -int create_file (char const *, int, mode_t); -int systemic (char const *); -char *format_linenum (char[LINENUM_LENGTH_BOUND + 1], LINENUM); -void Fseek (FILE *, file_offset, int); -void copy_file (char const *, char const *, int, mode_t); -void exit_with_signal (int) __attribute__ ((noreturn)); -void ignore_signals (void); -void init_time (void); -void memory_fatal (void) __attribute__ ((noreturn)); -void move_file (char const *, int volatile *, char *, mode_t, bool); -void read_fatal (void) __attribute__ ((noreturn)); -void remove_prefix (char *, size_t); -void removedirs (char *); -void set_signals (bool); -void write_fatal (void) __attribute__ ((noreturn)); Property changes on: vendor/misc-GNU/patch/dist/util.h ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Index: vendor/misc-GNU/patch =================================================================== --- vendor/misc-GNU/patch (revision 358868) +++ vendor/misc-GNU/patch (nonexistent) Property changes on: vendor/misc-GNU/patch ___________________________________________________________________ Deleted: svn:mergeinfo ## -0,1 +0,0 ## Reverse-merged /vendor/patch/dist:r27045-32245