diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-16 11:07:33 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-16 11:07:33 +0800 |
commit | 0f867492a82d71f8205f70e007dc196010437031 (patch) | |
tree | 27e2627790ce202aa78a93b8841516d11af5d3d8 /util | |
parent | 6e73dd08e23f19998a385c2d5576345fc947e741 (diff) | |
download | pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar.gz pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar.bz2 pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar.lz pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar.xz pttbbs-0f867492a82d71f8205f70e007dc196010437031.tar.zst pttbbs-0f867492a82d71f8205f70e007dc196010437031.zip |
Leave unprocessed line unchanged when doing chesscountry things.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3488 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/chesscountry.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util/chesscountry.c b/util/chesscountry.c index 856d4afd..51f0baa3 100644 --- a/util/chesscountry.c +++ b/util/chesscountry.c @@ -39,7 +39,7 @@ main(void) int i = 0, num; // char *currboard[3] = {"CCK-CHUHEN", "CCK-GENERAL", "CCK-FREE"}; // char *kingdom[3] = {"楚漢皇朝", "將帥帝聯", "逍遙王朝"}; - char file1[80], file2[80], str[256]; + char file1[80], file2[80], line[256], str[256]; time_t dtime; boardheader_t brd; int brdfd; @@ -110,7 +110,7 @@ main(void) while (fgets(buf, sizeof(buf), fp)) { i = 0; - strcpy(str, buf); + strcpy(line, buf); p = strtok(buf, " "); name[0] = '\0'; if (p && *p != '#' && searchuser(p, userid)) @@ -140,10 +140,9 @@ main(void) } if (i == 0) { - fprintf(ftmp, "%s", str); + fprintf(ftmp, "%s", line); continue; } - fprintf(ftmp, "#%s", str); namelen = strlen(name); setapath(str, brd.brdname); @@ -188,9 +187,14 @@ main(void) fprintf(fp1, "\n<自我說明> \n"); fclose(fp1); } + break; } } } + if (i > num) // level photo not found + fprintf(ftmp, "%s", line); + else + fprintf(ftmp, "#%s", line); } fclose(fp); fclose(ftmp); |