summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
authormhsin <mhsin@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-21 03:13:52 +0800
committermhsin <mhsin@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-21 03:13:52 +0800
commit5c2feefbb3efe2c5313babaf2f09f89294c7a6a9 (patch)
tree35bf7775cb667b2bbaafa443efeb3e538571374d /mbbsd/edit.c
parent83cfb1da5bfd3558a336a1d92552cd4419f9ecb9 (diff)
downloadpttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar.gz
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar.bz2
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar.lz
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar.xz
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.tar.zst
pttbbs-5c2feefbb3efe2c5313babaf2f09f89294c7a6a9.zip
Revert r3196(as a workaround).
Really(hope so :p) solve bug in r3192. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3197 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index ca8c6882..cade65f7 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1524,23 +1524,27 @@ browse_sigs:
if (!buf[0])
buf[0] = ch;
- ch = buf[0];
+ if (isdigit((int)buf[0]))
+ ch = buf[0];
+ else
+ ch = '1' + random() % (si.max+1);
cuser.signature = buf[0];
- while (ch != '0' && si.total > 0) {
- if(!isdigit((int)buf[0]))
- ch = '1' + random() % (si.max+1);
+ if (ch != '0') {
fpath[i] = ch;
- if ((fs = fopen(fpath, "r"))) {
- fputs("\n--\n", fp);
- for (i = 0; i < MAX_SIGLINES &&
- fgets(buf, sizeof(buf), fs); i++)
- fputs(buf, fp);
- fclose(fs);
- ch = '0';
- } else if (isdigit((int)buf[0])) {
- ch = '0';
- }
+ do
+ {
+ if ((fs = fopen(fpath, "r"))) {
+ fputs("\n--\n", fp);
+ for (i = 0; i < MAX_SIGLINES &&
+ fgets(buf, sizeof(buf), fs); i++)
+ fputs(buf, fp);
+ fclose(fs);
+ fpath[i] = ch;
+ }
+ else
+ fpath[i] = '1' + (fpath[i] - '1' + 1) % (si.max+1);
+ } while (!isdigit((int)buf[0]) && si.max > 0 && ch != fpath[i]);
}
}
}