summaryrefslogtreecommitdiff
path: root/source3/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
commit9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49 (patch)
tree65504cd76855cbf4e4662fdb4b776d24469b33aa /source3/lib/util_str.c
parent0e09fba835d0d65e2a927befaf3713dd481d8939 (diff)
downloadsamba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.tar.gz
samba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.tar.bz2
samba-9f14f281ff7efa1af0242a1dd1f5220d5cfdbf49.zip
changed syntax of registry commands so keys can start with HKLM or HKU.
sorted lookupsids command (This used to be commit 13a0ee851fe0ce9acddfe57f9aba19fc78085c39)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 15eefb0001..996273bf3a 100644
--- a/source3/lib/util_str.c
+++ b/source3/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;
+ }
+ }
+}