Navigation Menu

Skip to content

Commit

Permalink
use meaningful name for argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 14, 2012
1 parent 08d517e commit 9e9692b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions mrn_sys.c
Expand Up @@ -89,17 +89,17 @@ int mrn_hash_remove(grn_ctx *ctx, grn_hash *hash, const char *key)
* "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0" ==>
* "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0.mrn"
*/
char *mrn_db_path_gen(const char *arg, char *dest)
char *mrn_db_path_gen(const char *db_path_in_mysql, char *dest)
{
if (strncmp(arg, "./", 2) == 0) {
if (strncmp(db_path_in_mysql, "./", 2) == 0) {
int i = 2, j = 0, len;
len = strlen(arg);
while (arg[i] != '/' && i < len) {
dest[j++] = arg[i++];
len = strlen(db_path_in_mysql);
while (db_path_in_mysql[i] != '/' && i < len) {
dest[j++] = db_path_in_mysql[i++];
}
dest[j] = '\0';
} else {
strcpy(dest, arg);
strcpy(dest, db_path_in_mysql);
}
strcat(dest, MRN_DB_FILE_SUFFIX);
return dest;
Expand All @@ -111,17 +111,17 @@ char *mrn_db_path_gen(const char *arg, char *dest)
* "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0" ==>
* "/tmp/mysql-test/var/tmp/mysqld.1/#sql27c5_1_0"
*/
char *mrn_db_name_gen(const char *arg, char *dest)
char *mrn_db_name_gen(const char *db_path_in_mysql, char *dest)
{
if (strncmp(arg, "./", 2) == 0) {
if (strncmp(db_path_in_mysql, "./", 2) == 0) {
int i = 2, j = 0, len;
len = strlen(arg);
while (arg[i] != '/' && i < len) {
dest[j++] = arg[i++];
len = strlen(db_path_in_mysql);
while (db_path_in_mysql[i] != '/' && i < len) {
dest[j++] = db_path_in_mysql[i++];
}
dest[j] = '\0';
} else {
strcpy(dest, arg);
strcpy(dest, db_path_in_mysql);
}
return dest;
}
Expand Down

0 comments on commit 9e9692b

Please sign in to comment.