Re: [PATCH v3 3/5] Move offset_1st_component() to path.c
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Feb 15, 2010, 19:43 UTC
- Message-ID
- <4B79A3ED.4090308@kdbg.org>
- In-Reply-To
- <1266162285-10955-3-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy schrieb:
Show 6 quoted lines
> +int offset_1st_component(const char *path)
> +{
> + if (has_dos_drive_prefix(path))
> + return 2 + (path[2] == '/');
> + return *path == '/';
> +}I'd have expected that you future-proofed this function by using is_dir_sep() or even use your previous implementation of is_root_path (because this implementation is a bit cryptic).
But if the new callers of this function will only pass the results of normalize_path_copy() and getcwd() (both return only forward-slashes on Windows), then I'm fine with this version. Do they?
-- Hannes