Skip to content

Commit c6f72ae

Browse files
committed
tools: support backslash as hierarchy separator for folderspec
1 parent 80119bc commit c6f72ae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/gromox-mbop.8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ sequence of subordinate folder names
381381
a folder path starting with a fixed symbolic name, optionally followed by a
382382
slash-separated sequence of subordinate folder names
383383
.PP
384+
The backslash may be used as a hierarchy separator instead; in any case, the
385+
chosen separator must be used consistently in the entire path.
386+
.PP
384387
The recognized strings are: CALENDAR, COMMON_VIEWS, CONFLICTS, CONTACTS,
385388
DEFERRED_ACTION, DELETED (TRASH, WASTEBASKET), DRAFT, FINDER, INBOX,
386389
IPM_SUBTREE, JOURNAL, JUNK, LOCAL_FAILURES, NOTES, OUTBOX, SENT,
@@ -399,5 +402,8 @@ Using the MAPI root: /Top of Information Store/Sent Items/2022
399402
Using a symbolic name: IPM_SUBTREE/Sent Items/2022
400403
.IP \(bu 4
401404
Using a symbolic name: SENT/2022
405+
.IP \(bu 4
406+
Referencing a folder with a slash can be done by using backslash as the
407+
hierarchy separator: SENT\\Winter break 2022/2023
402408
.SH See also
403409
\fBgromox\fP(7)

tools/genimport.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,10 @@ eid_t gi_lookup_eid_by_name(const char *dir, const char *name)
605605
if (end != name && *znul(end) == '\0')
606606
return rop_util_make_eid_ex(1, pure_id);
607607

608-
auto pathcomp = gx_split(name, '/');
608+
const char *sep = strpbrk(name, "/\\"); /* CONST-STRCHR-MARKER */
609+
if (sep == nullptr)
610+
sep = "/";
611+
auto pathcomp = gx_split(name, *sep);
609612
if (pathcomp.size() == 0)
610613
return 0;
611614
auto ptr = std::lower_bound(std::begin(fld_special_names), std::end(fld_special_names),

0 commit comments

Comments
 (0)