Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-01-19 12:41:54 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-01-19 12:41:54 +0300
commit17133a85de3326ec7c63f800581984392ddd276f (patch)
tree0c95de462a564355495f3c5b376f16847cc253d5 /winsup/cygwin/strfuncs.cc
parent808aae3d13971fd7ccb474caff9bd89a9569795b (diff)
* exec.cc (strccpy): Move function from here...
* strfuncs.cc (strccpy): ...to here. * string.h (strccpy): Declare. * winsup.h (strccpy): Drop declaration.
Diffstat (limited to 'winsup/cygwin/strfuncs.cc')
-rw-r--r--winsup/cygwin/strfuncs.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index 097421703..8b13b20d8 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -1,7 +1,7 @@
/* strfuncs.cc: misc funcs that don't belong anywhere else
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -663,6 +663,20 @@ sys_mbstowcs_alloc (wchar_t **dst_p, int type, const char *src, size_t nms)
return ret;
}
+/* Copy string, until c or <nul> is encountered.
+ NUL-terminate the destination string (s1).
+ Return pointer to terminating byte in dst string. */
+char * __stdcall
+strccpy (char *s1, const char **s2, char c)
+{
+ while (**s2 && **s2 != c)
+ *s1++ = *((*s2)++);
+ *s1 = 0;
+
+ MALLOC_CHECK;
+ return s1;
+}
+
static WCHAR hex_wchars[] = L"0123456789abcdef";
NTSTATUS NTAPI