aboutsummaryrefslogtreecommitdiff
path: root/net/gnu-finger/files/patch-ag
blob: c5f76137b1b7aacd15eb4dcf6c3eda530a6e7cb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- src/fingerd.c.orig	Wed Oct 28 15:12:52 1992
+++ src/fingerd.c	Sat May 11 23:41:11 2002
@@ -110,7 +110,7 @@
 int nofork = 0;
 
 /* The output stream for debugging. */
-FILE *debug_output = stderr;
+FILE *debug_output = NULL;
 
 /* Our in RAM database of user/host mappings. */
 FINGER_PACKET **host_packets = (FINGER_PACKET **)NULL;
@@ -139,13 +139,13 @@
   char *serverhost, *this_host;
   int arg_index = 1, optc;
 
-
+  debug_output = stderr;
   allow_time_outs = 1;
 
   default_error_handling (argv[0]);
 
   /* Parse arguments. */
-  while ((optc = getopt_long (argc, argv, "datfi", longopts, NULL)) >= 0)
+  while ((optc = getopt_long (argc, argv, "datfi:", longopts, NULL)) >= 0)
     switch (optc)
       {
       case 'd':
@@ -670,8 +670,11 @@
  
       for (i = 0; packets[i]; i++)
 	{
-	  if (debugging)
+	  if (debugging) {
+          if (debug_output == NULL)
+            debug_output = stderr;
 	    print_packet (packets[i], debug_output);
+        }
 
 	  if (packets[i]->idle_time < machine_idle_time)
 	    machine_idle_time = packets[i]->idle_time;