[dovecot-cvs] dovecot/src/lib home-expand.c, 1.2.2.1, 1.2.2.2 home-expand.h, 1.1.2.1, 1.1.2.2
tss at dovecot.org
tss at dovecot.org
Fri Mar 23 02:06:41 EET 2007
- Previous message: [dovecot-cvs] dovecot/doc Makefile.am, 1.13, 1.14 dovecot-ldap-example.conf, 1.1, 1.2 dovecot-ldap.conf, 1.21, NONE dovecot-sql-example.conf, 1.1, 1.2 dovecot-sql.conf, 1.13, NONE
- Next message: [dovecot-cvs] dovecot/src/lib home-expand.c, 1.3, 1.4 home-expand.h, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv21424
Modified Files:
Tag: branch_1_0
home-expand.c home-expand.h
Log Message:
Added home_expand_tilde()
Index: home-expand.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/home-expand.c,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -d -r1.2.2.1 -r1.2.2.2
--- home-expand.c 3 Jan 2007 22:38:25 -0000 1.2.2.1
+++ home-expand.c 23 Mar 2007 00:06:39 -0000 1.2.2.2
@@ -47,3 +47,17 @@
(void)home_try_expand(&path);
return path;
}
+
+const char *home_expand_tilde(const char *path, const char *home)
+{
+ if (path == NULL || *path != '~')
+ return path;
+
+ if (path[1] == '\0')
+ return home;
+ if (path[1] != '/')
+ return path;
+
+ /* ~/ used */
+ return t_strconcat(home, path + 1, NULL);
+}
Index: home-expand.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/home-expand.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- home-expand.h 3 Jan 2007 22:38:25 -0000 1.1.2.1
+++ home-expand.h 23 Mar 2007 00:06:39 -0000 1.1.2.2
@@ -6,5 +6,7 @@
const char *home_expand(const char *path);
/* Returns 0 if ok, -1 if user wasn't found. */
int home_try_expand(const char **path);
+/* Expand ~/ in the beginning of the path with the give home directory. */
+const char *home_expand_tilde(const char *path, const char *home);
#endif
- Previous message: [dovecot-cvs] dovecot/doc Makefile.am, 1.13, 1.14 dovecot-ldap-example.conf, 1.1, 1.2 dovecot-ldap.conf, 1.21, NONE dovecot-sql-example.conf, 1.1, 1.2 dovecot-sql.conf, 1.13, NONE
- Next message: [dovecot-cvs] dovecot/src/lib home-expand.c, 1.3, 1.4 home-expand.h, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list