- Timestamp:
- 03/10/08 16:34:23 (5 years ago)
- Location:
- lang/c/partty/trunk
- Files:
-
- 3 modified
-
cmd_host.cc (modified) (4 diffs)
-
configure.in (modified) (2 diffs)
-
server.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/partty/trunk/cmd_host.cc
r7538 r7756 20 20 } 21 21 } 22 23 static char* fallback_shell[3]; 22 24 23 25 void usage(void) … … 48 50 }; 49 51 50 } 52 struct parse_end_exception {}; 53 struct parse_end { 54 unsigned int operator() (int argc, char* argv[]) { 55 throw parse_end_exception(); 56 } 57 }; 58 59 } // noname namespace 51 60 52 61 int main(int argc, char* argv[]) 53 62 { 63 { 64 fallback_shell[0] = getenv("SHELL"); 65 if(!fallback_shell[0]) { 66 #ifdef FALLBACK_SHELL 67 fallback_shell[0] = FALLBACK_SHELL; 68 fallback_shell[1] = NULL; 69 #else 70 fallback_shell[0] = "/bin/sh"; 71 fallback_shell[1] = "-i"; 72 fallback_shell[2] = NULL; 73 #endif 74 } 75 } 76 54 77 std::string session_name; 55 78 std::string message; … … 77 100 kz.on("-c", "--lock", Accept::Character(lock_char), lock_char_set); 78 101 kz.on("-h", "--help", Accept::Action(usage_action())); 79 kz.break_parse(argc, argv); // parse! 102 kz.on("--", "", Accept::Action(parse_end())); 103 try { 104 kz.break_parse(argc, argv); // parse! 105 } catch (parse_end_exception& e) { } 80 106 81 107 if( argc < 1 ) { … … 187 213 return host.run(argv); 188 214 } else { 189 return host.run( NULL);215 return host.run(fallback_shell); 190 216 } 191 217 } catch (Partty::partty_error& e) { -
lang/c/partty/trunk/configure.in
r7517 r7756 2 2 # Process this file with autoconf to produce a configure script. 3 3 4 AC_PREREQ(2. 61)5 AC_INIT(partty, 0.2. 8, fr _at_ syuki.skr.jp)6 AM_INIT_AUTOMAKE(partty, 0.2. 8)4 AC_PREREQ(2.59) 5 AC_INIT(partty, 0.2.9, fr _at_ syuki.skr.jp) 6 AM_INIT_AUTOMAKE(partty, 0.2.9) 7 7 AC_CONFIG_SRCDIR(partty.h) 8 8 AC_CONFIG_HEADER(config.h) … … 21 21 AC_CHECK_HEADERS(util.h) 22 22 fi 23 24 AC_ARG_WITH([shell], 25 AS_HELP_STRING([--with-shell=shell], 26 [path to fallback shell if SHELL environment variable is not available [[/bin/sh]]]), 27 [with_shell=$withval], [with_shell=/bin/sh]) 28 29 if test -z "$with_shell" ; then 30 with_shell=/bin/sh 31 fi 32 AC_DEFINE_UNQUOTED([FALLBACK_SHELL], ["$with_shell"], [fallback shell if SHELL environment variable is not available]) 23 33 24 34 # Checks for header files. -
lang/c/partty/trunk/server.cc
r7538 r7756 342 342 memcpy(gate_path + gate_dir_len, info.session_name, info.session_name_length); 343 343 gate_path[gate_dir_len + info.session_name_length] = '\0'; 344 std::cerr << "gate: '";345 std::cerr.write(info.session_name, info.session_name_length);346 std::cerr << "'" << std::endl;347 std::cerr << "s name len: " << info.session_name_length << std::endl;348 std::cerr << gate_path << std::endl;349 344 350 345 int fd = info.fd;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)