pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


urlparser1: Fix for relative/absolute paths
Posted by Anonymous on Thu 25th Jan 2024 01:10
raw | new post

  1. $ svn diff
  2. Index: urlparser1.c
  3. ===================================================================
  4. --- urlparser1.c        (revision 396)
  5. +++ urlparser1.c        (working copy)
  6. @@ -150,7 +150,7 @@
  7.                 slen = s-urlstr;
  8.                 (void)memcpy(uctx->hostport.hostname, urlstr, slen*sizeof(char));
  9.                 uctx->hostport.hostname[slen] = '\0';
  10. -               urlstr += slen;
  11. +               urlstr += slen + 1;
  12.  
  13.                 /*
  14.                  * check for addresses within '[' and ']', like
  15. @@ -223,10 +223,13 @@
  16.         (void)test_url_parser("foo://myuser@hostbar/baz");
  17.         (void)test_url_parser("foo://myuser:mypasswd@hostbar/baz");
  18.         (void)test_url_parser("foo://myuser:mypasswd@hostbar:666/baz");
  19. +       (void)test_url_parser("foo://myuser:mypasswd@hostbar:666//baz");
  20.         (void)test_url_parser("foo://myuser:mypasswd@[fe80::21b:1bff:fec3:7713]:666/baz");
  21.         (void)test_url_parser("foo://:mypasswd2@hostbar2:667/baf");
  22.         (void)test_url_parser("foo://hostbar");
  23.         (void)test_url_parser("foo://hostbar:93");
  24. +       (void)test_url_parser("nfs://hostbar:93/relativepath/a");
  25. +       (void)test_url_parser("nfs://hostbar:93//absolutepath/a");
  26.         (void)test_url_parser("foo://");
  27.         (void)test_url_parser("typo:/hostbar");
  28.         (void)test_url_parser("wrong");

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at