From: Erez Zadok Date: Sun, 28 Aug 2005 00:06:28 +0000 (+0000) Subject: no trailing spaces X-Git-Tag: before-clocktime-fixes~13 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=6abc0ea3e994bcfb06e09fdbac71e57430db6249;p=am-utils-6.1.git no trailing spaces --- diff --git a/ChangeLog b/ChangeLog index bbd839a..ddc3482 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ * amd/mapc.c (mapc_add_kv): Add support for multiple entries packed into one line. This is a workaround for handling Sun style - mounts that contains multiple entries on one line "multi-mount + mounts that contains multiple entries on one line: "multi-mount entries". The sun2amd conversion tools will convert such entries into type:=auto and pack each of the auto-entries into one line separated by '\n'. The mapc_add_kv function will now recognize @@ -36,7 +36,7 @@ files. Therefore, the line number will always be 1. It is now up to the higher level tools to echo line information during error when they feed the parser. - + 2005-08-24 Erez Zadok * configure.in: wrap all LDAP and HESIOD tests in test whether diff --git a/amd/mapc.c b/amd/mapc.c index adee189..206287c 100644 --- a/amd/mapc.c +++ b/amd/mapc.c @@ -427,7 +427,7 @@ mapc_add_kv(mnt_map *m, char *key, char *val) #endif /* HAVE_REGEXEC */ dlog("add_kv: %s -> %s", key, val); - + if (val != NULL && strchr(val, '\n') != NULL) { /* * If the entry value contains multiple lines we need to break @@ -438,7 +438,7 @@ mapc_add_kv(mnt_map *m, char *key, char *val) * each type:=auto entry on the same line separated by '\n'. */ char *entry, *tok; - + /* * The first line should contain the first entry. The key for * this entry is the key passed into this function. @@ -446,7 +446,7 @@ mapc_add_kv(mnt_map *m, char *key, char *val) if ((tok = strtok(val, "\n")) != NULL) { mapc_add_kv(m, key, strdup(tok)); } - + /* * For the rest of the entries we need to tokenize them by '\n' * and separate the keys from there entries. @@ -458,14 +458,14 @@ mapc_add_kv(mnt_map *m, char *key, char *val) if (*entry) { *entry++ = '\0'; } - + mapc_add_kv(m, strdup(key), strdup(entry)); } - + XFREE(val); return; } - + #ifdef HAVE_REGEXEC if (MAPC_ISRE(m)) { char pattern[MAXPATHLEN]; @@ -1212,6 +1212,6 @@ get_full_path(const char *map, const char *path, const char *type) return full_path; str = strtok(NULL, ":"); } while (str); - + return map; /* if found nothing, return map */ } diff --git a/amd/sun2amd.8 b/amd/sun2amd.8 index da25f27..45165bc 100644 --- a/amd/sun2amd.8 +++ b/amd/sun2amd.8 @@ -52,7 +52,7 @@ sun2amd \- converts Sun automount maps to Amd maps .SH DESCRIPTION .B sun2amd is used to convert Sun style automount maps to Amd style automount -maps. By default +maps. By default .B sun2amd reads from stdin and writes to stdout. @@ -74,7 +74,7 @@ auto.amd type: .B sun2amd -i auto_foo -o auto.amd -.SH BUGS +.SH BUGS * Can not convert master maps yet. * NFS is the only automount type currently supported. diff --git a/amd/sun2amd.c b/amd/sun2amd.c index 8cc9dd8..ea3971e 100644 --- a/amd/sun2amd.c +++ b/amd/sun2amd.c @@ -75,7 +75,7 @@ sun2amd_convert(FILE *sun_in, FILE *amd_out) while ((pos = file_read_line(line_buff, sizeof(line_buff), sun_in))) { line++; line_buff[pos - 1] = '\0'; - + /* remove comments */ if ((tmp = strchr(line_buff, '#')) != NULL) { *tmp = '\0'; @@ -113,12 +113,12 @@ sun2amd_convert(FILE *sun_in, FILE *amd_out) plog(XLOG_ERROR, "parse error on line %d", line); goto err; } - + if (fprintf(amd_out, "%s %s\n", key, tmp) < 0) { - plog(XLOG_ERROR, "can't write to output stream: %s", strerror(errno)); + plog(XLOG_ERROR, "can't write to output stream: %s", strerror(errno)); goto err; } - + /* just to be safe */ memset(line_buff, 0, sizeof(line_buff)); } diff --git a/amd/sun_map.c b/amd/sun_map.c index 80496c2..8c1d69d 100644 --- a/amd/sun_map.c +++ b/amd/sun_map.c @@ -509,7 +509,7 @@ sun_multi2amd(char *dest, * param key - automount key * param s_entry - Sun style automap entry * - * return - Amd entry on succes, NULL on error + * return - Amd entry on succes, NULL on error */ char * sun_entry2amd(const char *key, const char *s_entry_str) @@ -517,7 +517,7 @@ sun_entry2amd(const char *key, const char *s_entry_str) char *retval = NULL; char line_buff[INFO_MAX_LINE_LEN]; struct sun_entry *s_entry = NULL; - + /* For now the key should no be NULL. */ if (key == NULL) { plog(XLOG_ERROR,"Sun key value was null"); @@ -537,7 +537,7 @@ sun_entry2amd(const char *key, const char *s_entry_str) } memset(line_buff, 0, sizeof(line_buff)); - + if (s_entry->opt_list != NULL) { /* write the mount options to the buffer */ sun_opts2amd(line_buff, sizeof(line_buff), key, s_entry->opt_list); @@ -570,7 +570,7 @@ sun_entry2amd(const char *key, const char *s_entry_str) plog(XLOG_ERROR, "Sun fstype %s is currently not supported by Amd.", s_entry->fstype); goto err; - + } else if (NSTREQ(s_entry->fstype, SUN_CACHEFS_TYPE, strlen(SUN_CACHEFS_TYPE))) { /* CacheFS Type */ @@ -590,7 +590,7 @@ sun_entry2amd(const char *key, const char *s_entry_str) retval = strdup(line_buff); } } - + err: if (s_entry != NULL) { XFREE(s_entry); diff --git a/amd/sun_map.h b/amd/sun_map.h index 514cd10..863992f 100644 --- a/amd/sun_map.h +++ b/amd/sun_map.h @@ -84,8 +84,8 @@ struct sun_entry { struct sun_mountpt *mountpt_list; /* list of mount points */ }; -/* - * automount map file +/* + * automount map file * * XXX: Only a place holder structure, not implemented yet. */ @@ -100,8 +100,8 @@ struct sun_map { struct sun_entry *entry_list; /* list of 'struct s2a_entry' */ }; -/* - * master map file +/* + * master map file * * XXX: Only a place holder structure, not implemented yet. */ diff --git a/amd/sun_map_parse.y b/amd/sun_map_parse.y index 2914ef0..2ee7a8a 100644 --- a/amd/sun_map_parse.y +++ b/amd/sun_map_parse.y @@ -98,7 +98,7 @@ file : new_lines entries | entries ; -entries : entry +entries : entry | entry new_lines | entry new_lines entries ; @@ -215,7 +215,7 @@ entry : locations { list = get_sun_opt_list(); entry->opt_list = (struct sun_opt *)list->first; sun_opt_list = NULL; - + /* Add this entry to the entry list. */ sun_list_add(get_sun_entry_list(), (qelem *)entry); } @@ -441,7 +441,7 @@ sun_map_parse_read(const char *map_data) else { plog(XLOG_ERROR, "Sun map parser did not produce data structs."); } - + return retval; }