From c465925682db6fe601b1292dead369cd68c85ecb Mon Sep 17 00:00:00 2001 From: scw Date: Sun, 13 Feb 2005 14:27:20 +0000 Subject: Match prefix instead of whole string when scanning chess country photo. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2508 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/chesscountry.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/chesscountry.c b/util/chesscountry.c index 345cec8b..95965c2c 100644 --- a/util/chesscountry.c +++ b/util/chesscountry.c @@ -98,6 +98,7 @@ main(void) char *p; char userid[IDLEN + 1], buf[256], name[11]; char date[11], other[IDLEN + 1]; + int namelen; fgets(kingdom_name, 256, fp); fputs(kingdom_name, ftmp); @@ -139,6 +140,7 @@ main(void) continue; } fprintf(ftmp, "#%s", str); + namelen = strlen(name); setapath(str, brd.brdname); sprintf(buf, "%s/chess_photo/.DIR", str); @@ -149,7 +151,7 @@ main(void) if (get_record(buf, &item, sizeof item, i) != -1) { FILE *fp1; - if (!strcmp(item.title + 3, name)) + if (!strncmp(item.title + 3, name, namelen)) { sethomefile(buf, userid, photo_fname); if ((fp1 = fopen(buf, "w"))) -- cgit v1.2.3