From: Tomas Mlcoch Date: Mon, 26 Nov 2012 11:15:42 +0000 (+0100) Subject: Use '.' for same directory in database filelist instead of '' X-Git-Tag: upstream/0.2.1~273 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7930974548a1277ecc38a5f7ea712ea0efcadd6b;p=services%2Fcreaterepo_c.git Use '.' for same directory in database filelist instead of '' --- diff --git a/src/sqlite.c b/src/sqlite.c index 23293a9..4ec32e6 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -930,6 +930,12 @@ write_file (gpointer key, gpointer value, gpointer user_data) key_len--; } + if (key_len == 0) { + // Same directory is represented by '.' in database + key = "."; + key_len = 1; + } + sqlite3_bind_int (info->handle, 1, info->pkgKey); sqlite3_bind_text (info->handle, 2, (const char *) key, (int) key_len, SQLITE_STATIC); sqlite3_bind_text (info->handle, 3, file->files->str, -1, SQLITE_STATIC);