summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-13 22:27:20 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-13 22:27:20 +0800
commitc465925682db6fe601b1292dead369cd68c85ecb (patch)
tree756a7ed8350f459e375becac23e1287aab04492c /util
parentec6f40d02fe653b00174b1d0c76ad6f5232aa9f7 (diff)
downloadpttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar.gz
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar.bz2
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar.lz
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar.xz
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.tar.zst
pttbbs-c465925682db6fe601b1292dead369cd68c85ecb.zip
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
Diffstat (limited to 'util')
-rw-r--r--util/chesscountry.c4
1 files changed, 3 insertions, 1 deletions
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")))