From 24c5904becc1c539cc5b02ca8228d7ebd8401198 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 13 Oct 2015 18:18:25 +0800 Subject: Make translate_slashes() public Signed-off-by: Gary Ching-Pang Lin --- include/str.h | 20 ++++++++++++++++++++ netboot.c | 18 ------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/str.h b/include/str.h index 0f3e003a..9a748366 100644 --- a/include/str.h +++ b/include/str.h @@ -42,4 +42,24 @@ strcata(CHAR8 *dest, const CHAR8 *src) return dest; } +static inline +__attribute__((unused)) +CHAR8 * +translate_slashes(char *str) +{ + int i; + int j; + if (str == NULL) + return (CHAR8 *)str; + + for (i = 0, j = 0; str[i] != '\0'; i++, j++) { + if (str[i] == '\\') { + str[j] = '/'; + if (str[i+1] == '\\') + i++; + } + } + return (CHAR8 *)str; +} + #endif /* SHIM_STR_H */ diff --git a/netboot.c b/netboot.c index ad5d37e9..1cc1a2b8 100644 --- a/netboot.c +++ b/netboot.c @@ -54,24 +54,6 @@ typedef struct { UINT8 Data[1]; } EFI_DHCP6_PACKET_OPTION; -static CHAR8 * -translate_slashes(char *str) -{ - int i; - int j; - if (str == NULL) - return (CHAR8 *)str; - - for (i = 0, j = 0; str[i] != '\0'; i++, j++) { - if (str[i] == '\\') { - str[j] = '/'; - if (str[i+1] == '\\') - i++; - } - } - return (CHAR8 *)str; -} - /* * usingNetboot * Returns TRUE if we identify a protocol that is enabled and Providing us with -- cgit v1.2.3