projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4578d24
)
Worked around issue where gotoroom() is called with WC->CurRoom.name and the contents...
author
Art Cancro
<ajc@uncensored.citadel.org>
Wed, 27 Jul 2011 20:35:02 +0000
(16:35 -0400)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 4 Sep 2011 21:43:51 +0000
(21:43 +0000)
webcit/roomops.c
patch
|
blob
|
history
diff --git
a/webcit/roomops.c
b/webcit/roomops.c
index 3d1e3a12c27bbfbbe4e86461b74b70606eeeca0f..b93a4910dae0f249182604160dc92974e39cc5bf 100644
(file)
--- a/
webcit/roomops.c
+++ b/
webcit/roomops.c
@@
-186,18
+186,30
@@
long gotoroom(const StrBuf *gname)
StrBuf *Buf;
static long ls = (-1L);
long err = 0;
StrBuf *Buf;
static long ls = (-1L);
long err = 0;
+ int room_name_supplied = 0;
+ int is_baseroom = 0;
/* store ungoto information */
/* store ungoto information */
- if (StrLength(gname) > 0)
+ if (StrLength(gname) > 0) {
+ room_name_supplied = 1;
+ }
+ if (room_name_supplied) {
strcpy(WCC->ugname, ChrPtr(WCC->CurRoom.name));
strcpy(WCC->ugname, ChrPtr(WCC->CurRoom.name));
+ if (!strcasecmp(ChrPtr(gname), "_BASEROOM_")) {
+ is_baseroom = 1;
+ }
+ }
WCC->uglsn = ls;
Buf = NewStrBuf();
/* move to the new room */
WCC->uglsn = ls;
Buf = NewStrBuf();
/* move to the new room */
- if (
StrLength(gname) > 0)
+ if (
room_name_supplied) {
serv_printf("GOTO %s", ChrPtr(gname));
serv_printf("GOTO %s", ChrPtr(gname));
- else /* or just refresh the current state... */
+ }
+ else {
+ /* or just refresh the current state... */
serv_printf("GOTO 00000000000000000000");
serv_printf("GOTO 00000000000000000000");
+ }
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, &err) != 2) {
serv_puts("GOTO _BASEROOM_");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, &err) != 2) {
serv_puts("GOTO _BASEROOM_");
@@
-215,11
+227,11
@@
long gotoroom(const StrBuf *gname)
FlushFolder(&WCC->CurRoom);
ParseGoto(&WCC->CurRoom, Buf);
FlushFolder(&WCC->CurRoom);
ParseGoto(&WCC->CurRoom, Buf);
- if (StrLength(gname) > 0)
- {
+ if (room_name_supplied) {
remove_march(WCC->CurRoom.name);
remove_march(WCC->CurRoom.name);
- if (
!strcasecmp(ChrPtr(gname), "_BASEROOM_"))
+ if (
is_baseroom) {
remove_march(gname);
remove_march(gname);
+ }
}
FreeStrBuf(&Buf);
}
FreeStrBuf(&Buf);