summaryrefslogtreecommitdiffstats
path: root/source/lib/util_str.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-11 14:23:55 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-11 14:23:55 +0000
commit13a0ee851fe0ce9acddfe57f9aba19fc78085c39 (patch)
treeb81bc35aedd705fa25b8d7d83dce638ddd1fbde0 /source/lib/util_str.c
parenta41defc36756eef0054f66dcbd46890453ad5ae3 (diff)
downloadsamba-13a0ee851fe0ce9acddfe57f9aba19fc78085c39.tar.gz
samba-13a0ee851fe0ce9acddfe57f9aba19fc78085c39.tar.xz
samba-13a0ee851fe0ce9acddfe57f9aba19fc78085c39.zip
changed syntax of registry commands so keys can start with HKLM or HKU.
sorted lookupsids command
Diffstat (limited to 'source/lib/util_str.c')
-rw-r--r--source/lib/util_str.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index 15eefb00013..996273bf3ad 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -1024,3 +1024,34 @@ BOOL string_sub(char *s,char *pattern,char *insert)
return(ret);
}
+/****************************************************************************
+ splits out the front and back at a separator.
+****************************************************************************/
+void split_at_last_component(char *path, char *front, char sep, char *back)
+{
+ char *p = strrchr(path, sep);
+
+ if (p != NULL)
+ {
+ *p = 0;
+ }
+ if (front != NULL)
+ {
+ pstrcpy(front, path);
+ }
+ if (p != NULL)
+ {
+ if (back != NULL)
+ {
+ pstrcpy(back, p+1);
+ }
+ *p = '\\';
+ }
+ else
+ {
+ if (back != NULL)
+ {
+ back[0] = 0;
+ }
+ }
+}