aboutsummaryrefslogtreecommitdiff
path: root/intl/dcgettext.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-06 06:05:11 +0000
committerRoland McGrath <roland@gnu.org>1996-06-06 06:05:11 +0000
commit92f3773b4c90ee2752ff391b7b6081eea10b4bca (patch)
tree6dba2592f058a82dc1d576c12e6b0d368ee1ff95 /intl/dcgettext.c
parent8f30ca23f7c7d9181fc532be00e22da67e38a0bf (diff)
downloadglibc-92f3773b4c90ee2752ff391b7b6081eea10b4bca.zip
glibc-92f3773b4c90ee2752ff391b7b6081eea10b4bca.tar.gz
glibc-92f3773b4c90ee2752ff391b7b6081eea10b4bca.tar.bz2
Thu Jun 6 02:00:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>cvs/libc-960606
* Makerules (distinfo-vars): Don't write constant line to frob sources. * Make-dist (sources): Append $(elided-routines) and $(extra-libs) routines.
Diffstat (limited to 'intl/dcgettext.c')
-rw-r--r--intl/dcgettext.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
index ba3796d..958b0d4 100644
--- a/intl/dcgettext.c
+++ b/intl/dcgettext.c
@@ -97,6 +97,9 @@ char *getwd ();
# else
char *getcwd ();
# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
#endif
/* Amount to increase buffer size by in each try. */
@@ -293,12 +296,7 @@ DCGETTEXT (domainname, msgid, category)
we avoid the non-standard function stpcpy. In GNU C Library
this function is available, though. Also allow the symbol
HAVE_STPCPY to be defined. */
-#if defined _LIBC || defined HAVE_STPCPY
stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
-#else
- strcat (dirname, "/");
- strcat (dirname, binding->dirname);
-#endif
}
/* Now determine the symbolic name of CATEGORY and its value. */
@@ -312,16 +310,9 @@ DCGETTEXT (domainname, msgid, category)
avoid the non-standard function stpcpy. In GNU C Library this
function is available, though. Also allow the symbol HAVE_STPCPY
to be defined. */
-#if defined _LIBC || defined HAVE_STPCPY
stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
domainname),
".mo");
-#else
- strcpy (xdomainname, categoryname);
- strcat (xdomainname, "/");
- strcat (xdomainname, domainname);
- strcat (xdomainname, ".mo");
-#endif
/* Creating working area. */
single_locale = (char *) alloca (strlen (categoryvalue) + 1);
@@ -586,3 +577,21 @@ static const char *guess_category_value (category, categoryname)
return "C";
#endif
}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif