MCPcopy Create free account
hub / github.com/apache/nuttx / dequote_path

Function dequote_path

tools/cnvwindeps.c:98–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static bool dequote_path(const char *winpath)
99{
100 char *dest = g_dequoted;
101 const char *src = winpath;
102 int len = 0;
103 bool quoted = false;
104
105 while (*src && len < MAX_PATH)
106 {
107 if (src[0] != '\\' || (src[1] != ' ' &&
108 src[1] != '(' && src[1] != ')'))
109 {
110 *dest++ = *src;
111 len++;
112 }
113 else
114 {
115 quoted = true;
116 }
117
118 src++;
119 }
120
121 if (*src || len >= MAX_PATH)
122 {
123 fprintf(stderr, "%lu: Line truncated\n", g_lineno);
124 exit(EXIT_FAILURE);
125 }
126
127 *dest = '\0';
128 return quoted;
129}
130
131static bool convert_path(const char *winpath)
132{

Callers 1

convert_pathFunction · 0.70

Calls 2

fprintfFunction · 0.85
exitFunction · 0.85

Tested by

no test coverage detected