Changeset 9583

Show
Ignore:
Timestamp:
04/16/08 20:44:48 (5 years ago)
Author:
kiyoka
Message:

Fixed bug of ##(amazon ) command.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.kahua

    r8962 r9583  
    317317      ((amazon) 
    318318       (if (< 0 len) 
    319            (let1 _asin (car arg) 
    320                  (if (#/^[0-9a-zA-Z]+$/ _asin) 
    321                      (a/ 
    322                       (@/ (href (format #f "http://amazon.co.jp/o/ASIN/~a/kiye-22/ref=nosim" _asin))) 
    323                       (img/ 
    324                        (@/ (src (format #f "http://images.amazon.com/images/P/~a.09.MZZZZZZZ_.jpg" _asin)) 
    325                            (alt _asin)))) 
    326                      `(p/ ,(format "!!Error : ASIN code format error for ##(amazon asin) command \"~a\"!!" _asin)))) 
     319           (let* ((_asin (car arg)) 
     320                  (_asin (if (#/^[0-9]+$/ _asin) 
     321                             (format "~10,,,'0@a" _asin) 
     322                             _asin))) 
     323             (if (#/^[0-9a-zA-Z]+$/ _asin) 
     324                 (a/ 
     325                  (@/ (href (format #f "http://amazon.co.jp/o/ASIN/~a/kiye-22/ref=nosim" _asin))) 
     326                  (img/ 
     327                   (@/ (src (format #f "http://images.amazon.com/images/P/~a.09.MZZZZZZZ_.jpg" _asin)) 
     328                       (alt _asin)))) 
     329                 `(p/ ,(format "!!Error : ASIN code format error for ##(amazon asin) command \"~a\"!!" _asin)))) 
    327330           (p/ "!!Error : No argument ##(amazon URL) command"))) 
    328331