diff options
| author | Tom Yu <tlyu@mit.edu> | 2009-12-07 22:36:41 +0000 |
|---|---|---|
| committer | Tom Yu <tlyu@mit.edu> | 2009-12-07 22:36:41 +0000 |
| commit | ac911f663389980be59a0f9ee98f062e6c627658 (patch) | |
| tree | c423ac7174c1a82a107013894a6944a506e68774 /src/util/windows/libecho.c | |
| parent | 741938feb12538b659a36d7e0329efe6a5550669 (diff) | |
| download | krb5-ac911f663389980be59a0f9ee98f062e6c627658.tar.gz krb5-ac911f663389980be59a0f9ee98f062e6c627658.tar.xz krb5-ac911f663389980be59a0f9ee98f062e6c627658.zip | |
Mark and reindent util, with some exceptions
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23455 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/windows/libecho.c')
| -rw-r--r-- | src/util/windows/libecho.c | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/src/util/windows/libecho.c b/src/util/windows/libecho.c index 9fcbe2e98..a10eee232 100644 --- a/src/util/windows/libecho.c +++ b/src/util/windows/libecho.c @@ -1,3 +1,4 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * libecho.c * @@ -15,62 +16,62 @@ void echo_files(char *, char *); int main(int argc, char *argv[]) { - int i; - char *prefix; + int i; + char *prefix; - prefix = ""; + prefix = ""; - if (argc < 2) { - fprintf(stderr, "Usage: libecho [-p prefix] list...\n"); - return 1; - } + if (argc < 2) { + fprintf(stderr, "Usage: libecho [-p prefix] list...\n"); + return 1; + } - for (i = 1 ; i < argc ; i++) - if (!stricmp(argv[i], "-p")) - prefix = argv[++i]; - else - echo_files(prefix, argv[i]); + for (i = 1 ; i < argc ; i++) + if (!stricmp(argv[i], "-p")) + prefix = argv[++i]; + else + echo_files(prefix, argv[i]); - return 0; + return 0; } void echo_files(char *prefix, char *f) { - long ff; - struct _finddata_t fdt; - char *slash; - char filepath[256]; + long ff; + struct _finddata_t fdt; + char *slash; + char filepath[256]; - /* - * We're unix based quite a bit here. Look for normal slashes and - * make them reverse slashes. - */ - while((slash = strrchr(f, '/')) != NULL) - *slash = '\\'; + /* + * We're unix based quite a bit here. Look for normal slashes and + * make them reverse slashes. + */ + while((slash = strrchr(f, '/')) != NULL) + *slash = '\\'; - strcpy(filepath, f); + strcpy(filepath, f); - slash = strrchr(filepath, '\\'); + slash = strrchr(filepath, '\\'); - if (slash) { - slash++; - *slash = 0; - } else { - filepath[0] = '\0'; - } + if (slash) { + slash++; + *slash = 0; + } else { + filepath[0] = '\0'; + } - ff = _findfirst(f, &fdt); + ff = _findfirst(f, &fdt); - if (ff < 0) - return; + if (ff < 0) + return; - printf("%s%s%s\n", prefix, filepath, fdt.name); - - for (;;) { - if (_findnext(ff, &fdt) < 0) - break; printf("%s%s%s\n", prefix, filepath, fdt.name); - } - _findclose(ff); + + for (;;) { + if (_findnext(ff, &fdt) < 0) + break; + printf("%s%s%s\n", prefix, filepath, fdt.name); + } + _findclose(ff); } |
