Mercurial > hg > toybox
comparison toys/posix/ln.c @ 1183:0752b2d58909 draft
Rename xmsprintf() to just xmprintf().
Partly because there's no supplied target string ala sprintf, and partly
because I can never remember what order the m and s go in.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 16 Jan 2014 09:26:50 -0600 |
parents | 58daf9c9a0b1 |
children | 3ff823086c99 |
comparison
equal
deleted
inserted
replaced
1182:7079ea384a2e | 1183:0752b2d58909 |
---|---|
46 | 46 |
47 for (i=0; i<toys.optc; i++) { | 47 for (i=0; i<toys.optc; i++) { |
48 int rc; | 48 int rc; |
49 char *try = toys.optargs[i]; | 49 char *try = toys.optargs[i]; |
50 | 50 |
51 if (S_ISDIR(buf.st_mode)) new = xmsprintf("%s/%s", dest, basename(try)); | 51 if (S_ISDIR(buf.st_mode)) new = xmprintf("%s/%s", dest, basename(try)); |
52 else new = dest; | 52 else new = dest; |
53 // Silently unlink the existing target (if any) | 53 // Silently unlink the existing target (if any) |
54 if (toys.optflags & FLAG_f) unlink(new); | 54 if (toys.optflags & FLAG_f) unlink(new); |
55 | 55 |
56 rc = (toys.optflags & FLAG_s) ? symlink(try, new) : link(try, new); | 56 rc = (toys.optflags & FLAG_s) ? symlink(try, new) : link(try, new); |