Remove trailing slashes from service name
authorAndreas Schneider <anschneider@suse.de>
Thu, 6 Dec 2007 11:29:52 +0000 (12:29 +0100)
committerVolker Lendecke <vl@sernet.de>
Thu, 6 Dec 2007 11:40:55 +0000 (12:40 +0100)
source/client/client.c

index a65906c21acfc5e85f357ef507263299234659f7..ed33d42081c6ea1e7af83a7371366b00a9160ec3 100644 (file)
@@ -3937,6 +3937,7 @@ static int do_message_op(void)
  int main(int argc,char *argv[])
 {
        pstring base_directory;
  int main(int argc,char *argv[])
 {
        pstring base_directory;
+       int len = 0;
        int opt;
        pstring query_host;
        bool message = False;
        int opt;
        pstring query_host;
        bool message = False;
@@ -4149,6 +4150,12 @@ static int do_message_op(void)
                        poptPrintUsage(pc, stderr, 0);
                        exit(1);
                }
                        poptPrintUsage(pc, stderr, 0);
                        exit(1);
                }
+               /* Remove trailing slashes */
+               len = strlen(service);
+               while(len > 0 && service[len - 1] == '\\') {
+                       --len;
+                       service[len] = '\0';
+               }
        }
        
        if ( strlen(new_workgroup) != 0 )
        }
        
        if ( strlen(new_workgroup) != 0 )