From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SwLq9-0005s2-Vv for mharc-grub-devel@gnu.org; Tue, 31 Jul 2012 19:27:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwLq6-0005qk-VW for grub-devel@gnu.org; Tue, 31 Jul 2012 19:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwLq5-0006lL-AD for grub-devel@gnu.org; Tue, 31 Jul 2012 19:26:58 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:33773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwLq4-0006jw-VW for grub-devel@gnu.org; Tue, 31 Jul 2012 19:26:57 -0400 Received: by wgbez12 with SMTP id ez12so4967362wgb.30 for ; Tue, 31 Jul 2012 16:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=iVWG+FrLUo+WZgi3FtxYDBlsGjQKRxzcr/D4OhjYIaw=; b=tpJPV+yZCCEHG5GpYFbI4Vm0UWQpZrACMZNUcPgBsfPNOFT7X3PgPoRo3SjoeAh3BP EiU3cteVVAGQU+MPWLFgKSzmD0iow3We84dlgwOCsme5ky0QlDPyMNgfYbInGEukNyhs jVeZV5dNDSOt8Q2n6FQCt0BLHL/fXYScC0c4NcX84gosdZrr+CGITBe4b6XHyHEYR1af lSf6ELNeVO6TIAojGyyNAi3n0JsrBEWdRitjfWxj/5rhUqGm1r+j+e5Z49oQCMuBPxJU tEgkuHZZrLb2EHrDubQTu/8utBJHlk2S2W2G8E0waprtLoMuvE9gFzwPiOOsP5P4WquM Ks7Q== Received: by 10.180.93.68 with SMTP id cs4mr6898923wib.14.1343777216195; Tue, 31 Jul 2012 16:26:56 -0700 (PDT) Received: from [192.168.1.37] (c2433-1-88-160-112-182.fbx.proxad.net. [88.160.112.182]) by mx.google.com with ESMTPS id b7sm3915108wiz.9.2012.07.31.16.26.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2012 16:26:55 -0700 (PDT) Message-ID: <501869BE.1010909@gmail.com> Date: Wed, 01 Aug 2012 01:26:54 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5 MIME-Version: 1.0 To: The development of GNU GRUB Subject: [PATCH] Add gnulib's stpcpy. Content-Type: multipart/mixed; boundary="------------020803050009030008000507" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2012 23:27:00 -0000 This is a multi-part message in MIME format. --------------020803050009030008000507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit The attached patch adds gnulib's stpcpy. This is required on systems lacking stpcpy, e.g., NetBSD 5.1. Note: I used gnulib's sources from 2010-09-20, since this is, afaics, the date of import of gnulib files in GRUB. Grégoire --------------020803050009030008000507 Content-Type: text/x-patch; name="patch-stpcpy-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-stpcpy-1.diff" === modified file 'grub-core/gnulib/Makefile.am' --- grub-core/gnulib/Makefile.am 2010-09-20 23:09:23 +0000 +++ grub-core/gnulib/Makefile.am 2012-07-28 13:09:43 +0000 @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex stpcpy AUTOMAKE_OPTIONS = 1.5 gnits @@ -859,6 +859,15 @@ ## end gnulib module stdlib +## begin gnulib module stpcpy + + +EXTRA_DIST += stpcpy.c + +EXTRA_libgnu_a_SOURCES += stpcpy.c + +## end gnulib module stpcpy + ## begin gnulib module strcase === added file 'grub-core/gnulib/stpcpy.c' --- grub-core/gnulib/stpcpy.c 1970-01-01 00:00:00 +0000 +++ grub-core/gnulib/stpcpy.c 2012-07-28 13:09:38 +0000 @@ -0,0 +1,49 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2010 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 3 of the License, or 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, see . */ + +#include + +#include + +#undef __stpcpy +#ifdef _LIBC +# undef stpcpy +#endif + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (char *dest, const char *src) +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif === modified file 'm4/gnulib-cache.m4' --- m4/gnulib-cache.m4 2010-09-20 23:09:23 +0000 +++ m4/gnulib-cache.m4 2012-07-28 13:09:43 +0000 @@ -15,7 +15,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex +# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex stpcpy # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -28,6 +28,7 @@ gettext progname regex + stpcpy ]) gl_AVOID([]) gl_SOURCE_BASE([grub-core/gnulib]) === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2010-09-20 23:09:23 +0000 +++ m4/gnulib-comp.m4 2012-07-28 13:09:44 +0000 @@ -73,6 +73,7 @@ # Code from module stdint: # Code from module stdio: # Code from module stdlib: + # Code from module stpcpy: # Code from module strcase: # Code from module strchrnul: # Code from module streq: @@ -221,6 +222,9 @@ gl_STDIO_H # Code from module stdlib: gl_STDLIB_H + # Code from module stpcpy: + gl_FUNC_STPCPY + gl_STRING_MODULE_INDICATOR([stpcpy]) # Code from module strcase: gl_STRCASE # Code from module strchrnul: @@ -482,6 +486,7 @@ lib/stdio-write.c lib/stdio.in.h lib/stdlib.in.h + lib/stpcpy.c lib/strcasecmp.c lib/strchrnul.c lib/strchrnul.valgrind @@ -576,6 +581,7 @@ m4/stdint_h.m4 m4/stdio_h.m4 m4/stdlib_h.m4 + m4/stpcpy.m4 m4/strcase.m4 m4/strchrnul.m4 m4/strerror.m4 === added file 'm4/stpcpy.m4' --- m4/stpcpy.m4 1970-01-01 00:00:00 +0000 +++ m4/stpcpy.m4 2012-07-28 13:09:38 +0000 @@ -0,0 +1,26 @@ +# stpcpy.m4 serial 7 +dnl Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STPCPY], +[ + dnl Persuade glibc to declare stpcpy(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl The stpcpy() declaration in lib/string.in.h uses 'restrict'. + AC_REQUIRE([AC_C_RESTRICT]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REPLACE_FUNCS([stpcpy]) + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + gl_PREREQ_STPCPY + fi +]) + +# Prerequisites of lib/stpcpy.c. +AC_DEFUN([gl_PREREQ_STPCPY], [ + : +]) --------------020803050009030008000507--