mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
New functions.
* gstrfuncs.c (g_strccpy, g_strecpy): New functions. * glib.h: Declare and document them. Define the deprecated g_strescape as a macro that calls g_strecpy. * tests/strfunc-test.c (main): Test them. * makefile.{cygwin,msc}.in * tests/makefile.{cygwin,msc}.in: Remove gstack and its test program. * glib.def: Additions and removals. * README.win32: Improve gcc build instructions. * build-dll: Also build import library for MSVC.
This commit is contained in:
@@ -99,6 +99,17 @@ main (int argc,
|
||||
g_assert (strcmp(string, "00021 test ") == 0);
|
||||
g_free (string);
|
||||
|
||||
g_assert (strcmp(g_strccpy(g_malloc(100),
|
||||
"abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313"),
|
||||
"abc\\\"\b\f\n\r\t\003\177\234\313") == 0);
|
||||
g_assert (strcmp(g_strecpy(g_malloc(100),
|
||||
"abc\\\"\b\f\n\r\t\003\177\234\313",
|
||||
NULL),
|
||||
"abc\\\\\\\"\\b\\f\\n\\r\\t\\003\\177\\234\\313") == 0);
|
||||
g_assert (strcmp(g_strecpy(g_malloc(100),"abc\\\"\b\f\n\r\t\003\177\234\313",
|
||||
"\b\f\001\002\003\004"),
|
||||
"abc\\\\\\\"\b\f\\n\\r\\t\003\\177\\234\\313") == 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user