summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2013-02-15 12:22:27 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2013-02-15 12:22:27 +0400
commitf831645ed8dac3bb545876d19e631c5c789181ca (patch)
treeee5b8551f6d7a35995273702947ff83eab0fa055 /nasm.c
parent331fd7c8aa3c0c11cbd4d95470c6ac079c7b628b (diff)
downloadnasm-f831645ed8dac3bb545876d19e631c5c789181ca.tar.gz
nasm-f831645ed8dac3bb545876d19e631c5c789181ca.tar.bz2
nasm-f831645ed8dac3bb545876d19e631c5c789181ca.zip
nasm.c: Tabs to spaces in copy_filename
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c104
1 files changed, 52 insertions, 52 deletions
diff --git a/nasm.c b/nasm.c
index de03d52..ffdec47 100644
--- a/nasm.c
+++ b/nasm.c
@@ -536,74 +536,74 @@ static char *quote_for_make(const char *str)
const char *p;
char *os, *q;
- size_t n = 1; /* Terminating zero */
+ size_t n = 1; /* Terminating zero */
size_t nbs = 0;
if (!str)
- return NULL;
+ return NULL;
for (p = str; *p; p++) {
- switch (*p) {
- case ' ':
- case '\t':
- /* Convert N backslashes + ws -> 2N+1 backslashes + ws */
- n += nbs + 2;
- nbs = 0;
- break;
- case '$':
- case '#':
- nbs = 0;
- n += 2;
- break;
- case '\\':
- nbs++;
- n++;
- break;
- default:
- nbs = 0;
- n++;
- break;
- }
+ switch (*p) {
+ case ' ':
+ case '\t':
+ /* Convert N backslashes + ws -> 2N+1 backslashes + ws */
+ n += nbs + 2;
+ nbs = 0;
+ break;
+ case '$':
+ case '#':
+ nbs = 0;
+ n += 2;
+ break;
+ case '\\':
+ nbs++;
+ n++;
+ break;
+ default:
+ nbs = 0;
+ n++;
+ break;
+ }
}
/* Convert N backslashes at the end of filename to 2N backslashes */
if (nbs)
- n += nbs;
+ n += nbs;
os = q = nasm_malloc(n);
nbs = 0;
for (p = str; *p; p++) {
- switch (*p) {
- case ' ':
- case '\t':
- while (nbs--)
- *q++ = '\\';
- *q++ = '\\';
- *q++ = *p;
- break;
- case '$':
- *q++ = *p;
- *q++ = *p;
- nbs = 0;
- break;
- case '#':
- *q++ = '\\';
- *q++ = *p;
- nbs = 0;
- break;
- case '\\':
- *q++ = *p;
- nbs++;
- break;
- default:
- *q++ = *p;
- nbs = 0;
- break;
- }
+ switch (*p) {
+ case ' ':
+ case '\t':
+ while (nbs--)
+ *q++ = '\\';
+ *q++ = '\\';
+ *q++ = *p;
+ break;
+ case '$':
+ *q++ = *p;
+ *q++ = *p;
+ nbs = 0;
+ break;
+ case '#':
+ *q++ = '\\';
+ *q++ = *p;
+ nbs = 0;
+ break;
+ case '\\':
+ *q++ = *p;
+ nbs++;
+ break;
+ default:
+ *q++ = *p;
+ nbs = 0;
+ break;
+ }
}
while (nbs--)
- *q++ = '\\';
+ *q++ = '\\';
*q = '\0';